Skip to content

Show the Black Friday and Cyber Monday offer notice from November 13 to December 3 - #2303

Merged
subodhr258 merged 9 commits into
developfrom
feat/bfcm-offer-notice
Nov 11, 2026
Merged

subodhr258 merged 9 commits into
developfrom
feat/bfcm-offer-notice

Conversation

@subodhr258

@subodhr258 subodhr258 commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Review packet

Base develop for now, for 2.8.1. 2.8.0 is being released, and 2.8.1 is a patch after it. The campaign starts on November 13, so this must be in a release published by Thursday, November 12.

In one line: Shows the Black Friday and Cyber Monday 2026 offer notice (50% off the first month or year with code BFCM2026) in WP admin to free and trial sites from November 13 to December 3 (three days past Cyber Monday, November 30; dates finalized). It replaces the ended Halloween offer: the Halloween campaign, copy, drawings and styles are removed, so the notice holds one campaign at a time and the next offer swaps in the same way. Spec: Copy kit K5 in Joel's BFCM 2026 campaign doc; request in the BFCM Campaign thread. Builds on #2263 (Halloween notice).

1. Criteria and proof

Acceptance criterion (from the spec) Proof
Shows from 00:00:00 on November 13, 2026 to 23:59:59 on December 3, 2026, in the site's time zone; hidden at 23:59:59 on November 12 and at 00:00:00 on December 4, for India and New York sites test_black_friday_shows_from_the_first_second_of_november_13_to_the_last_of_december_3
Halloween is gone: its entry is removed and it never shows again (October 1 to November 9 return nothing); nothing shows November 10 to 12; nothing in 2027 (October 29, November 13, November 26, December 1) test_the_ended_halloween_offer_never_shows_again, test_nothing_shows_before_black_friday_or_on_a_later_year, test_it_never_shows_on_a_later_year
Code BFCM2026; a new dismiss option rtgodam_offer_bfcm_2026_dismissed, so an old Halloween dismissal stored on a site does not hide it test_an_old_halloween_dismissal_does_not_hide_black_friday_and_its_own_dismissal_does, test_dismissing_during_black_friday_saves_only_its_own_option
Copy: "Black Friday and Cyber Monday offer", "Black Friday and Cyber Monday deal: Get 50% off GoDAM", the integration line unchanged, "Ends December 3 at 11:59 p.m. 50% off your first month or year on any plan.", "Claim 50% off" test_black_friday_render_has_its_code_copy_and_pricing_link_and_no_halloween_content, the screenshot above
Claim opens godam.io/pricing/?utm_source=godam-plugin&utm_medium=admin-notice&utm_campaign=bfcm2026&utm_content=<placement>-<message> same render test
No spider web or pumpkin; GoDAM purple kept render test, the screenshot above
Same rules as the Halloween notice had: admins of free and trial sites only, Dashboard and Media Library, free-plan notice steps aside, copy box, site-wide dismiss existing tests

2. The notice

Current notice (commit cec79bc, 10 Nov): the WordPress Dashboard on godam-dev.local, rendered as a free site sees it on November 20. The footer in this shot still says November 30; since commit 7db8be5 it reads "Ends December 3 at 11:59 p.m."

Black Friday and Cyber Monday offer notice

3. Tests

  • Added (in tests/php/OfferNoticeTest.php):
    • Black Friday shows on its first and last second and not one second outside, in Asia/Kolkata and America/New_York.
    • Nothing shows November 10 to 12 or in November 2027.
    • An old Halloween dismissal does not hide Black Friday; its own dismissal does.
    • A paid site never sees Black Friday.
    • Black Friday render: pricing link with the new tracking, BFCM2026, the new copy, no Halloween drawings.
    • Dismissing during Black Friday saves only rtgodam_offer_bfcm_2026_dismissed.
  • Changed: tests that used Halloween dates (October 29) now use a Black Friday date (November 20); the time zone test checks the December 3 end in India and New York; the render test checks utm_campaign=bfcm2026 and BFCM2026.
    • Dismissing between campaigns saves nothing, and the AJAX call with no time still answers.
  • Revert check: with class-offer-notice.php put back to main, 5 of the first 6 new tests fail (Call to undefined method Offer_Notice::get_campaign() and 4 failures). The paid-site test passes both ways, as a control.
  • OfferNoticeTest: 23 tests, 86 assertions, all pass. The full suite has 30 errors that are the same on clean main (Media file paths, MAP tracker, Marketo client, Preflight and others), none in this file.

