From 67967c2ff08db671201950944861dca3d32829ac Mon Sep 17 00:00:00 2001 From: rg755421 Date: Thu, 1 Oct 2026 09:11:52 +0545 Subject: [PATCH 1/2] Fix - Stop registering the IE-conditional html5shiv script that fires a deprecation notice wp_script_add_data( 'html5shiv', 'conditional', 'lte IE 8' ) fires a deprecation notice on every page since WordPress 6.9, and the script is no longer printed at all. Replaced with an empty html5shiv handle, as in Spacious and Radiate, so scripts that depend on it still load. js/html5shiv.js stays so direct URLs don't 404. Same fix as themegrill/accelerate-pro#21. Co-Authored-By: Claude Opus 5.5 (1M context) --- inc/functions.php | 4 ++-- tests/e2e/specs/smoke/no-php-notices.spec.ts | 22 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 tests/e2e/specs/smoke/no-php-notices.spec.ts diff --git a/inc/functions.php b/inc/functions.php index f0e5f66..1a8c243 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -114,8 +114,8 @@ function accelerate_scripts_styles_method() { // wp_enqueue_style( 'accelerate-fontawesome', get_template_directory_uri() . '/fontawesome/css/font-awesome.css', array(), '4.7.0' ); - wp_enqueue_script( 'html5shiv', ACCELERATE_JS_URL . '/html5shiv.js', array(), '3.7.3', false ); - wp_script_add_data( 'html5shiv', 'conditional', 'lte IE 8' ); + // Empty handle kept so scripts that list 'html5shiv' as a dependency still load. + wp_register_script( 'html5shiv', false, array(), ACCELERATE_THEME_VERSION, false ); } function accelerate_block_editor_styles() { diff --git a/tests/e2e/specs/smoke/no-php-notices.spec.ts b/tests/e2e/specs/smoke/no-php-notices.spec.ts new file mode 100644 index 0000000..2da0f6c --- /dev/null +++ b/tests/e2e/specs/smoke/no-php-notices.spec.ts @@ -0,0 +1,22 @@ +import { test, expect } from "@playwright/test"; + +/** + * @area homepage + * @tier fresh + * @guards themegrill/accelerate-pro#21 + * @source themegrill/radiate#73 (same fix); themegrill/spacious#151 + * @why accelerate_scripts_styles_method() registered html5shiv with + * wp_script_add_data( 'html5shiv', 'conditional', 'lte IE 8' ), which + * WordPress 6.9+ deprecates, so every front-end page printed a + * "Deprecated: WP_Dependencies->add_data()" notice when WP_DEBUG_DISPLAY + * is on. Only observable where debug display is enabled; on a site with it + * off this passes regardless. Asserts no PHP notice markup anywhere in the + * response (it is printed inside ), not the absence of html5shiv. + */ +test("front page prints no PHP notices or deprecations @homepage @smoke @fresh", async ({ page }) => { + // Read the raw response: PHP prints the notice while wp_head() runs, before + // , so a body locator would miss it. + const response = await page.goto("/"); + const html = await response!.text(); + expect(html).not.toMatch(/(?:^|>|\s)(?:)?(?:Deprecated|Notice|Warning|Fatal error)(?:<\/b>)?:\s/); +}); From 1fced6408929d1dd70a2c6b0a6c8fea3d491bd8a Mon Sep 17 00:00:00 2001 From: rg755421 Date: Thu, 1 Oct 2026 09:20:26 +0545 Subject: [PATCH 2/2] Test - Tag the PHP-notices spec with the area inc/functions.php maps to, and assert a 200 The area decides whether the suite runs this spec for a change to inc/functions.php; it was tagged with an area that file doesn't map to. Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/e2e/specs/smoke/no-php-notices.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/e2e/specs/smoke/no-php-notices.spec.ts b/tests/e2e/specs/smoke/no-php-notices.spec.ts index 2da0f6c..3801e13 100644 --- a/tests/e2e/specs/smoke/no-php-notices.spec.ts +++ b/tests/e2e/specs/smoke/no-php-notices.spec.ts @@ -1,7 +1,7 @@ import { test, expect } from "@playwright/test"; /** - * @area homepage + * @area assets * @tier fresh * @guards themegrill/accelerate-pro#21 * @source themegrill/radiate#73 (same fix); themegrill/spacious#151 @@ -13,10 +13,11 @@ import { test, expect } from "@playwright/test"; * off this passes regardless. Asserts no PHP notice markup anywhere in the * response (it is printed inside ), not the absence of html5shiv. */ -test("front page prints no PHP notices or deprecations @homepage @smoke @fresh", async ({ page }) => { +test("front page prints no PHP notices or deprecations @assets @smoke @fresh", async ({ page }) => { // Read the raw response: PHP prints the notice while wp_head() runs, before // , so a body locator would miss it. const response = await page.goto("/"); + expect(response?.ok(), `homepage returned HTTP ${response?.status()}`).toBeTruthy(); const html = await response!.text(); expect(html).not.toMatch(/(?:^|>|\s)(?:)?(?:Deprecated|Notice|Warning|Fatal error)(?:<\/b>)?:\s/); });