Repository navigation
fix(bf): share the SDK Black Friday dismissal and show the banner again each year - #1188
Conversation
The banner dismissal was stored under a fixed 2025 key, so users who dismissed it last year would never see it again. The key and the UTM tag now use the current year. The BFCM2525 coupon is kept for 2026, as agreed in Codeinwp/marketing#365. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes requested
The per-year dismiss key works, but two tests do not check the new keys and links with fixed expected values.
Validation details
- Files reviewed: 2/2 changed files.
- The
dismiss_noticeREST handler saves any non-empty key, so the 2026 key saves and hides the banner. - The pinned Themeisle SDK 3.3.67 sale window ends by December 2, so the year suffix stays the same during the sale.
- PHPUnit 9.6.22 on PHP 8.3 ran the
get_bf_noticestests: all 12 pass on HEAD. - With
inc/admin.phpfrom pr-base, only the new previous-year test fails, as expected.
Untested areas
- The dashboard banner was not checked in a browser. The JavaScript did not change.
- The Jest and Playwright suites were not run.
🤖 Automated review · run code-review-agent_6ad6002616bc33.77586343.
🤖 Review agent — review posted ✅ on 1ff88af0 · changes requested · 2 findings · 16 min
Run code-review-agent_6ad6002616bc33.77586343 · trail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approved
The PR passes. Both earlier test findings are fixed, and the new commit adds no new problem.
Validation details
- Files reviewed: 2/2 changed files.
- Only
tests/test-admin.phpchanged since the last review.inc/admin.phpevidence from run code-review-agent_6ad6002616bc33.77586343 is reused, not rerun. - PHPUnit 9.6.22 on PHP 8.3 ran the
get_bf_noticestests at HEAD:cd /repo; set -o pipefail; timeout 280 vendor/bin/phpunit --do-not-cache-result --filter 'get_bf_notices' 2>&1 | tee /wo…printedOK (12 tests, 72 assertions)(run R1). - The new test asserts literal 2026 and 2025 keys and both UTM links.
- On pr-base, the fixed 2025 key hides the banner, so the new test cannot pass there.
Untested areas
- The dashboard banner was not checked in a browser. The JavaScript did not change.
- The Jest and Playwright suites were not run.
🤖 Automated review · run code-review-agent_6ad7202dd888f4.88191457.
🤖 Review agent — review posted ✅ on 58960faf · approved · 0 findings · 20 min
Run code-review-agent_6ad7202dd888f4.88191457 · trail
BFCM2525 becomes BFCM2625 in 2026, matching the dismiss key and UTM tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
||
| $promo_code = 'BFCM2525'; | ||
| // Code format: BFCM + 2-digit year + discount, e.g. BFCM2625. | ||
| $promo_code = 'BFCM' . $year_suffix . '25'; |
There was a problem hiding this comment.
@harshitarora-in for the promo code; do you want BFCM2626?
|
@Soare-Robert-Daniel We'll hold this one for now. We haven't decided Optimole's Black Friday deal yet, for this year or the coming ones, so I'd rather not build a code format, the 25% discount, or a yearly re-show into the plugin before that. For 2026, we'll keep the current notice as-is and keep After BFCM, we'll decide whether Optimole should get a recurring notice like our other products, or whether we decide each year. Please keep the branch. It's a good starting point if we go the recurring route. cc: @ineagu |
The store keeps BFCM2525 active, so only the dismiss key and UTM tag follow the year. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Optimole is an SDK product but registered no Black Friday config, so the SDK showed the generic ThemeIsle notice on every admin page. Hide it when Optimole is the only ThemeIsle product; other products keep their notice. The dashboard banner now uses the SDK dismissal (per user, reset every year) instead of its own site option. Dismissing either one hides both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The banner dismissal is stored in the SDK user meta, so the separate key had no storage role. Use the SDK meta name as the banner's dismiss_key instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SDK already shows its own Black Friday notice; Optimole does not need to hide it. Use the static `bfcm` campaign tag, the same as the other ThemeIsle products, so the code does not change every year.
The Optimole Black Friday banner used a dismiss option fixed to 2025, so users who dismissed it last year never saw it again. The banner also kept its own dismissal apart from the SDK Black Friday notice.
Note
The fixed 2025 key and UTM tag were added in 063d888 (#997) on version
v4.1.3.Banner dismissal — the banner uses the SDK dismissal (
themeisle_sdk_dismissed_notice_black_fridayuser meta) instead of theoptml_bf25_notice_dismisssite option. The dismissal is per user and resets every year.Shared dismissal — dismissing the Optimole banner also hides the ThemeIsle SDK notice. Dismissing the SDK notice also hides the Optimole banner. The sidebar notice always shows.
UTM tag —
bfcm25→bfcm, on the banner link and the sidebar link. This is the same static campaign tag the other ThemeIsle products use (Neve, Otter, Visualizer, Feedzy, SPC, PPOM…), so the code does not change every year.SDK global notice — Optimole does not change it. The SDK shows its ThemeIsle Black Friday notice on admin pages, the same as for the other products.
Important
The promo code stays
BFCM2525(25% off yearly plans). The store must keep this coupon active for 2026.Notice rules
Notice flow
flowchart LR A["Optimole page loads"] --> E{"Free plan and<br/>Black Friday window?"} E -- "No" --> X["No Black Friday notices"] E -- "Yes" --> F["Changed:<br/>sidebar notice<br/>with bfcm UTM"]:::changed F --> G{"Changed:<br/>SDK notice dismissed<br/>this year?"}:::changed G -- "Yes" --> H["Sidebar only"] G -- "No" --> I["Changed:<br/>banner with<br/>bfcm UTM"]:::changed I -- "Dismiss" --> J["Changed:<br/>writes the SDK<br/>dismissal user meta"]:::changed classDef changed fill:#9a6700,color:#fff,stroke:#5c3d00,stroke-width:3px,stroke-dasharray:6 3Stored data
themeisle_sdk_dismissed_notice_black_friday(owned by the SDK)Before → after: the site option
optml_bf25_notice_dismiss→ the SDK user meta above. Optimole no longer reads or writes a Black Friday option. Existingoptml_bf25_notice_dismissrows stay in the database, unused.Screenshots
Local site, free Optimole account, date set to 27 Nov 2026 unless a caption says otherwise.
Not dismissed (also: dismissed in 2025 only)
After the Optimole banner is dismissed
After the ThemeIsle SDK notice is dismissed on the WP Dashboard
Other situations (code path not changed by the last commit)
QA
You need a site connected to a free Optimole account, and an admin user. Add this file to force the 2026 sale window:
The SDK shows its notice only for products installed more than a few days ago. On a fresh site, make the install older first:
wp option update optimole_wp_install $(( $(date +%s) - 2592000 ))Mark the SDK notice as dismissed in 2025:
Expect: the command prints
Success.Go to
WP Admin → Dashboard.Expect: the ThemeIsle "Black Friday Sale" notice shows.
Go to
WP Admin → Optimole(/wp-admin/admin.php?page=optimole).Expect: the Black Friday banner shows. The banner and the sidebar notice both show the code
BFCM2525, and both links containutm_campaign=bfcm.Dismiss the banner, then go back to
WP Admin → Dashboard.Expect: the banner stays hidden on the Optimole page, the sidebar notice still shows, and the ThemeIsle notice is gone from the WP Dashboard.
wp option get optml_bf_notice_dismissreturns an error, because no option is stored.Run
wp user meta delete <your-user-id> themeisle_sdk_dismissed_notice_black_friday. Dismiss the ThemeIsle notice on the WP Dashboard, then open the Optimole page.Expect: the banner is hidden and the sidebar notice still shows.
Remove
wp-content/mu-plugins/optml-bf-qa.php, then reload the Optimole page.Expect: no Black Friday notices show.
Related: Codeinwp/marketing#365
🤖 Generated with Claude Code