@@ -35,7 +35,8 @@ public function init_hooks() {
3535 add_action ( 'in_admin_header ' , [ $ this , 'hook_notices ' ], 1001 );
3636 // Ajax handlers for notices.
3737 add_action ( 'wp_ajax_edac_black_friday_notice_ajax ' , [ $ this , 'edac_black_friday_notice_ajax ' ] );
38- add_action ( 'wp_ajax_edac_gaad_notice_ajax ' , [ $ this , 'edac_gaad_notice_ajax ' ] );
38+ add_action ( 'wp_ajax_edac_gaad_presale_notice_ajax ' , [ $ this , 'edac_gaad_presale_notice_ajax ' ] );
39+ add_action ( 'wp_ajax_edac_gaad_sale_notice_ajax ' , [ $ this , 'edac_gaad_sale_notice_ajax ' ] );
3940 add_action ( 'wp_ajax_edac_review_notice_ajax ' , [ $ this , 'edac_review_notice_ajax ' ] );
4041 // Save fixes transient on save.
4142 add_action ( 'updated_option ' , [ $ this , 'set_fixes_transient_on_save ' ] );
@@ -54,7 +55,8 @@ public function hook_notices() {
5455 }
5556
5657 add_action ( 'admin_notices ' , [ $ this , 'edac_black_friday_notice ' ] );
57- add_action ( 'admin_notices ' , [ $ this , 'edac_gaad_notice ' ] );
58+ add_action ( 'admin_notices ' , [ $ this , 'edac_gaad_presale_notice ' ] );
59+ add_action ( 'admin_notices ' , [ $ this , 'edac_gaad_sale_notice ' ] );
5860 add_action ( 'admin_notices ' , [ $ this , 'edac_review_notice ' ] );
5961 }
6062
@@ -179,70 +181,126 @@ public function edac_black_friday_notice_ajax() {
179181 }
180182
181183 /**
182- * GAAD Notice
184+ * GAAD Pre-Sale Notice
185+ *
186+ * Displays May 13–19 to build awareness of Global Accessibility Awareness Day
187+ * and tease the upcoming flash sale.
183188 *
184189 * @return void
185190 */
186- public function edac_gaad_notice () {
187-
188- // Define constants for start and end dates.
189- // The banner appears on May 13 (one week early) to build anticipation; the actual sale runs May 20-22.
190- define ( 'EDAC_GAAD_NOTICE_START_DATE ' , '2026-05-13 ' );
191- define ( 'EDAC_GAAD_NOTICE_END_DATE ' , '2026-05-22 ' );
192-
193- // Get the value of the 'edac_gaad_notice_dismiss' option and sanitize it.
194- $ dismissed = absint ( get_option ( 'edac_gaad_notice_dismiss_2026 ' , 0 ) );
191+ public function edac_gaad_presale_notice () {
195192
196193 // Check if the notice has been dismissed.
197- if ( $ dismissed ) {
194+ if ( absint ( get_option ( ' edac_gaad_presale_notice_dismiss_2026 ' , 0 ) ) ) {
198195 return ;
199196 }
200197
201- // Get the current date in the 'Y-m-d' format.
202198 $ current_date = gmdate ( 'Y-m-d ' );
199+ $ start_date = '2026-05-13 ' ;
200+ $ end_date = '2026-05-19 ' ;
203201
204- // Check if the current date is within the specified range.
205- if ( $ current_date >= EDAC_GAAD_NOTICE_START_DATE && $ current_date <= EDAC_GAAD_NOTICE_END_DATE ) {
202+ if ( $ current_date >= $ start_date && $ current_date <= $ end_date ) {
203+ echo wp_kses_post ( $ this ->edac_get_gaad_presale_message () );
204+ }
205+ }
206206
207- // Get the promotional message from a separate function/file.
208- $ message = $ this ->edac_get_gaad_promo_message ();
207+ /**
208+ * Get GAAD Pre-Sale Message
209+ *
210+ * Awareness-focused copy shown May 13–19 before the sale goes live.
211+ *
212+ * @return string
213+ */
214+ public function edac_get_gaad_presale_message () {
209215
210- // Output the message with appropriate sanitization.
211- echo wp_kses_post ( $ message ) ;
216+ $ message = ' <div class="edac_gaad_presale_notice notice notice-info is-dismissible"> ' ;
217+ $ message .= ' <p><strong> ' . esc_html__ ( ' ⚡️ Global Accessibility Awareness Day Flash Sale ' , ' accessibility-checker ' ) . ' </strong><br /> ' ;
212218
219+ if ( defined ( 'EDACP_VERSION ' ) && edac_is_pro () ) {
220+ $ message .= esc_html__ ( 'Starting May 20th: Save 15% on accessibility courses and ArchiveWP with coupon code ' , 'accessibility-checker ' ) . '<code>GAAD2026</code>.<br /> ' ;
221+ $ message .= esc_html__ ( '3 days only • May 20–22 ' , 'accessibility-checker ' ) . '</p><p> ' ;
222+ $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/archivewp/ ' , 'admin-notice ' , 'GAAD2026-archivewp-pre ' , false ) ) . '"> ' . esc_html__ ( 'View ArchiveWP Pricing ' , 'accessibility-checker ' ) . '</a> ' ;
223+ $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/learn/courses/ ' , 'admin-notice ' , 'GAAD2026-courses-pre ' , false ) ) . '"> ' . esc_html__ ( 'View Course Pricing ' , 'accessibility-checker ' ) . '</a></p> ' ;
224+ } else {
225+ $ message .= esc_html__ ( 'Starting May 20th: Save 15% on Accessibility Checker Pro with coupon code ' , 'accessibility-checker ' ) . '<code>GAAD2026</code>.<br /> ' ;
226+ $ message .= esc_html__ ( '3 days only • May 20–22 ' , 'accessibility-checker ' ) . '</p><p> ' ;
227+ $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/accessibility-checker/pricing/ ' , 'admin-notice ' , 'GAAD2026-pricing-pre ' , false ) ) . '"> ' . esc_html__ ( 'View Pricing ' , 'accessibility-checker ' ) . '</a></p> ' ;
213228 }
229+
230+ $ message .= '</div> ' ;
231+
232+ return $ message ;
214233 }
215234
216235 /**
217- * Get GAAD Promo Message
236+ * GAAD Pre-Sale Notice Ajax
218237 *
219- * @return string
238+ * @return void
239+ *
240+ * - '-1' means that nonce could not be verified
241+ * - '-2' means that update option wasn't successful
220242 */
221- public function edac_get_gaad_promo_message () {
243+ public function edac_gaad_presale_notice_ajax () {
222244
223- // Construct the promotional message.
224- $ message = '<div class="edac_gaad_notice notice notice-info is-dismissible"> ' ;
245+ if ( ! isset ( $ _REQUEST ['nonce ' ] ) || ! wp_verify_nonce ( sanitize_key ( $ _REQUEST ['nonce ' ] ), 'ajax-nonce ' ) ) {
246+ $ error = new \WP_Error ( '-1 ' , __ ( 'Permission Denied ' , 'accessibility-checker ' ) );
247+ wp_send_json_error ( $ error );
248+ }
249+
250+ $ results = update_option ( 'edac_gaad_presale_notice_dismiss_2026 ' , true );
251+
252+ if ( ! $ results ) {
253+ $ error = new \WP_Error ( '-2 ' , __ ( 'Update option wasn \'t successful ' , 'accessibility-checker ' ) );
254+ wp_send_json_error ( $ error );
255+ }
225256
257+ wp_send_json_success ( wp_json_encode ( $ results ) );
258+ }
259+
260+ /**
261+ * GAAD Sale Notice
262+ *
263+ * Displays May 20–22 during the active flash sale.
264+ *
265+ * @return void
266+ */
267+ public function edac_gaad_sale_notice () {
268+
269+ // Check if the notice has been dismissed.
270+ if ( absint ( get_option ( 'edac_gaad_sale_notice_dismiss_2026 ' , 0 ) ) ) {
271+ return ;
272+ }
273+
274+ $ current_date = gmdate ( 'Y-m-d ' );
275+ $ start_date = '2026-05-20 ' ;
276+ $ end_date = '2026-05-22 ' ;
277+
278+ if ( $ current_date >= $ start_date && $ current_date <= $ end_date ) {
279+ echo wp_kses_post ( $ this ->edac_get_gaad_sale_message () );
280+ }
281+ }
282+
283+ /**
284+ * Get GAAD Sale Message
285+ *
286+ * Urgency-focused copy shown May 20–22 while the sale is live.
287+ *
288+ * @return string
289+ */
290+ public function edac_get_gaad_sale_message () {
291+
292+ $ message = '<div class="edac_gaad_sale_notice notice notice-info is-dismissible"> ' ;
226293 $ message .= '<p><strong> ' . esc_html__ ( '⚡️ Global Accessibility Awareness Day Flash Sale ' , 'accessibility-checker ' ) . '</strong><br /> ' ;
227294
228295 if ( defined ( 'EDACP_VERSION ' ) && edac_is_pro () ) {
229- // Message for users who already have Accessibility Checker Pro active (valid license).
230- $ message .= sprintf (
231- /* translators: 1: opening anchor tag for accessibility courses link, 2: closing anchor tag, 3: opening anchor tag for ArchiveWP link, 4: closing anchor tag */
232- esc_html__ ( '3 days only: Save 15%% on %1$saccessibility courses%2$s and Equalize Digital \'s %3$sArchiveWP plugin%4$s. Go further with accessibility. ' , 'accessibility-checker ' ),
233- '<a href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/learn/courses/ ' , 'admin-notice ' , 'GAAD2026-courses ' , false ) ) . '"> ' ,
234- '</a> ' ,
235- '<a href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/archivewp/ ' , 'admin-notice ' , 'GAAD2026-archivewp ' , false ) ) . '"> ' ,
236- '</a> '
237- ) . '<br /> ' ;
238- $ message .= esc_html__ ( 'Limited-time offer • May 20–22 • Use coupon code ' , 'accessibility-checker ' ) . '<code>GAAD2026</code><br /> ' ;
239- $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/ ' , 'admin-notice ' , 'GAAD2026-grab-deal ' , false ) ) . '"> ' . esc_html__ ( 'Grab the Deal Before It Ends ' , 'accessibility-checker ' ) . '</a></p> ' ;
296+ $ message .= esc_html__ ( 'Save 15% on accessibility courses and ArchiveWP with coupon code ' , 'accessibility-checker ' ) . '<code>GAAD2026</code>.<br /> ' ;
297+ $ message .= esc_html__ ( 'Limited-time offer • Ends May 22nd ' , 'accessibility-checker ' ) . '</p><p> ' ;
298+ $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/archivewp/?discount=GAAD2026&pro=true ' , 'admin-notice ' , 'GAAD2026-archivewp ' , false ) ) . '"> ' . esc_html__ ( 'View ArchiveWP Pricing ' , 'accessibility-checker ' ) . '</a> ' ;
299+ $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/learn/courses/?discount=GAAD2026&pro=true ' , 'admin-notice ' , 'GAAD2026-courses ' , false ) ) . '"> ' . esc_html__ ( 'View Course Pricing ' , 'accessibility-checker ' ) . '</a></p> ' ;
240300 } else {
241- // Message for users who do not have Accessibility Checker Pro active.
242- $ message .= esc_html__ ( '3 days only: Save 15% when you upgrade to Accessibility Checker Pro with coupon code ' , 'accessibility-checker ' );
243- $ message .= '<code>GAAD2026</code>.</br> ' ;
244- $ message .= esc_html__ ( 'Limited-time offer • May 20–22 ' , 'accessibility-checker ' ) . '<br /> ' ;
245- $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/accessibility-checker/pricing/ ' , 'admin-notice ' , 'GAAD2026-pricing ' , false ) ) . '"> ' . esc_html__ ( 'Upgrade Now ' , 'accessibility-checker ' ) . '</a></p> ' ;
301+ $ message .= esc_html__ ( '3 days only: Save 15% when you upgrade to Accessibility Checker Pro with coupon code ' , 'accessibility-checker ' ) . '<code>GAAD2026</code>.<br /> ' ;
302+ $ message .= esc_html__ ( 'Limited-time offer • Ends May 22nd ' , 'accessibility-checker ' ) . '</p><p> ' ;
303+ $ message .= '<a class="button button-primary" href=" ' . esc_url ( edac_link_wrapper ( 'https://equalizedigital.com/accessibility-checker/pricing/?discount=GAAD2026 ' , 'admin-notice ' , 'GAAD2026-pricing ' , false ) ) . '"> ' . esc_html__ ( 'Upgrade Now ' , 'accessibility-checker ' ) . '</a></p> ' ;
246304 }
247305
248306 $ message .= '</div> ' ;
@@ -251,31 +309,28 @@ public function edac_get_gaad_promo_message() {
251309 }
252310
253311 /**
254- * GAAD Admin Notice Ajax
312+ * GAAD Sale Notice Ajax
255313 *
256314 * @return void
257315 *
258- * - '-1' means that nonce could not be varified
316+ * - '-1' means that nonce could not be verified
259317 * - '-2' means that update option wasn't successful
260318 */
261- public function edac_gaad_notice_ajax () {
319+ public function edac_gaad_sale_notice_ajax () {
262320
263- // nonce security.
264321 if ( ! isset ( $ _REQUEST ['nonce ' ] ) || ! wp_verify_nonce ( sanitize_key ( $ _REQUEST ['nonce ' ] ), 'ajax-nonce ' ) ) {
265-
266322 $ error = new \WP_Error ( '-1 ' , __ ( 'Permission Denied ' , 'accessibility-checker ' ) );
267323 wp_send_json_error ( $ error );
268-
269324 }
270325
271- $ results = update_option ( 'edac_gaad_notice_dismiss_2026 ' , true );
272- // Delete old meta keys if they exist.
326+ $ results = update_option ( 'edac_gaad_sale_notice_dismiss_2026 ' , true );
327+ // Delete old option keys if they exist.
328+ delete_option ( 'edac_gaad_notice_dismiss_2026 ' );
273329 delete_option ( 'edac_gaad_notice_dismiss_2025 ' );
274330 delete_option ( 'edac_gaad_notice_dismiss_2024 ' );
275331 delete_option ( 'edac_gaad_notice_dismiss ' );
276332
277333 if ( ! $ results ) {
278-
279334 $ error = new \WP_Error ( '-2 ' , __ ( 'Update option wasn \'t successful ' , 'accessibility-checker ' ) );
280335 wp_send_json_error ( $ error );
281336
0 commit comments