Skip to content

Add dismissible admin notice inviting a WordPress.org review - #257

Open
davidperezgar wants to merge 5 commits into
trunkfrom
feature/review-notice
Open

Add dismissible admin notice inviting a WordPress.org review#257
davidperezgar wants to merge 5 commits into
trunkfrom
feature/review-notice

Conversation

@davidperezgar

@davidperezgar davidperezgar commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a dismissible admin_notices review prompt, shown 14 days after the plugin's first activation, with a "Leave a Review" link to the plugin's WordPress.org reviews page and a "No thanks" action.
  • Dismissal persists per user via user_meta, set through a nonce-protected AJAX call (frbl_dismiss_review_notice).
  • Mirrors the same structure FormsCRM (closemarketing/formscrm) uses for its own review notice (FORMSCRM_Review_Notice), adapted to FrontBlocks' namespaced class structure and naming conventions.
  • Bumps the plugin version to 1.5.1 with a changelog entry.

Test plan

  • php -l on the new class file
  • node --check on the new JS asset
  • Manually verify in wp-admin: notice appears on the Dashboard and FrontBlocks settings page once 14 days have passed since activation (or with a debug override), and that both the "No thanks" button and WordPress's native notice-dismiss button persist the dismissal per user

Generated by Claude Code

Open WordPress Playground Preview

Same structure FormsCRM uses for its own review notice: an admin_notices
hook shows a dismissible notice 14 days after first activation, with a
"Leave a Review" link to the plugin's WordPress.org reviews page and a
"No thanks" action that persists the dismissal per user via a
nonce-protected AJAX call.

@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: be3f034f5e

ℹ️ 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/ReviewNotice.php
Comment thread includes/Admin/ReviewNotice.php Outdated
Comment thread readme.txt
Comment thread assets/admin/review-notice.js Outdated
Comment thread includes/Admin/ReviewNotice.php Outdated
Comment thread includes/Admin/ReviewNotice.php Outdated
Comment thread readme.txt
…heck, docs

- Record the activation date via register_activation_hook() in
  frontblocks.php instead of an 'activated_plugin' listener registered
  from ReviewNotice's own constructor — that class is only instantiated
  on plugins_loaded, which has already fired (or won't fire again) by
  the time a first activation's hooks run, so it could never catch it.
- dismiss_review_notice() now also checks manage_options before saving
  the dismissal, matching the notice's own display gate.
- Yoda-condition the days-active comparison and terminate the
  translator comment with a period, per repo convention.
- Synced the readme.txt Version field with Stable tag.
- "No thanks" now only hides the notice once the AJAX dismissal
  request actually succeeds.
- Added docs/REVIEW-NOTICE.md and linked it from readme.md.

@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: 5561689936

ℹ️ 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/review-notice.js
Comment thread frontblocks.php
claude and others added 2 commits August 23, 2026 15:26
The nonce-failure wp_die() call had no response-code argument, so it
returned HTTP 200 like a successful request — the client's response.ok
check (added in the previous commit) would treat that as success and
hide the notice even though the dismissal was never saved. Passes 403,
matching the capability-check branch below it.

@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: 0e6b5f73da

ℹ️ 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/ReviewNotice.php Outdated
Passing an int as wp_die()'s $title is documented WP core behavior for
setting the response code (WordPress core docblock: "If $title is an
integer, then it is treated as the response code."), so 403 was already
being applied correctly — but the explicit array( 'response' => 403 )
form removes any ambiguity for a reader unfamiliar with that shorthand.
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