Fix - Stop registering the IE-conditional html5shiv script that fires a deprecation notice - #73
Open
rajatgautam755421 wants to merge 2 commits into
Open
rajatgautam755421 wants to merge 2 commits into
rajatgautam755421 wants to merge 2 commits into
Conversation
… a deprecation notice (themegrill/radiate-pro#38) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
QA suite — passed ✅All 10 checks passed. 6 passed · 0 failed · 4 skipped · 0 flaky · 14s Automated check — no AI involved. It runs the tests in this branch. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fix is appropriate; only a minor issue-reference nit remains.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Replaces deprecated IE-conditional html5shiv registration with an empty dependency handle and enables the homepage regression test.
Changes:
- Prevents WordPress 6.9+ deprecation notices.
- Preserves
html5shivdependency compatibility. - Activates the no-PHP-notices regression test.
| File | Description |
|---|---|
tests/e2e/specs/homepage/front-page-health.spec.ts |
Enables the deprecation regression test; issue guard should use the fully qualified repository reference. |
functions.php |
Registers an empty html5shiv handle. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…reference (themegrill/radiate-pro#38) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
The theme registered
html5shiv.js(an IE 8 polyfill) withwp_script_add_data( 'html5shiv', 'conditional', 'lte IE 8' ). Since WordPress 6.9 that call fires_deprecated_argument()("IE conditional comments are ignored by all supported browsers") on every front-end request, and the script is no longer printed at all — so it only produced a deprecation notice (visible whereverWP_DEBUG_DISPLAYis on, and in Query Monitor / logs).Closes themegrill/radiate-pro#38 · Same fix as Spacious Pro (themegrill/spacious-pro#203).
Fix
Replaced the enqueue + conditional with an empty handle:
An empty handle instead of a plain delete so a child theme or plugin that lists
html5shivas a dependency still loads (WordPress drops scripts whose dependencies aren't registered). Verified: a script depending onhtml5shivstill prints.js/html5shiv*.jsare left in place so direct URLs don't 404.Effect on existing sites: WP 6.9+: no HTML change (the script was already never printed), the notice stops. WP < 6.9: the
<!--[if lte IE 8]>comment is no longer printed; it was a plain HTML comment in every browser except IE 8.Before / After
Testing
.fixmefrom the quarantined "front page prints no PHP notices" scenario infront-page-health.spec.ts. Passes with the fix and fails on the old code. It only detects the notice where debug display is on; homepage/header specs still pass.functions.phpunchanged. WP 7.1.2 on the local site; notice reproduced with a probe that printsdeprecated_argument_runand gone after the fix.🤖 Generated with Claude Code