Skip to content

fix(bf): share the SDK Black Friday dismissal and show the banner again each year - #1188

Merged
Soare-Robert-Daniel merged 7 commits into
developmentfrom
fix/bf-notice-yearly-dismiss
Nov 6, 2026
Merged

Soare-Robert-Daniel merged 7 commits into
developmentfrom
fix/bf-notice-yearly-dismiss

Conversation

@Soare-Robert-Daniel

@Soare-Robert-Daniel Soare-Robert-Daniel commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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_friday user meta) instead of the optml_bf25_notice_dismiss site 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

Situation WP Dashboard and other admin pages Optimole dashboard
Free plan, not dismissed this year ThemeIsle SDK notice Banner and sidebar notice
User dismissed the banner or the SDK notice this year No Black Friday notice Sidebar notice only
User dismissed in 2025 only Same as not dismissed Banner and sidebar notice
Paid plan Same as the free plan No Black Friday notices
Outside the sale window No Black Friday notice No Black Friday notices

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 3
Loading

Stored data

Data Value Lifetime
User meta themeisle_sdk_dismissed_notice_black_friday (owned by the SDK) Timestamp of the dismissal Set when the user dismisses the banner or the SDK notice. Counts only for the year of the timestamp.

Before → after: the site option optml_bf25_notice_dismiss → the SDK user meta above. Optimole no longer reads or writes a Black Friday option. Existing optml_bf25_notice_dismiss rows 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)

WP Dashboard — ThemeIsle SDK notice Optimole dashboard — banner and sidebar notice
WP Dashboard with the ThemeIsle SDK notice Optimole dashboard with the banner and the sidebar notice

After the Optimole banner is dismissed

WP Dashboard — SDK notice hidden Optimole dashboard — sidebar notice only
WP Dashboard after the Optimole banner is dismissed Optimole dashboard after the banner is dismissed

After the ThemeIsle SDK notice is dismissed on the WP Dashboard

Optimole dashboard — banner hidden, sidebar notice shows
Optimole dashboard after the SDK notice is dismissed

Other situations (code path not changed by the last commit)

Paid plan — no Black Friday notices 10 Nov 2026, outside the sale — no notices
Paid plan without Black Friday notices Outside the sale window without notices

QA

You need a site connected to a free Optimole account, and an admin user. Add this file to force the 2026 sale window:

<?php
// wp-content/mu-plugins/optml-bf-qa.php
add_filter( 'themeisle_sdk_is_black_friday_sale', '__return_true' );
add_filter( 'themeisle_sdk_current_date', function () {
	return new DateTime( '2026-11-27 12:00:00' );
} );

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 ))
  1. Mark the SDK notice as dismissed in 2025:

    wp user meta update <your-user-id> themeisle_sdk_dismissed_notice_black_friday 1764316800

    Expect: the command prints Success.

  2. Go to WP Admin → Dashboard.

    Expect: the ThemeIsle "Black Friday Sale" notice shows.

  3. 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 contain utm_campaign=bfcm.

  4. 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_dismiss returns an error, because no option is stored.

  5. 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.

  6. 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

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>

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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_notice REST 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_notices tests: all 12 pass on HEAD.
  • With inc/admin.php from 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

Comment thread tests/test-admin.php Resolved
Comment thread tests/test-admin.php Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Soare-Robert-Daniel
Soare-Robert-Daniel marked this pull request as ready for review October 19, 2026 13:22
@pirate-bot

pirate-bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Plugin build for 19f9f39 is ready 🛎️!

@pirate-bot pirate-bot left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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.php changed since the last review. inc/admin.php evidence from run code-review-agent_6ad6002616bc33.77586343 is reused, not rerun.
  • PHPUnit 9.6.22 on PHP 8.3 ran the get_bf_notices tests at HEAD: cd /repo; set -o pipefail; timeout 280 vendor/bin/phpunit --do-not-cache-result --filter 'get_bf_notices' 2>&1 | tee /wo… printed OK (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>
@Soare-Robert-Daniel Soare-Robert-Daniel changed the title fix(bf): show the Black Friday banner again each year fix(bf): use a yearly promo code and show the Black Friday banner again each year Oct 20, 2026
Comment thread inc/admin.php Outdated

$promo_code = 'BFCM2525';
// Code format: BFCM + 2-digit year + discount, e.g. BFCM2625.
$promo_code = 'BFCM' . $year_suffix . '25';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harshitarora-in for the promo code; do you want BFCM2626?

@harshitarora-in

Copy link
Copy Markdown
Contributor

@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 BFCM2525 active in the store. So that the deal remains available for the users this year.

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>
@Soare-Robert-Daniel Soare-Robert-Daniel changed the title fix(bf): use a yearly promo code and show the Black Friday banner again each year fix(bf): show the Black Friday banner again each year Oct 20, 2026
@Soare-Robert-Daniel
Soare-Robert-Daniel marked this pull request as draft October 26, 2026 15:43
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>
@Soare-Robert-Daniel Soare-Robert-Daniel changed the title fix(bf): show the Black Friday banner again each year fix(bf): follow the SDK Black Friday rules and show the banner again each year Oct 26, 2026
@Soare-Robert-Daniel
Soare-Robert-Daniel marked this pull request as ready for review November 2, 2026 13:24
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>
@Soare-Robert-Daniel
Soare-Robert-Daniel changed the base branch from development to master November 2, 2026 14:31
@vytisbulkevicius vytisbulkevicius added the on-hold Not being actively worked by being blocked or not having the capacity to work on it. label Nov 2, 2026
@Soare-Robert-Daniel
Soare-Robert-Daniel changed the base branch from master to development November 3, 2026 07:11
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.
@Soare-Robert-Daniel
Soare-Robert-Daniel changed the base branch from development to master November 6, 2026 13:08
@Soare-Robert-Daniel Soare-Robert-Daniel changed the title fix(bf): follow the SDK Black Friday rules and show the banner again each year fix(bf): share the SDK Black Friday dismissal and show the banner again each year Nov 6, 2026
@Soare-Robert-Daniel
Soare-Robert-Daniel changed the base branch from master to development November 6, 2026 14:27
@Soare-Robert-Daniel
Soare-Robert-Daniel merged commit 42a09a2 into development Nov 6, 2026
14 checks passed
@Soare-Robert-Daniel
Soare-Robert-Daniel deleted the fix/bf-notice-yearly-dismiss branch November 6, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on-hold Not being actively worked by being blocked or not having the capacity to work on it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants