From 7f4ebe1d215741b4076223b09d60f8bf7c832e9c Mon Sep 17 00:00:00 2001 From: castellon Date: Wed, 30 Sep 2026 09:51:38 +0200 Subject: [PATCH 1/3] Remove legacy Cookie Notice runtime module (hard cutover to FrontConsent) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cookie consent now lives entirely in the standalone FrontConsent plugin. FrontBlocks no longer ships its own banner, AJAX consent endpoints, or GTM/GA4/tracking integrations — only the FrontConsent promo/migration panel added in #314 remains. - Delete includes/Frontend/CookieNotice.php and its assets (assets/cookie-notice/frontblocks-cookie-notice.{js,css}). - Stop instantiating Frontend\CookieNotice from Plugin_Main::load_modules(). - Drop the now-inaccurate 'cookie-notice' entry from Admin\RedundantPlugins::get_default_entries() — FrontBlocks no longer makes GDPR Cookie Compliance/CookieYes redundant. - Remove the orphaned .frbl-cookie-notice-preview* CSS left over from the pre-promo-panel settings preview. - Delete tests exercising the removed class (CookieNoticeLinkTest.php); trim CookieNoticeTransitionTest.php down to its CookieNoticeDeprecationNotice coverage and rename it CookieNoticeDeprecationNoticeTest.php, adding regression tests that the legacy class is gone and that the promo tab still renders without it. - Update RedundantPluginsTest.php, AGENTS.md, readme.txt/readme.md, and docs/COOKIE-NOTICE.md to describe this as a hard cutover rather than a transition, and fix a stale test comment referencing a cookie-notice JS test file that no longer exists. Admin\CookieNoticeDeprecationNotice and Settings::render_cookie_notice_promo_tab() are untouched — both only ever depended on each other, never on the removed runtime class. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/phpunit.yml | 2 - AGENTS.md | 2 +- assets/admin/settings-src.css | 37 - assets/admin/settings.css | 28 - .../frontblocks-cookie-notice.css | 298 ---- .../frontblocks-cookie-notice.js | 404 ----- docs/COOKIE-NOTICE.md | 21 +- includes/Admin/RedundantPlugins.php | 10 - includes/Admin/Settings.php | 12 +- includes/Frontend/CookieNotice.php | 1377 ----------------- includes/Plugin_Main.php | 3 - readme.md | 4 +- readme.txt | 3 +- .../CookieNoticeDeprecationNoticeTest.php | 64 + tests/Unit/CookieNoticeLinkTest.php | 116 -- tests/Unit/CookieNoticeTransitionTest.php | 63 - tests/Unit/RedundantPluginsTest.php | 23 +- tests/js/column-link-frontend.test.js | 2 +- 18 files changed, 96 insertions(+), 2373 deletions(-) delete mode 100644 assets/cookie-notice/frontblocks-cookie-notice.css delete mode 100644 assets/cookie-notice/frontblocks-cookie-notice.js delete mode 100644 includes/Frontend/CookieNotice.php create mode 100644 tests/Unit/CookieNoticeDeprecationNoticeTest.php delete mode 100644 tests/Unit/CookieNoticeLinkTest.php delete mode 100644 tests/Unit/CookieNoticeTransitionTest.php diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 9490f9f..936ab2a 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -14,7 +14,6 @@ on: - 'composer.lock' - 'package.json' - 'package-lock.json' - - 'assets/cookie-notice/**' - 'tests/js/**' pull_request: branches: @@ -30,7 +29,6 @@ on: - 'composer.lock' - 'package.json' - 'package-lock.json' - - 'assets/cookie-notice/**' - 'tests/js/**' types: - opened diff --git a/AGENTS.md b/AGENTS.md index 5b00eb9..e8da06f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,7 +6,7 @@ Guidelines for AI coding agents working on this WordPress plugin. **FrontBlocks Site Tools** is a free, all-in-one WordPress plugin covering the everyday needs of a site — not just a block-extension add-on. It bundles Gutenberg/GeneratePress block enhancements alongside general-purpose site utilities: maintenance mode, image management (size control + WebP/AVIF delivery), social login, and more. New features do not need to be block-related to belong here — evaluate additions against "does a typical WordPress site commonly need this," not "is this a block." The PRO companion lives at `wp-content/plugins/frontblocks-pro/`. -**Cookie Notice is deprecated here and moving to FrontConsent** (`wp-content/plugins/frontconsent/`), a dedicated standalone plugin. It still ships and works in FrontBlocks during the transition (see `includes/Frontend/CookieNotice.php` and `includes/Admin/CookieNoticeDeprecationNotice.php`), but do not extend it further — new cookie-consent work belongs in FrontConsent's own `AGENTS.md`. FrontBlocks' module disables itself automatically once FrontConsent is active (`FRCN_VERSION` defined), and FrontConsent migrates the site's settings/stats on activation. +**Cookie Notice has been removed from FrontBlocks and moved to FrontConsent** (`wp-content/plugins/frontconsent/`), a dedicated standalone plugin. This was a deliberate hard cutover, not a transition: the runtime banner, its AJAX consent endpoints, and its GTM/GA4/other tracking integrations no longer exist in this plugin. FrontBlocks only keeps a promo/migration-notice UI (`includes/Admin/Settings.php`'s `render_cookie_notice_promo_tab()` and `includes/Admin/CookieNoticeDeprecationNotice.php`) pointing site owners at FrontConsent. Do not add cookie-consent runtime code back here — new cookie-consent work belongs in FrontConsent's own `AGENTS.md`. - **PHP minimum:** 7.0 - **WordPress minimum:** 5.8 (required for the image-format-output filters used by Image Management) diff --git a/assets/admin/settings-src.css b/assets/admin/settings-src.css index 29cc18e..b2c123a 100644 --- a/assets/admin/settings-src.css +++ b/assets/admin/settings-src.css @@ -730,43 +730,6 @@ /* Save bar layout/position rules live further down (fixed to the viewport). */ -/* Cookie notice live preview: renders the real frontend banner markup/styles - confined to a small "stage" instead of position: fixed over the whole screen. */ -.frbl-cookie-notice-preview-stage { - position: relative; - height: 360px; - background: transparent; -} - -.frbl-cookie-notice-preview { - position: absolute !important; - z-index: 1 !important; - max-width: calc(100% - 24px); -} - -.frbl-cookie-notice-preview.frbl-cookie-notice--bar { - inset: auto 0 0 0; -} - -.frbl-cookie-notice-preview.frbl-cookie-notice--box { - bottom: 12px; -} - -.frbl-cookie-notice-preview.frbl-cookie-notice--box.frbl-cookie-notice--right { - right: 12px; -} - -.frbl-cookie-notice-preview.frbl-cookie-notice--box.frbl-cookie-notice--left { - left: 12px; -} - -.frbl-cookie-notice-preview.frbl-cookie-notice--popup { - position: absolute !important; - inset: 0; - background-color: rgba(15, 23, 42, 0.35); - padding: 12px; -} - /* Responsive adjustments */ @media (max-width: 640px) { .frbl-settings-wrapper { diff --git a/assets/admin/settings.css b/assets/admin/settings.css index b446db1..0806b79 100644 --- a/assets/admin/settings.css +++ b/assets/admin/settings.css @@ -1134,34 +1134,6 @@ font-weight: 700; font-size: 1.125rem; } -.frbl-cookie-notice-preview-stage { - position: relative; - height: 360px; - background: transparent; -} -.frbl-cookie-notice-preview { - position: absolute !important; - z-index: 1 !important; - max-width: calc(100% - 24px); -} -.frbl-cookie-notice-preview.frbl-cookie-notice--bar { - inset: auto 0 0 0; -} -.frbl-cookie-notice-preview.frbl-cookie-notice--box { - bottom: 12px; -} -.frbl-cookie-notice-preview.frbl-cookie-notice--box.frbl-cookie-notice--right { - right: 12px; -} -.frbl-cookie-notice-preview.frbl-cookie-notice--box.frbl-cookie-notice--left { - left: 12px; -} -.frbl-cookie-notice-preview.frbl-cookie-notice--popup { - position: absolute !important; - inset: 0; - background-color: rgba(15, 23, 42, 0.35); - padding: 12px; -} @media (max-width: 640px) { .frbl-settings-wrapper { margin-left: 0; diff --git a/assets/cookie-notice/frontblocks-cookie-notice.css b/assets/cookie-notice/frontblocks-cookie-notice.css deleted file mode 100644 index 77df6f8..0000000 --- a/assets/cookie-notice/frontblocks-cookie-notice.css +++ /dev/null @@ -1,298 +0,0 @@ -/** - * FrontBlocks Cookie Notice Styles - * - * @package FrontBlocks - * @version 1.0.0 - */ - -.frbl-cookie-notice { - --frbl-cookie-accent: #687df9; - --frbl-cookie-accent-contrast: #ffffff; - --frbl-cookie-accent-on-light: #687df9; - --frbl-cookie-bg: #ffffff; - --frbl-cookie-text: #1f2937; - --frbl-cookie-radius: 12px; - - position: fixed; - z-index: 999999; - box-sizing: border-box; - font-family: inherit; - line-height: 1.5; - opacity: 1; - transition: opacity 0.3s ease, transform 0.3s ease; -} - -.frbl-cookie-notice * { - box-sizing: border-box; -} - -.frbl-cookie-notice--hidden { - opacity: 0; - pointer-events: none; -} - -/* - * Initial, pre-decision state: printed by the server this way so a visitor - * who already accepted/rejected never sees the banner flash into view before - * frontblocks-cookie-notice.js hides it — the invisible state is the default, - * not something applied after the fact. It doubles as the "from" state of the - * entrance animation for a visitor who still needs to decide: the script - * removes this class once it determines that, letting the transition above - * animate it in. A `