Skip to content

Carry over the review fixes of the FrontBlocks menu and the settings script - #364

Merged
davidperezgar merged 2 commits into
trunkfrom
fix/settings-menu-review-followup
Nov 19, 2026
Merged

davidperezgar merged 2 commits into
trunkfrom
fix/settings-menu-review-followup

Conversation

@davidperezgar

@davidperezgar davidperezgar commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #357 and #358. Both were merged before their review fixes were pushed to their branches, so those two commits never reached trunk. This pull request carries them over, cherry-picked onto trunk without changes.

What changes

Settings script (#358 follow-up)

  • Without a valid license, the short description cards were dimmed to 0.5 as a whole (badge and title included) on top of the existing .frbl-feature-pro styles. The script now clears the inline opacity, so only the mutual exclusion dims a card.
  • The selector test also checks selectors in double quotes and template literals.

FrontBlocks menu (#357 follow-up)

  • One rule, get_tab_menu_page(), decides which tabs get a menu page. The tab script only receives registered pages, so a tab hidden with 'menu' => false no longer sends the address bar to a page that does not exist (it keeps the current page and its #hash).
  • The main entry, admin.php?page=frontblocks-settings, is always registered, even when a filter removes or hides the first tab.
  • The legacy Appearance redirect encodes the values it forwards and only redirects GET and HEAD requests, so a form that still posts to the old URL keeps its data.
  • is_settings_screen() matches the screen ID exactly instead of a substring.
  • After saving, the browser returns to the page of the active tab.
  • render_page() uses self::CAPABILITY, and the last "Appearance → FrontBlocks" strings are updated (Google Sign-In notice, docs/STAGING.md).
  • Testimonials and Events (with an "Event categories" entry) now live in the FrontBlocks menu. The menu is registered at priority 9, so the settings come first and the top-level link still opens them, and License is moved to the end of the menu. The entries read "Testimonials" and "Events".
  • docs/SETTINGS-TAB-EXTENSIONS.md explains how a companion plugin can nest its own post types. FrontBlocks PRO does this for Popups in closemarketing/frontblocks-pro#122.

Testing

  • New and updated tests in SettingsMenuTest, EventsTest, TestimonialsTest and SettingsTest.
  • Full suite on this branch: 595 tests pass. composer lint and composer phpstan are clean.
  • Checked in the local site: the menu reads Blocks … Post types, Testimonials, Popups (with the PRO branch), License; the Testimonials list and editor keep the FrontBlocks menu open and highlighted; the old Appearance URL redirects with its arguments encoded; the short description cards look like the other PRO cards without a license.
Open WordPress Playground Preview

davidperezgar and others added 2 commits November 19, 2026 09:34
Now that the settings script no longer stops at load, the mutual
exclusion runs for sites without a valid license too, and it dimmed the
whole card (badge and title included) to 0.5 on top of the existing
.frbl-feature-pro styles. Clear the inline opacity instead, so only the
mutual exclusion dims a card.

The selector test now also checks selectors in double quotes and
template literals.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes:
- Share one rule (get_tab_menu_page()) between the menu and the tab
  script, so a tab without a menu page never points the address bar at
  an unregistered page; such a tab keeps the current page and its #hash.
- Always register the main page entry, even when a filter removes or
  hides the first tab.
- Encode the values the legacy redirect forwards, and only redirect GET
  and HEAD requests so a form posting to the old URL keeps its data.
- Anchor is_settings_screen() instead of matching a substring.
- Return to the page of the active tab after saving.
- Use self::CAPABILITY in render_page() and drop the leftover
  "Appearance > FrontBlocks" strings.

Menu:
- Testimonials and Events (with an Event categories entry) live in the
  FrontBlocks menu. The menu is registered at priority 9 so the settings
  come first, and License is moved to the end of the menu.
- Document how companion plugins can nest their own post types.

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

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T08:38:00.564159Z 49794ea PR opened
ℹ️ 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.

@davidperezgar
davidperezgar merged commit a2c8349 into trunk Nov 19, 2026
9 checks passed
@davidperezgar
davidperezgar deleted the fix/settings-menu-review-followup branch November 19, 2026 08:43
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