Skip to content

Turn Cookie Notice tab into a FrontConsent promo panel - #314

Merged
davidperezgar merged 6 commits into
trunkfrom
feature/cookie-notice-frontconsent-promo
Sep 29, 2026
Merged

davidperezgar merged 6 commits into
trunkfrom
feature/cookie-notice-frontconsent-promo

Conversation

@davidperezgar

@davidperezgar davidperezgar commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Cookie consent configuration moved to the new standalone FrontConsent plugin. The Cookie Notice settings tab no longer renders any config fields — it explains the move and offers a one-click "Install FrontConsent" button, or "Manage in FrontConsent" once it's active.
  • Removed ~900 lines of now-dead settings UI/sanitization code for Cookie Notice from 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() returns false once FrontConsent is active (FRCN_VERSION defined), so the two plugins never render a banner together even before FrontConsent's own migration flips the stored option.
  • Added CookieNoticeDeprecationNotice admin notice (separate from the tab) pointing existing users with Cookie Notice enabled toward installing FrontConsent.
  • Updated readme.txt (deprecation note + changelog entry) and AGENTS.md to point future cookie-consent work to FrontConsent's own repo.
  • Removed/replaced tests that exercised the deleted Settings methods (CookieNoticeIntegrationsTest, CookieNoticeSettingsSanitizationTest); preserved the still-relevant CookieNotice cache-invalidation coverage in a new CookieNoticeCacheInvalidationTest.

Test plan

  • php -l on all changed files
  • composer lint (phpcs) — clean
  • composer phpstan — clean
  • composer test — blocked in this environment (no local WordPress test install at the path tests/bootstrap.php expects); please run in CI
  • Manual check: Cookie Notice tab shows install CTA when FrontConsent is not installed, and "Manage in FrontConsent" once it is

🤖 Generated with Claude Code

Open WordPress Playground Preview

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T18:16:40.950737Z a30a546 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread includes/Admin/CookieNoticeDeprecationNotice.php Outdated
Comment thread includes/Admin/Settings.php
Comment thread includes/Admin/Settings.php
Comment thread includes/Admin/Settings.php
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>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment thread includes/Admin/CookieNoticeDeprecationNotice.php Outdated
Comment thread includes/Frontend/CookieNotice.php
Castellon-ACM and others added 2 commits September 29, 2026 08:00
This PR removed tests/js/cookie-notice-injection.test.js and its
package.json script (moved to FrontConsent), but the JavaScript tests
workflow still called npm run test:cookie-notice, failing every run
with "Missing script". Swapped it for test:column-link, which exists
(added by #296) but was never wired into this workflow either.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a30a546dee

ℹ️ 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".

Comment thread includes/Admin/CookieNoticeDeprecationNotice.php
@davidperezgar
davidperezgar merged commit 5e6a1fb into trunk Sep 29, 2026
7 checks passed
@davidperezgar
davidperezgar deleted the feature/cookie-notice-frontconsent-promo branch September 29, 2026 18:42
davidperezgar pushed a commit that referenced this pull request Sep 30, 2026
…ent) (#317)

* Remove legacy Cookie Notice runtime module (hard cutover to FrontConsent)

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 <noreply@anthropic.com>

* fix: realign RedundantPlugins array double-arrows after cookie-notice removal

Removing the 'cookie-notice' entry left 'svg-upload' and 'login-google' misaligned per WordPress.Arrays.MultipleStatementAlignment, which composer lint's phpcs run flagged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* fix: address Codex review findings on the Cookie Notice hard cutover

- Bump CookieNoticeDeprecationNotice::DISMISSED_META_KEY to a new name
  so an admin who dismissed the old, lower-stakes transition notice
  still sees this one — the site now has no consent banner at all
  until FrontConsent is installed, which the old dismissal predates.
- Rewrite the notice's copy (and its class docblock) to state plainly
  that the banner is already gone, instead of the stale "is moving" /
  "is being extracted" / "turns itself off" transition-period wording.
- Gate the Settings promo tab's install CTA on current_user_can(
  'install_plugins' ): a user with only edit_theme_options (e.g. a
  multisite subsite admin) could see the tab but would hit a failed
  nonce authorization on the install URL; they now get a message
  pointing at a site/network administrator instead.
- Drop cookie-consent claims from readme.txt's short description,
  opening paragraph, and Tags line, and point to FrontConsent instead
  — those are the first things a WordPress.org visitor sees, ahead of
  the (already-accurate) detailed changelog section.
- Correct readme.md and docs/REDUNDANT-PLUGINS.md, both still
  documenting Cookie Notice as one of the two core redundant-plugin
  defaults; the actual defaults are SVG Upload and Google Login.
- Clarify docs/COOKIE-NOTICE.md: the promo panel's link only installs
  FrontConsent when it isn't present yet — WordPress still requires a
  separate activation step, so "one-click install/activation" overstated
  what actually happens in one click.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants