Add dismissible admin notice inviting a WordPress.org review - #257
Add dismissible admin notice inviting a WordPress.org review#257davidperezgar wants to merge 5 commits into
Conversation
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.
There was a problem hiding this comment.
💡 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".
…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.
There was a problem hiding this comment.
💡 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".
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.
There was a problem hiding this comment.
💡 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".
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.
Summary
admin_noticesreview 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.user_meta, set through a nonce-protected AJAX call (frbl_dismiss_review_notice).FormsCRM(closemarketing/formscrm) uses for its own review notice (FORMSCRM_Review_Notice), adapted to FrontBlocks' namespaced class structure and naming conventions.Test plan
php -lon the new class filenode --checkon the new JS assetGenerated by Claude Code