@@ -84,22 +84,23 @@ public function render_page() {
8484 $ is_pro = $ license_context ['is_pro ' ];
8585 $ license_key = (string ) get_option ( 'edacp_license_key ' , '' );
8686 $ is_connected = $ license_context ['is_connected ' ];
87- $ next_collection = $ this ->get_next_collection_date ();
87+ $ next_send_date = $ this ->get_next_send_estimate_date ();
8888 $ scans_stats = new Scans_Stats ();
8989 $ summary = $ scans_stats ->summary ();
9090 $ preview_data = is_array ( $ summary ) ? $ this ->get_preview_data ( $ summary , $ is_pro ) : [];
9191
92- $ upgrade_url = edac_generate_link_type (
92+ $ upgrade_url = edac_generate_link_type (
9393 [
9494 'utm_campaign ' => 'settings-page ' ,
9595 'utm_content ' => 'accessibility-reports-upgrade ' ,
9696 ]
9797 );
98- $ dashboard_url = edac_link_wrapper ( 'https://my.equalizedigital.com/ ' , 'accessibility-reports ' , 'account ' , false );
99- $ email_reports_url = edac_link_wrapper ( 'https://my.equalizedigital.com/email-reports ' , 'accessibility-reports ' , 'email-reports ' , false );
100- $ signup_url = edac_link_wrapper ( 'https://my.equalizedigital.com/sign-up/ ' , 'accessibility-reports ' , 'signup ' , false );
101- $ terms_url = edac_link_wrapper ( 'https://equalizedigital.com/terms-of-service/ ' , 'accessibility-reports ' , 'terms ' , false );
102- $ privacy_url = edac_link_wrapper ( 'https://equalizedigital.com/privacy-policy/ ' , 'accessibility-reports ' , 'privacy ' , false );
98+
99+ $ dashboard_url = edac_link_wrapper ( 'https://my.equalizedigital.com/ ' , 'accessibility-reports ' , 'account ' , false );
100+ $ signup_url = edac_link_wrapper ( 'https://my.equalizedigital.com/sign-up/ ' , 'accessibility-reports ' , 'signup ' , false );
101+ $ privacy_url = edac_link_wrapper ( 'https://equalizedigital.com/privacy-policy/ ' , 'accessibility-reports ' , 'privacy ' , false );
102+ $ data_processing_url = edac_link_wrapper ( 'https://equalizedigital.com/data-terms/ ' , 'accessibility-reports ' , 'dpa ' , false );
103+
103104 $ allowed_icon_html = [
104105 'span ' => [
105106 'class ' => true ,
@@ -159,7 +160,7 @@ public function render_page() {
159160 </div>
160161 <?php else : ?>
161162 <div class="edac-reports-grid edac-reports-grid--two">
162- <article class="edac-reports-card">
163+ <div class="edac-reports-card">
163164 <h3><?php esc_html_e ( 'Free License Key ' , 'accessibility-checker ' ); ?> </h3>
164165 <form method="post" action="<?php echo esc_url ( admin_url ( 'admin-post.php ' ) ); ?> ">
165166 <input type="hidden" name="action" value="edac_license" />
@@ -170,9 +171,9 @@ public function render_page() {
170171 <?php esc_html_e ( 'Enable Email Reports ' , 'accessibility-checker ' ); ?>
171172 </button>
172173 </form>
173- </article >
174+ </div >
174175
175- <article class="edac-reports-card">
176+ <div class="edac-reports-card">
176177 <h3><?php esc_html_e ( 'Get a Free License Key ' , 'accessibility-checker ' ); ?> </h3>
177178 <p>
178179 <?php
@@ -201,29 +202,26 @@ public function render_page() {
201202 );
202203 ?>
203204 </p>
204- </article >
205+ </div >
205206 </div>
206207 <?php endif ; ?>
207208 <?php else : ?>
208209 <div class="edac-reports-grid edac-reports-grid--two">
209- <article class="edac-reports-card">
210+ <div class="edac-reports-card">
210211 <div class="edac-reports-card__header">
211212 <h3><?php esc_html_e ( 'Reports Enabled ' , 'accessibility-checker ' ); ?> </h3>
212213 <span class="edac-reports-card__status edac-reports-card__status--success" aria-hidden="true"><?php echo wp_kses ( $ this ->get_status_icon ( 'check ' ), $ allowed_icon_html ); ?> </span>
213214 </div>
214215 <p><?php esc_html_e ( 'You’ll receive weekly accessibility reports for this site. ' , 'accessibility-checker ' ); ?> </p>
215216 <p class="edac-reports-card__meta">
216- <?php if ( $ next_collection ) : ?>
217+ <?php if ( $ next_send_date ) : ?>
217218 <?php /* translators: %s: next report date. */ ?>
218- <span><?php printf ( esc_html__ ( 'Next report: %s ' , 'accessibility-checker ' ), esc_html ( wp_date ( get_option ( 'date_format ' ), strtotime ( $ next_collection ) ) ) ); ?> </span>
219+ <span><?php printf ( esc_html__ ( 'Next report: %s ' , 'accessibility-checker ' ), esc_html ( mysql2date ( get_option ( 'date_format ' ), $ next_send_date ) ) ); ?> </span>
219220 <?php endif ; ?>
220221 </p>
221- <p>
222- <a class="button button-primary edac-reports-page__button" href="<?php echo esc_url ( $ email_reports_url ); ?> " target="_blank" rel="noopener noreferrer"><?php esc_html_e ( 'Manage Recipients in Dashboard ' , 'accessibility-checker ' ); ?> </a>
223- </p>
224- </article>
222+ </div>
225223
226- <article class="edac-reports-card">
224+ <div class="edac-reports-card">
227225 <div class="edac-reports-card__header">
228226 <h3><?php echo esc_html ( $ is_pro ? __ ( 'Full Coverage ' , 'accessibility-checker ' ) : __ ( 'Limited Coverage ' , 'accessibility-checker ' ) ); ?> </h3>
229227 <span class="edac-reports-card__status <?php echo esc_attr ( $ is_pro ? 'edac-reports-card__status--success ' : 'edac-reports-card__status--warning ' ); ?> " aria-hidden="true"><?php echo wp_kses ( $ this ->get_status_icon ( $ is_pro ? 'check ' : 'warning ' ), $ allowed_icon_html ); ?> </span>
@@ -247,18 +245,18 @@ public function render_page() {
247245 <a class="button button-primary edac-reports-page__button" href="<?php echo esc_url ( $ upgrade_url ); ?> " target="_blank" rel="noopener noreferrer"><?php esc_html_e ( 'Upgrade to Pro ' , 'accessibility-checker ' ); ?> </a>
248246 </p>
249247 <?php endif ; ?>
250- </article >
248+ </div >
251249
252- <article class="edac-reports-card">
250+ <div class="edac-reports-card">
253251 <h3><?php esc_html_e ( 'Accessibility Summary ' , 'accessibility-checker ' ); ?> </h3>
254252 <p><?php esc_html_e ( 'This summary reflects the latest scan data available for your site. ' , 'accessibility-checker ' ); ?> </p>
255253 <div class="edac-reports-stat">
256254 <div class="edac-reports-stat__label"><?php esc_html_e ( 'Total Issues Found ' , 'accessibility-checker ' ); ?> </div>
257255 <div class="edac-reports-stat__value"><?php echo esc_html ( number_format_i18n ( $ preview_data ['total_issues ' ] ) ); ?> </div>
258256 </div>
259- </article >
257+ </div >
260258
261- <article class="edac-reports-card">
259+ <div class="edac-reports-card">
262260 <h3><?php echo esc_html ( $ is_pro ? __ ( 'Account Connection ' , 'accessibility-checker ' ) : __ ( 'Free License Key ' , 'accessibility-checker ' ) ); ?> </h3>
263261 <?php if ( ! $ is_pro ) : ?>
264262 <div class="edac-reports-page__license-mask"><?php echo esc_html ( $ this ->mask_license_key ( $ license_key ) ); ?> </div>
@@ -270,17 +268,19 @@ public function render_page() {
270268 <?php esc_html_e ( 'Disable Email Reports ' , 'accessibility-checker ' ); ?>
271269 </button>
272270 </form>
273- </article >
271+ </div >
274272 </div>
275273 <?php endif ; ?>
276274
277275 <p class="edac-reports-page__legal">
278276 <?php
279277 printf (
280- /* translators: %1$s: terms link, %2$s: privacy link. */
281- wp_kses_post ( __ ( 'By connecting this site, you agree to the Equalize Digital <a href="%1$s" target="_blank" rel="noopener noreferrer">Terms of Service</a> and <a href="%2$s" target="_blank" rel="noopener noreferrer">Privacy Policy</a>. ' , 'accessibility-checker ' ) ),
282- esc_url ( $ terms_url ),
283- esc_url ( $ privacy_url )
278+ /* translators: %1$s: privacy link, %2$s: data processing agreement link, %3$s: privacy policy aria label, %4$s: data processing agreement aria label. */
279+ wp_kses_post ( __ ( 'By connecting this site, you agree to Equalize Digital \'s <a href="%1$s" target="_blank" rel="noopener noreferrer" aria-label="%3$s">Privacy Policy <span aria-hidden="true">↗</span></a> and <a href="%2$s" target="_blank" rel="noopener noreferrer" aria-label="%4$s">Data Processing Agreement <span aria-hidden="true">↗</span></a>. ' , 'accessibility-checker ' ) ),
280+ esc_url ( $ privacy_url ),
281+ esc_url ( $ data_processing_url ),
282+ esc_attr__ ( 'Privacy Policy (opens in a new window) ' , 'accessibility-checker ' ),
283+ esc_attr__ ( 'Data Processing Agreement (opens in a new window) ' , 'accessibility-checker ' )
284284 );
285285 ?>
286286 </p>
@@ -290,8 +290,8 @@ public function render_page() {
290290 <aside class="edac-reports-preview">
291291 <img
292292 class="edac-reports-preview__image"
293- src="<?php echo esc_url ( EDAC_PLUGIN_URL . 'assets/images/accessibility-reports-email-preview.png ' ); ?> "
294- alt="<?php esc_attr_e ( 'Preview of the weekly accessibility report email . ' , 'accessibility-checker ' ); ?> "
293+ src="<?php echo esc_url ( EDAC_PLUGIN_URL . 'assets/images/accessibility-reports-email-preview.jpg ' ); ?> "
294+ alt="<?php esc_attr_e ( 'Weekly email includes total issues found and changes since the last report, coverage information, counts of problems, needs review, passed test percentage, and information about the most problematic pages and the most severe issues . ' , 'accessibility-checker ' ); ?> "
295295 />
296296 </aside>
297297 </div>
@@ -319,42 +319,48 @@ private function get_license_context(): array {
319319 /**
320320 * Resolve effective license context from current status values.
321321 *
322- * @param bool $has_pro_plugin Whether the Pro plugin is installed.
323- * @param string $pro_status Current Pro license status.
324- * @param string $free_status Current free license status.
325- * @param string $site_id Current connected site ID.
322+ * @param bool $has_pro_plugin Whether the Pro plugin is installed.
323+ * @param string $pro_status Current Pro license status.
324+ * @param string $free_status Current free license status.
325+ * @param string $site_id Current connected site ID.
326+ * @param bool $fallback_active Whether a fallback from Pro to Free is currently active.
326327 * @return array{has_pro_plugin:bool,is_pro:bool,status:string,is_connected:bool}
327328 */
328- private static function resolve_license_context ( bool $ has_pro_plugin , string $ pro_status , string $ free_status , string $ site_id ): array {
329- $ is_pro = $ has_pro_plugin && 'valid ' === $ pro_status ;
329+ private static function resolve_license_context ( bool $ has_pro_plugin , string $ pro_status , string $ free_status , string $ site_id, bool $ fallback_active = false ): array {
330+ $ is_pro = $ has_pro_plugin && 'valid ' === $ pro_status && ! $ fallback_active ;
330331 $ status = $ is_pro ? $ pro_status : $ free_status ;
331332 $ is_connected = 'valid ' === $ status && '' !== $ site_id ;
332333
333334
334335 return [
335- 'has_pro_plugin ' => $ has_pro_plugin ,
336- 'is_pro ' => $ is_pro ,
337- 'status ' => $ status ,
338- 'is_connected ' => $ is_connected ,
336+ 'has_pro_plugin ' => $ has_pro_plugin ,
337+ 'is_pro ' => $ is_pro ,
338+ 'status ' => $ status ,
339+ 'is_connected ' => $ is_connected ,
340+ 'fallback_active ' => $ fallback_active ,
339341 ];
340342 }
341343
342344 /**
343- * Get the next report collection date for display.
344- *
345- * Prefers the schedule returned by the connector service and falls back to a
346- * local estimate when no remote schedule has been stored yet.
345+ * Gets the next estimated send date, assuming each send will be on
346+ * Mondays.
347347 *
348348 * @return string
349349 */
350- private function get_next_collection_date (): string {
351- $ next_collection = (string ) get_option ( 'edac_next_collection ' , '' );
352- if ( '' !== $ next_collection ) {
353- return $ next_collection ;
354- }
350+ private function get_next_send_estimate_date (): string {
351+ try {
352+ // If today is Monday, use today. Otherwise, use next Monday.
353+ $ today = new \DateTime ( 'now ' , wp_timezone () );
355354
356- $ next_monday = new \DateTime ( 'next monday ' , wp_timezone () );
357- return $ next_monday ->format ( 'Y-m-d ' );
355+ if ( '1 ' === $ today ->format ( 'N ' ) ) {
356+ return $ today ->format ( 'Y-m-d ' );
357+ }
358+
359+ $ next_monday = new \DateTime ( 'next monday ' , wp_timezone () );
360+ return $ next_monday ->format ( 'Y-m-d ' );
361+ } catch ( \Exception $ exception ) {
362+ return '' ;
363+ }
358364 }
359365
360366 /**
0 commit comments