4. Risk flags

1 spot in 1 file in this PR, raised by a script, not by judgement. Read these lines; the rest of the diff touched none of the watched areas.

Database, options and stored data (1)

  • inc/classes/class-offer-notice.php:337 (removed)
 		if ( ! current_user_can( 'manage_options' ) ) {
 			wp_send_json_error( array( 'message' => __( 'You are not allowed to dismiss this offer.', 'godam' ) ), 403 );
 		}
 
-		update_option( self::DISMISS_OPTION, time(), false );
+		$campaign = self::get_campaign( $now instanceof \DateTimeInterface ? $now : null );
+		if ( $campaign ) {
+			update_option( self::CAMPAIGNS[ $campaign ]['dismiss_option'], time(), false );
+		}

The dismiss write now goes to the running campaign's own option (rtgodam_offer_bfcm_2026_dismissed), and writes nothing outside a campaign. Halloween dismissals already stored on sites (rtgodam_offer_halloween_2026_dismissed) are no longer read and do not hide Black Friday.

5. Independent review

A fresh reviewer saw the spec and the diff only. No spec point missed; three low findings, all fixed in 3f13f16.

Finding Grade What I did
class-offer-notice.php render() read the clock twice (should_show(), then get_campaign()); a campaign ending between the two reads left no campaign, with PHP warnings and an empty code Valid Fixed: render() reads the time once and passes it to both
Halloween got a new start of Oct 28, stricter than before (it showed any time before Nov 9) Valid Fixed: start moved to Oct 1, before 2.5.2 shipped, so it behaves as before
No test for a dismiss between campaigns, or for dismiss('') (what do_action() passes) Valid Added test_dismissing_between_campaigns_saves_nothing_and_the_ajax_call_without_a_time_still_works

The reviewer also confirmed the Halloween render is identical to main apart from whitespace, and swept the boundary seconds in Pacific/Kiritimati and Pacific/Pago_Pago.

6. Not verified

  • That BFCM2026 works at checkout (the campaign doc says it was created in GoDAM Central on November 3).
  • The real calendar switch on November 13 on a live site: tested by unit tests with fixed times and on the local site with shifted dates, not by waiting for the date.
  • POT file not regenerated in this PR (5 new strings); it is refreshed at release.

7. Scope

Offer_Notice now holds a list of campaigns (CAMPAIGNS) with get_campaign() picking the running one, instead of one set of Halloween constants; today it holds only bfcm-2026. DISMISS_OPTION, END_TIME and CODE are gone; nothing outside the class and its test used them. dismiss() takes an optional time for tests; the AJAX hook still calls it with no time.

🤖 Generated with Claude Code

subodhr258 and others added 2 commits November 3, 2026 16:03
The offer notice now runs a list of dated campaigns. Halloween keeps
showing through November 9; nothing shows from November 10 to 14; the
Black Friday 2026 offer (code BFCM2026) shows from 00:00:00 on
November 15 to 23:59:59 on November 27 in the site's time zone, then
ends by itself.

Black Friday has its own dismiss option, copy, godam.io/deals/ link with
bfcm2026 tracking, and no Halloween art.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
render() read the clock twice, so a campaign ending between the two
reads could leave no campaign to render. Halloween's start moves to
October 1, so it still shows from install as before. Adds a test for a
dismiss between campaigns and for the AJAX call with no time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@subodhr258 subodhr258 added the risk: medium Agent QA plus a human spot check label Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
13 0 13

⚠️ Warnings (13)

