Skip to content

Fix - Stop registering the IE-conditional html5shiv script that fires a deprecation notice - #73

Open
rajatgautam755421 wants to merge 2 commits into
developfrom
fix/38-html5shiv
Open

rajatgautam755421 wants to merge 2 commits into
developfrom
fix/38-html5shiv

Conversation

@rajatgautam755421

@rajatgautam755421 rajatgautam755421 commented Sep 30, 2026 •

Copy link
Copy Markdown

Summary

The theme registered html5shiv.js (an IE 8 polyfill) with wp_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 wherever WP_DEBUG_DISPLAY is 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:

// Empty handle kept so scripts that list 'html5shiv' as a dependency still load.
wp_register_script( 'html5shiv', false, array(), wp_get_theme()->get( 'Version' ), false );

An empty handle instead of a plain delete so a child theme or plugin that lists html5shiv as a dependency still loads (WordPress drops scripts whose dependencies aren't registered). Verified: a script depending on html5shiv still prints. js/html5shiv*.js are 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

Before After
before after

Testing

  • Removed .fixme from the quarantined "front page prints no PHP notices" scenario in front-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.
  • PHPCS for functions.php unchanged. WP 7.1.2 on the local site; notice reproduced with a probe that prints deprecated_argument_run and gone after the fix.

🤖 Generated with Claude Code

… a deprecation notice (themegrill/radiate-pro#38)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The fix is appropriate; only a minor issue-reference nit remains.

Review effort: Lite
Findings: 1 Low severity

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 html5shiv dependency 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.

Comment thread tests/e2e/specs/homepage/front-page-health.spec.ts Outdated
…reference (themegrill/radiate-pro#38)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants