Problem
Links from the free plugins and the paid plugins' settings pages produced 11 purchases in the 2025 Black Friday sale, with no sale message at all. For Black Friday 2026 we want a dismissible sale notice on this plugin's own settings page, pointing users to Document Library Pro with the discount already applied.
What it does
- Shows at the top of Documents → Settings only, to users with
manage_options. No other admin screen.
- Main sale: 20 Nov 2026 00:00 UTC to 1 Dec 2026 08:00 UTC, code BF2026, 30%.
- Last chance: 1 Dec 2026 08:00 UTC to 5 Dec 2026 00:00 UTC, code EXTRADAYS, 25%. It switches when BF2026 expires, so it never shows an expired code.
- Outside those windows nothing is output. The notice removes itself after the sale; no follow-up release is needed.
- Dismissible per user and per phase (user meta
barn2_sale_notice_dismissed_<phase>), shared by all Barn2 plugins.
- The button links to
https://barn2.com/wordpress-plugins/document-library-pro/?discount=CODE&utm_source=plugin&utm_medium=banner&utm_campaign=bf2026&utm_content=document-library-lite. barn2.com applies ?discount= to the cart.
- Makes no remote requests. The dates, codes and wording ship in the plugin (WordPress.org guideline 7).
- The design is a placeholder. Daniel's final design follows by Wed 7 Oct and will be added to the same PR.
The notice class is Barn2\Lib\Admin\Sale_Notice, added to barn2-lib in barn2plugins/barn2-lib#29, so the paid plugins can reuse it.
Changelog
No changelog line: this is a time-limited promotional notice, not a feature.
QA checklist
Problem
Links from the free plugins and the paid plugins' settings pages produced 11 purchases in the 2025 Black Friday sale, with no sale message at all. For Black Friday 2026 we want a dismissible sale notice on this plugin's own settings page, pointing users to Document Library Pro with the discount already applied.
What it does
manage_options. No other admin screen.barn2_sale_notice_dismissed_<phase>), shared by all Barn2 plugins.https://barn2.com/wordpress-plugins/document-library-pro/?discount=CODE&utm_source=plugin&utm_medium=banner&utm_campaign=bf2026&utm_content=document-library-lite. barn2.com applies?discount=to the cart.The notice class is
Barn2\Lib\Admin\Sale_Notice, added to barn2-lib in barn2plugins/barn2-lib#29, so the paid plugins can reuse it.Changelog
No changelog line: this is a time-limited promotional notice, not a feature.
QA checklist
&barn2_sale_preview=bf2026to the URL (/wp-admin/admin.php?page=document_library&barn2_sale_preview=bf2026). The main sale notice shows: "Upgrade to Document Library Pro for 30% off", ending "Offer ends December 1."extradays. The last chance notice shows: "Missed Black Friday? Upgrade to Document Library Pro for 25% off", ending "Offer ends December 4."discount=BF2026(orEXTRADAYS) and the utm tags. Add the plugin to the cart on barn2.com: the discount is applied.manage_optionsnever sees it.barn2_sale_notice_dismissed_<phase>is saved for that user. (Preview mode ignores the dismissal so it can be checked repeatedly.)add_filter( 'barn2_sale_notice_campaigns', fn( $c ) => array_map( fn( $x ) => array_merge( $x, [ 'start' => '2020-01-01 00:00:00' ] ), $c ) );to a snippet. The main sale shows without the preview parameter, and a dismissed user no longer sees it.