📁 readme.txt (1 warning)
📍 Line 🔖 Check 💬 Message
0 mismatched_plugin_name Plugin name "GoDAM - Video Hosting for LMS & Online Courses" is different from the name declared in plugin header "GoDAM".
📁 assets/build/pages/video-editor.min.js (1 warning)
📍 Line 🔖 Check 💬 Message
2 react_removed_api This file calls "ReactDOM.findDOMNode", which was removed in React 19 and stops working once WordPress upgrades React. Use a ref on the element instead.
📁 assets/build/css/main.css (1 warning)
📍 Line 🔖 Check 💬 Message
0 EnqueuedStylesScope This style is being loaded in all contexts.
📁 assets/src/libs/analytics.min.js (5 warnings)
📍 Line 🔖 Check 💬 Message
0 EnqueuedScriptsScope This script is being loaded in all frontend contexts.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880 (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/2026/11/11/hello-world/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/sample-page/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/demo-attachment-post/ (with handle analytics-library) is loaded in the footer. Consider a defer or async script loading strategy instead.
📁 assets/build/js/main.min.js (5 warnings)
📍 Line 🔖 Check 💬 Message
0 EnqueuedScriptsScope This script is being loaded in all frontend contexts.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880 (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/2026/11/11/hello-world/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/sample-page/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.
0 NonBlockingScripts.NoStrategy This script on http://localhost:8880/demo-attachment-post/ (with handle rtgodam-script) is loaded in the footer. Consider a defer or async script loading strategy instead.

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Cyber Monday is November 30, so the campaign window is now
November 14 00:00:00 to November 30 23:59:59 in the site's time zone.
The footer says "Ends November 30 at 11:59 p.m.".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@subodhr258 subodhr258 changed the title Show the Black Friday offer notice from November 15 to 27 Show the Black Friday offer notice from November 14 to 30 Nov 9, 2026
The eyebrow now reads "Black Friday and Cyber Monday offer" and the title
"Black Friday and Cyber Monday deal: Get 50% off GoDAM". Dates, code and
tests are unchanged apart from the expected strings.
@subodhr258 subodhr258 changed the title Show the Black Friday offer notice from November 14 to 30 Show the Black Friday and Cyber Monday offer notice from November 14 to 30 Nov 9, 2026
The campaign now runs November 13 00:00:00 to November 30 23:59:59
in the site's time zone. The footer ("Ends November 30") is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@subodhr258 subodhr258 changed the title Show the Black Friday and Cyber Monday offer notice from November 14 to 30 Show the Black Friday and Cyber Monday offer notice from November 13 to 30 Nov 11, 2026
The sale window is now November 13 to December 3, so the notice keeps
showing for three days after Cyber Monday (November 30).
@subodhr258 subodhr258 changed the title Show the Black Friday and Cyber Monday offer notice from November 13 to 30 Show the Black Friday and Cyber Monday offer notice from November 13 to December 3 Nov 11, 2026
godam.io/deals/ does not exist (404), so the button now opens the
pricing page, like the Halloween notice and the godam.io top bar.
@rudrakshi-gupta

Copy link
Copy Markdown
Member

Code review

Verdict: LGTM, no blocking issues. Moving to a CAMPAIGNS list with get_campaign() is a clean way to add BFCM without touching Halloween's behaviour, and reading the clock once in render() closes the end-of-campaign race. I checked head 39a4ef2 locally.

What I ran

Check Result
OfferNoticeTest 23/23 pass
Full PHPUnit on the branch 1058 tests pass
Trial merge with current develop (branch is 38 behind) and with main Both clean, no conflicts; full suite 1396 tests pass on each
PHPCS (class-offer-notice.php, test) / stylelint (admin.scss) Clean
My own throwaway date tests (deleted afterwards) Nov 12 23:59:59 = none, Nov 13 00:00:00 = bfcm-2026, Dec 3 23:59:59 = bfcm-2026, Dec 4 00:00:00 = none, in manual offsets (+05:30, -03:30, +14:00) and Pacific/Kiritimati, Pacific/Pago_Pago, Australia/Lord_Howe and UTC. A $now built in another zone is compared as an instant (2026-11-12 18:30 UTC already counts as BFCM for a Kolkata site, 18:29:59 doesn't).

What I verified in the code

  • Dismissals stay separate: BFCM writes only rtgodam_offer_bfcm_2026_dismissed; a Halloween dismissal (same option name as before) doesn't hide BFCM; a dismiss between campaigns writes nothing but still answers success.
  • Removed constants: DISMISS_OPTION, END_TIME and CODE aren't used anywhere else in the plugin. The only org-wide hits are vendored copies of the plugin in site repos, which get replaced on update.
  • The front end needs no change: admin.js only targets the shared __dismiss / __copy classes, which both campaigns render. The --no-art modifier just restores the left padding.
  • Tracking: BFCM's utm_source=godam-plugin no longer sends the site's hostname to godam.io (Halloween still does, unchanged). That's a nice side improvement.

Before the 2.8.1 release (not code changes)

  1. Regenerate the POT on the develop→main sync. There are 5 new strings, and the Translation Template check runs on PRs to main; that's what failed on Keep caption files uploaded before 2.8.0 #2351 until it was regenerated. Doing it in the sync PR (or here) avoids a red check on release day.
  2. The code's validity window on Central. Because the notice follows the site's time zone, the earliest site (UTC+14) shows it from Nov 12 10:00 UTC, and the latest (UTC-12) until about Dec 4 11:59 UTC. Worth confirming BFCM2026 on Central is active for that whole span, so nobody copies a code from the notice that checkout rejects.

Nit (non-blocking)

  • The copy switches on $is_halloween, so a third entry in CAMPAIGNS would silently render the BFCM copy. That's fine for this year; next time, a small get_copy( $campaign_key ) returning the translated strings per campaign would keep everything campaign-specific in one place.

Review drafted with Claude.

Halloween 2026 ended on November 9, so its campaign entry, copy, spider
and pumpkin drawings and their styles are removed. Black Friday is now
the only campaign; the next offer replaces it the same way. Tests move
to Black Friday dates and check that Halloween never shows again.

@KMchaudhary KMchaudhary 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.

Reviewed the diff and the class at the head of this branch. The campaign logic, boundary seconds and separate dismiss options look right, and the tests cover them well. Seven comments inline. The time zone question and the @since n.e.x.t tag are worth settling before the November 12 release; the rest can wait for the next campaign.

),
'bfcm-2026' => array(
'start' => '2026-11-13 00:00:00',
'end' => '2026-12-03 23:59:59',

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.

Time zone of the campaign window. start and end are read in each site's own time zone, so BFCM2026 shows over a different absolute window on each site. A site set to Pacific/Pago_Pago (UTC-11) keeps showing the notice, and "Ends December 3 at 11:59 p.m.", until December 4 10:59 UTC. A UTC+14 site starts on November 12 at 10:00 UTC.

If the code on Central expires at one fixed moment, some admins will copy a code that no longer works. Could we confirm how Central expires BFCM2026, and if it is a fixed zone, pin start/end to that zone (for example a timezone key per campaign) instead of wp_timezone()?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Central expiry needs a buffer.

Comment thread inc/classes/class-offer-notice.php Resolved
Comment thread inc/classes/class-offer-notice.php Resolved
* @return void
*/
public static function dismiss() {
public static function dismiss( $now = null ) {

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.

Dismiss uses the clock, not the notice shown. dismiss() picks the campaign from the server time when the click arrives. If an admin loads the Dashboard at December 3, 23:59:50 and clicks the close button at December 4, 00:00:05, the call returns success but writes no option. With back-to-back campaigns, a stale notice dismissed after the switch would hide the new campaign, which the admin never saw.

Rendering data-campaign="<key>" on the notice, sending it with the AJAX call and checking it against CAMPAIGNS would tie the dismissal to what the admin actually closed. Not urgent for 2026, since there is a gap between the two campaigns.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Valid. A close click that lands after the end returns success and writes nothing, and with back-to-back campaigns a stale notice could hide the next one. Sending the campaign key with the AJAX call ties the dismissal to the notice shown. Black Friday is the only campaign and there is a gap before the next, so it is a follow-up for after 2.8.1; no code change in this PR.

Comment thread inc/classes/class-offer-notice.php Outdated

/**
* Offer code.
* @since n.e.x.t

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.

@since n.e.x.t. This is the only n.e.x.t in the repo, and I couldn't find a release step that replaces it, so it would ship as-is. Since this is aimed at 2.8.1, could both tags (here and on get_campaign()) be @since 2.8.1?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in de5d688. Both tags, on CAMPAIGNS and get_campaign(), are now @since 2.8.1.

Comment thread inc/classes/class-offer-notice.php Resolved
if ( $now > $end_time ) {
return false;
foreach ( self::CAMPAIGNS as $key => $campaign ) {
if ( $now >= new \DateTime( $campaign['start'], $timezone ) && $now <= new \DateTime( $campaign['end'], $timezone ) ) {

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.

Repeated work. get_campaign() builds two DateTime objects per campaign on every call. One Dashboard load runs it three times: free_plan_admin_notice() calls should_show(), then render() calls should_show() and get_campaign(). Each should_show() also reads rtgodam_get_user_data(). It is small now, but grows with each campaign. render() could call get_campaign() once and pass the result on, or the result could be cached in a static for the request. Optional.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Valid, small. With one campaign, a Dashboard load builds two DateTime pairs three times. render() can call get_campaign() once and pass it on; follow-up with the next offer, no code change in this PR.

@subodhr258
subodhr258 merged commit 9e93f50 into develop Nov 11, 2026
6 checks passed
@subodhr258
subodhr258 deleted the feat/bfcm-offer-notice branch November 11, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium Agent QA plus a human spot check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants