Fix - Deprecated IE-conditional html5shiv enqueue firing a notice on every page load - #151
Merged
Merged
Conversation
…every page load (WP 6.9+) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QA suite — refused, no regression specThis PR changes product source but adds no spec, so the suite was Source files changed with no matching spec |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved review issues remain.
Review effort: Lite
Findings: None
What changed in this PR
Replaces the deprecated IE8 html5shiv enqueue with an empty html5 handle, preventing WordPress 6.9+ notices while preserving dependencies.
Changes:
- Removes obsolete conditional script metadata.
- Registers an empty
html5compatibility handle.
| File | Summary |
|---|---|
inc/enqueue-scripts.php |
Replaces the deprecated enqueue with an empty registered handle. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
iamprazol
added a commit
that referenced
this pull request
Sep 29, 2026
* Fix - CI dependency install fails with pnpm 11 on Node 20 runners * Fix - Copilot review: use pnpm 10 instead of 9, and the real build-script allowlist key pnpm 9 doesn't gate install/postinstall scripts at all, so downgrading to it silently dropped the build-script allowlist protection pnpm 11 had (verified directly: pnpm 11 blocks an unlisted package's postinstall by default, pnpm 9 runs every package's scripts unconditionally). pnpm 10.34.5 declares the same Node >=18.12 compatibility as 9, so it still fixes the original CI failure, but keeps the same default-deny behavior as 11. Also switched pnpm-workspace.yaml from the pnpm 11-only "allowBuilds" map (confirmed not recognized by pnpm 10) to the documented, version-portable "onlyBuiltDependencies" array, which works correctly on both. * Fix - WooCommerce product page layout shows Right Sidebar but renders full width (#139) * Fix - Responsive menu shows enabled but never applies until saved once (#138) * Fix - Responsive menu shows enabled but never applies until saved once * Fix - Copilot review findings on the responsive-menu e2e suite Scopes the changeset cleanup to the suite's own admin user, represents an absent theme_mods row instead of throwing on a fresh install, restricts menu reuse to the primary location, maps inc/functions.php into the header area, fixes the mobile-menu-toggle spec to open the submenu's own caret toggle before asserting its content is visible, and publishes reverted Customizer values in cleanup (not just setting them) so Playground runs actually revert. Also fixes: a missing ignoreHTTPSErrors option that blocked the suite from ever running against a local DDEV site, and several specs calling setControl() on a page that had already navigated away from the Customizer. * Fix - auth.setup guards against a cold-boot fill race on Playground Waits for both login fields to be visible and confirms the password value actually landed before submitting, instead of filling immediately after goto(). A cold Playground boot can serve wp-login.php before it has fully hydrated, silently losing a fill() with no error. * Fix - Version theme scripts and styles with the theme version (#142) * Fix - Version theme scripts and styles with the theme version The main stylesheet and most theme scripts were enqueued without a version, so WordPress appended its own core version and browsers or CDNs kept serving old copies after a theme update until WordPress itself was updated. Pass SPACIOUS_THEME_VERSION, as the Customizer and admin assets already do. Handles, dependencies and load order are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Leave a child theme's stylesheet on its default version get_stylesheet_uri() is the child theme's own style.css when a child theme is active, so stamping it with the parent's version was wrong. Keep WordPress' default version there, exactly as before this change, and use the theme version only for Spacious' own stylesheet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Slider assets load unconditionally on the blog index due to an operator-precedence bug (#145) * Fix - Submenu caret icon never flips direction when toggled (#149) The sub-toggle click handler looked for a child matching ".sub-toggle .fa", but inside the handler `this` already is the .sub-toggle element itself, not a container of one - so the selector never matched anything and toggleClass() silently ran on an empty set. The submenu itself opened and closed correctly (a separate call), only the caret's own direction (caret-right/caret-down) never updated. Fixed by matching the icon's actual direct child selector, ".fa". Verified live in both themes: before the fix, clicking the caret expanded the submenu but the icon class never changed; after, it flips fa-caret-right <-> fa-caret-down correctly in both directions. Also checked and ruled out a previously-suspected duplicate id="site-navigation" theory: header.php's two spacious_main_nav() call sites are wrapped in genuinely mutually exclusive conditions (spacious_header_display_type === 'four' vs !== 'four'), so only one nav ever renders - confirmed with 0 duplicates under both settings, live. Nothing to fix there. * Fix - Deprecated IE-conditional html5shiv enqueue firing a notice on every page load (WP 6.9+) (#151) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Fix - navigation.js null errors on pages without the theme header (Widgets screen previews) (#147) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Search block input renders taller than its Search button (#148) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Meta box save routine reads $_POST without isset() checks or a value whitelist (#140) * Fix - Unbounded get_users() full-table scan in theme-switch cleanup (#144) * Fix - Missing capability check on free->pro migration trigger (#146) Adds current_user_can( 'edit_theme_options' ) alongside the existing nonce verification in the demo-import migration trigger, its notice, and its dismiss handler. The nonce alone only proved the request came from the current user's own session, not that they were allowed to run the action - any logged-in user, regardless of role, could force a site-wide theme_mods and options rewrite using stale legacy data, since the migration functions are hooked to after_setup_theme, which fires on the front end too. Verified live: a subscriber-role account, using a nonce genuinely valid for their own session, is now correctly rejected with "You do not have permission to perform this action." * Fix - Block borders set in the editor not showing on the front end (#150) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Header cart count and total stale after AJAX add to cart (#143) * Fix - Header cart count and total stayed stale after AJAX add to cart The header cart block was rendered once at page load and never registered as a WooCommerce cart fragment, so it only refreshed on a full reload while the mini-cart updated. Move the block into a shared function used by both the initial render and a woocommerce_add_to_cart_fragments filter. The filter is registered with the default spacious_cart_icon(), so a child theme overriding it keeps its own markup, and it never overwrites a fragment already supplied for the same selector. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update translation template after moving the header cart strings Regenerated with the makepot options from Gruntfile.js. Only the creation date and source line references change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Update the header cart on the Cart and Checkout pages The WooCommerce cart widget, which normally loads cart fragments, hides itself on the Cart and Checkout pages, so the header cart never refreshed there. The Cart and Checkout blocks also change the cart through the Store API without firing the events cart fragments listen for. Load cart fragments whenever the header cart icon is on, and when the Cart or Checkout block's cart store changes its item count or subtotal, trigger a fragment refresh so the header is re-rendered by spacious_cart_icon_views(). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Block editor ignores Customizer typography and colors (#152) * Fix - Block editor ignores Customizer typography and colors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix - Editor post title used the H1 size instead of the front-end title size Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add - E2E guard: block editor matches the front-end Customizer typography and colors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove - manually added E2E spec; specs come from the verify-fix flow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Match footer credit wording to Pro's corrected punctuation spacious_footer_copyright()'s default text was missing a colon after "Theme" and carried a trailing period Pro's own fix already dropped - "Theme Spacious by ThemeGrill. Powered by: WordPress." here vs Pro's "Theme: Spacious Pro by ThemeGrill. Powered by: WordPress". Added the colon and removed the trailing period so both editions read the same way. Verified live: front end now shows "Theme: Spacious by ThemeGrill. Powered by: WordPress" with no trailing period. PHPCS unchanged (166 errors / 66 warnings, identical before and after). * Version bump to release of v1.10.0 * Default theme options to an empty array in the major controls migration get_option( $themename ) returns false whenever the option doesn't exist (fresh installs), and the subsequent unset() calls on that false value log PHP 8.1+ "Automatic conversion of false to array" deprecation notices on every after_setup_theme bootstrap until the migration flag is set. Ported from spacious-pro release/v2.8.0 (commit 7601809f), which fixed the same pattern against its own hardcoded 'spacious' option lookup. Verified live: reproduced 2 deprecation notices at migration.php:63 with the old spacious option absent, confirmed 0 after, via a real front-end request with Playwright against the Spacious theme. --------- Co-authored-by: Rajat Gautam <83450756+rajatgautam755421@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Prajjwal Poudel <iamprazol@gmail.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.
Changes proposed in this Pull Request:
Free-theme part of themegrill/spacious-pro#146 (part 1). Pro PR: themegrill/spacious-pro#203.
Merge note: #142 edits the line just above; both PRs merge cleanly in either order (checked with
git merge-tree).The theme enqueued html5shiv (an IE 8 polyfill) with
wp_script_add_data( 'html5', 'conditional', 'lte IE 8' ). Since WordPress 6.9,add_data()withconditionalfires_deprecated_argument()("IE conditional comments are ignored by all supported browsers") on every front-end request, andWP_Scripts::do_item()no longer prints scripts that have conditional data. So the script had no effect and only produced a deprecation notice per page load. The enqueue also passedtrueas the dependency argument.This replaces the two lines with an empty
html5handle:Why an empty handle instead of deleting the lines: if a child theme, plugin or snippet enqueues a script with
'html5'in its dependencies, WordPress drops that script entirely when the dependency isn't registered (and logs "enqueued with dependencies that are not registered: html5"). Verified: with a plain delete, such a script stopped printing; with the empty handle it prints exactly as ondevelop. The handle prints nothing.js/html5shiv.js/html5shiv.min.jsare left in place, so any child theme referencing the file URL directly doesn't get a 404.Effect on existing sites
<!--[if lte IE 8]>…<![endif]-->block is no longer printed. It is an HTML comment in every browser except IE 8 and older, so nothing changes visually or functionally.html5handle: unchanged (still loads).html5: unchanged.html5handle before the theme, the theme used to attach the IE condition to that plugin's script, which suppressed it. It now loads as the plugin intended.How to test the changes in this Pull Request:
WP_DEBUGandWP_DEBUG_LOGon, load any front-end page.debug.loggets "Function WP_Dependencies->add_data() was called with an argument that is deprecated since version 6.9.0!" on every page load. After: nothing.lte IE 8block, same as before on WP 6.9+; every other script and stylesheet is unchanged.array( 'html5' )as dependencies; it still prints.Types of changes:
Other information:
Changelog entry
Fix - Deprecation notice on every page load from the IE 8 html5shiv script under WordPress 6.9+.
Verification (WordPress 7.1.2)
deprecated_argument_runforadd_data()(9 front-end pages)lte IE 8in page sourcehtml5html5after the theme / child theme deregistershtml5html5before the theme🤖 Generated with Claude Code