Turn Cookie Notice tab into a FrontConsent promo panel - #314
davidperezgar wants to merge 3 commits into
Conversation
Cookie consent configuration moved to the new standalone FrontConsent plugin. The Cookie Notice settings tab no longer renders any config fields here; it explains the move and offers a one-click install of FrontConsent (or a "Manage in FrontConsent" link once it's active). The frontend banner keeps working during the transition and disables itself automatically once FrontConsent is detected (FRCN_VERSION). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20144f461b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return function_exists( 'is_plugin_active' ) | ||
| ? is_plugin_active( 'frontconsent/frontconsent.php' ) | ||
| : defined( 'FRCN_VERSION' ); |
There was a problem hiding this comment.
Recognize the WordPress.org FrontConsent installation path
When FrontConsent is installed through the new plugin=front-consent URL, WordPress installs it under the front-consent directory, but this check looks for frontconsent/frontconsent.php. Because is_plugin_active() is available when the admin notice renders, the ternary never falls back to FRCN_VERSION; consequently, the deprecation notice continues appearing on the Dashboard and Plugins screens after FrontConsent has been activated. Check the distributed plugin basename or treat the defined FRCN_VERSION constant as authoritative.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
| * Cookie Notice configuration moved out of FrontBlocks entirely (see | ||
| * `includes/Frontend/CookieNotice.php` and | ||
| * `includes/Admin/CookieNoticeDeprecationNotice.php`) — this tab no | ||
| * longer renders any settings fields, only an explanation and an | ||
| * install/manage call to action, so site owners who click the tab | ||
| * looking for cookie settings find where they actually live now. |
There was a problem hiding this comment.
Update the linked documentation for the promo-only tab
This change removes every Cookie Notice configuration field, but readme.md still links users to docs/COOKIE-NOTICE.md, which instructs them to enable the module at Appearance → FrontBlocks → Cookie Notice, describes all of the removed fields, and says statistics remain visible there. During the transition, users of the still-running bundled module are therefore directed to controls that no longer exist; update the linked documentation and readme.md to explain that configuration has moved to FrontConsent.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
| @@ -370,7 +266,6 @@ public function __construct() { | |||
|
|
|||
| add_action( 'admin_menu', array( $this, 'register_menu' ) ); | |||
| add_action( 'admin_init', array( $this, 'register_settings' ) ); | |||
There was a problem hiding this comment.
Keep the legacy GTM and GA4 migration active
Removing the admin_init migration breaks sites that upgrade directly from a release with the dedicated cookie_notice_gtm_id/cookie_notice_ga4_id fields to the release containing this commit, without first running 1.5.4's admin code. The current CookieNotice::get_tracking_integrations() reads the generic list and the older type/id pair but not those two dedicated keys, so the bundled module—which is explicitly meant to keep working during the transition—silently stops loading the site's GTM and GA4 tags after consent. Retain the migration until all supported upgrade paths and the FrontConsent import handle these legacy keys.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
| <p><?php esc_html_e( 'Cookie consent now has its own dedicated plugin: FrontConsent.', 'frontblocks' ); ?></p> | ||
| </div> | ||
| </div> | ||
| <div class="tw:max-w-xl tw:p-6 tw:bg-blue-50 tw:border tw:border-blue-200 tw:rounded-lg"> |
There was a problem hiding this comment.
Rebuild the admin stylesheet for the promo utilities
The new panel uses Tailwind utilities that are absent from the shipped assets/admin/settings.css, including tw:max-w-xl, tw:border-blue-200, tw:text-blue-900, tw:text-blue-800, and tw:text-green-800; this commit contains no rebuilt CSS. As a result, the installed plugin ignores those width, border, and text-color declarations, so the promo does not render with the authored design. Run the admin CSS build and commit the regenerated stylesheet with these PHP source changes.
AGENTS.md reference: AGENTS.md:L62-L64
Useful? React with 👍 / 👎.
That feature moved with the rest of cookie consent — its readme description now lives in FrontConsent's own readme.txt instead of being duplicated here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The tests exercised FrontBlocks\Frontend\CookieNotice directly and had no dependency on anything removed from Settings.php in the previous commit — they now live in FrontConsent, ported to its own namespace, option names and hook prefixes, since that's where ongoing development of this code happens. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2a38883a9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| $install_url = wp_nonce_url( | ||
| self_admin_url( 'update.php?action=install-plugin&plugin=front-consent' ), |
There was a problem hiding this comment.
Offer activation when FrontConsent is already installed
When FrontConsent is installed but inactive, this CTA still invokes install-plugin; WordPress cannot reinstall over the existing plugin directory, so the user reaches an installation error instead of activating FrontConsent, its migration never runs, and the legacy banner remains active. Detect the installed-but-inactive state and generate a nonce-protected activation URL instead; the settings-tab CTA at Settings.php:1901 needs the same handling.
AGENTS.md reference: AGENTS.md:L9-L9
Useful? React with 👍 / 👎.
| if ( defined( 'FRCN_VERSION' ) ) { | ||
| return false; |
There was a problem hiding this comment.
Add coverage for disabling the legacy module
This new FRCN_VERSION behavior has no programmatic coverage because the commit deletes every Cookie Notice PHPUnit/JavaScript test and removes its npm test command, even though the legacy module explicitly continues shipping during the transition. Add a focused test proving that a stored enabled setting is suppressed when FrontConsent is active, and retain coverage for the still-running module so this transition invariant cannot regress unnoticed.
AGENTS.md reference: AGENTS.md:L156-L159
Useful? React with 👍 / 👎.
Summary
Settings.php(banner copy, layout, colors, GTM/GA4/tracking integrations, legacy migration) — that logic lives in FrontConsent's own settings page now.CookieNotice::is_enabled()returnsfalseonce FrontConsent is active (FRCN_VERSIONdefined), so the two plugins never render a banner together even before FrontConsent's own migration flips the stored option.CookieNoticeDeprecationNoticeadmin notice (separate from the tab) pointing existing users with Cookie Notice enabled toward installing FrontConsent.readme.txt(deprecation note + changelog entry) andAGENTS.mdto point future cookie-consent work to FrontConsent's own repo.Settingsmethods (CookieNoticeIntegrationsTest,CookieNoticeSettingsSanitizationTest); preserved the still-relevantCookieNoticecache-invalidation coverage in a newCookieNoticeCacheInvalidationTest.Test plan
php -lon all changed filescomposer lint(phpcs) — cleancomposer phpstan— cleancomposer test— blocked in this environment (no local WordPress test install at the pathtests/bootstrap.phpexpects); please run in CI🤖 Generated with Claude Code