Skip to content

Add settings tabs and FrontConsent PRO upsell CTAs - #3

Merged
davidperezgar merged 6 commits into
mainfrom
feature/pro-upsell-tabs
Sep 28, 2026
Merged

davidperezgar merged 6 commits into
mainfrom
feature/pro-upsell-tabs

Conversation

@davidperezgar

Copy link
Copy Markdown
Contributor

Summary

  • Restructures the FrontConsent settings page into a minimal tab shell (Cookie Notice tab + a hook-populated slot), matching the same settings-tab extension pattern FrontBlocks free already exposes to FrontBlocks PRO.
  • Adds frontconsent_settings_tabs filter and frontconsent_settings_tab_panels action so a companion plugin (FrontConsent PRO) can inject its own tab (e.g. License) without FrontConsent needing any knowledge of licensing.
  • When no companion plugin has claimed that slot, a lightweight "FrontConsent PRO" upsell tab/card renders instead, plus an inline promo link on the Cookie Notice tab — both link to close.technology/wordpress-plugins/frontconsent-pro/ with UTM tracking.
  • Version bumped 1.0.0 → 1.1.0, changelog updated.

Why

FrontConsent PRO (a new companion plugin) originally implemented its License page as its own separate top-level Settings menu item. That didn't match the established sibling-plugin convention: FrontBlocks PRO injects a License tab directly into FrontBlocks' own settings screen instead of creating a new page. This PR brings FrontConsent's settings page up to the same extensible-tabs pattern so FrontConsent PRO (see its own PR) can do the same.

Test plan

  • composer lint — clean
  • composer phpstan — clean
  • Manual verification in Studio: Cookie Notice tab renders unchanged with all existing fields intact; inline PRO promo link present with correct UTM URL; with FrontConsent PRO active, License tab correctly replaces the upsell tab and renders the license key form; tab switching works via click and via URL hash.
  • Confirm tab persists across a settings save (submit while on a non-default tab, confirm it reopens on the same tab after the options.php redirect).

Depends on nothing; frontconsent-pro's companion PR depends on the hooks added here.

🤖 Generated with Claude Code

Restructures the settings page into a minimal tab shell (Cookie
Notice + a hook-populated slot) so a companion plugin can inject its
own tab via the new frontconsent_settings_tabs filter and
frontconsent_settings_tab_panels action, exactly like FrontBlocks'
own settings-tab extension points. When no companion plugin has
claimed that slot, a lightweight FrontConsent PRO upsell card fills
it instead, plus an inline promo link on the Cookie Notice tab.

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

chatgpt-codex-connector Bot commented Sep 28, 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-28T11:33:36.501872Z 836aafe 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: f969e28220

ℹ️ 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 assets/admin/settings.js
Comment thread readme.txt Outdated
Comment thread includes/Admin/Settings.php Outdated
Comment thread assets/admin/settings.js Outdated
Comment thread assets/admin/settings.css Outdated
Comment thread assets/admin/settings.js Outdated
Renames the default tab from "Cookie Notice" to "Settings" and adds
a frontconsent_settings_form_tab_panels action that fires inside the
main settings <form>, before the submit button — for a companion
tab whose fields are registered under the same frontconsent_settings
option group and need to submit through this form, unlike a
self-contained panel (e.g. License) that manages its own persistence
via frontconsent_settings_tab_panels.

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: d9d358732e

ℹ️ 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/Settings.php
davidperezgar and others added 2 commits September 28, 2026 13:08
The 640px cap left the toggle switch floating with a visible gap
before the actual right edge of the settings field column, instead
of sitting flush against it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- Add Node test coverage for the new tab shell: activation, hash
  restoration, keyboard navigation, referer persistence across
  multiple forms, and submit-button visibility.
- Document the new settings-tab extension hooks in readme.md
  (previously only in readme.txt's changelog).
- Hide the inline "Get FrontConsent PRO" promo once a companion
  plugin has registered a License tab, matching the existing upsell
  tab's own gating.
- Rewrite the _wp_http_referer hash for every form on the page, not
  just the main settings form, so a companion tab with its own form
  (e.g. License) also reopens on the right tab after saving.
- Increase the upsell CTA button and PRO chip contrast from 3.57:1 to
  4.74:1 to meet WCAG AA for normal-size text.
- Add roving tabindex and Arrow/Home/End keyboard support to the
  ARIA tablist, matching the interaction model the roles imply.
- Hide the main form's submit button while a tab outside that form
  (License, or the built-in PRO upsell) is active, instead of always
  showing "Save Changes" regardless of the active tab.

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: f04d384c01

ℹ️ 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 readme.txt Outdated
Comment thread includes/Admin/Settings.php Outdated
davidperezgar and others added 2 commits September 28, 2026 13:29
- Give each tab button and panel matching stable IDs
  (frcn-tab-{id}/frcn-tabpanel-{id}), aria-controls, role="tabpanel",
  and aria-labelledby, so assistive technology can determine which
  panel a tab controls — data-tab-* attributes alone don't express
  that relationship.
- Document the contract in both hook docblocks so a companion tab
  stays consistent with the built-in ones.
- Mention frontconsent_settings_form_tab_panels (not just
  frontconsent_settings_tab_panels) in readme.txt's changelog.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Reverts the earlier removal of max-width: 640px on this row. Without
it, the toggle sits flush against the wide WordPress form-table
cell's true right edge, ending up ~400px past where every panel
below it (also capped at 640px) actually ends — misaligned rather
than fixed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@davidperezgar
davidperezgar merged commit 49d4f64 into main Sep 28, 2026
6 checks passed
@davidperezgar
davidperezgar deleted the feature/pro-upsell-tabs branch September 28, 2026 11:33
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.

1 participant