Skip to content

Commit e5db843

Browse files
authored
Merge pull request #1693 from equalizedigital/release/1.41.0
Release v1.41.0
2 parents 731c08e + ae3aee8 commit e5db843

424 files changed

Lines changed: 60468 additions & 183317 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

accessibility-checker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Plugin Name: Accessibility Checker
1111
* Plugin URI: https://a11ychecker.com
1212
* Description: Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.
13-
* Version: 1.40.0
13+
* Version: 1.41.0
1414
* Requires PHP: 7.4
1515
* Author: Equalize Digital
1616
* Author URI: https://equalizedigital.com
@@ -36,7 +36,7 @@
3636

3737
// Current plugin version.
3838
if ( ! defined( 'EDAC_VERSION' ) ) {
39-
define( 'EDAC_VERSION', '1.40.0' );
39+
define( 'EDAC_VERSION', '1.41.0' );
4040
}
4141

4242
// Current database version.

admin/AdminPage/AccessibilityReportsPage.php

Lines changed: 96 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ 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+
$is_registered = $license_context['is_registered'];
88+
$status = $license_context['status'];
8789
$next_send_date = $this->get_next_send_estimate_date();
8890
$scans_stats = new Scans_Stats();
8991
$summary = $scans_stats->summary();
@@ -137,74 +139,97 @@ public function render_page() {
137139
<section class="edac-reports-page__panel">
138140
<h2><?php esc_html_e( 'Accessibility Reports', 'accessibility-checker' ); ?></h2>
139141

140-
<?php if ( ! $is_connected ) : ?>
141-
<p class="edac-reports-page__intro">
142-
<?php
143-
if ( $is_pro ) {
144-
esc_html_e( 'Get recurring email reports with a snapshot of your site’s accessibility, including total issues, trends over time, most problematic pages, and the most severe issues to fix first.', 'accessibility-checker' );
145-
} else {
146-
esc_html_e( 'Get recurring email reports with a snapshot of your site’s accessibility, including total issues, trends over time, most problematic pages, and the most severe issues to fix first. Some details, like full-site coverage and issue breakdowns, are available in Pro.', 'accessibility-checker' );
147-
}
148-
?>
149-
</p>
150-
151-
<?php if ( $is_pro ) : ?>
152-
<div class="edac-reports-page__single-action">
142+
<?php if ( ! $is_connected && 'expired' === $status && $is_registered ) : ?>
143+
<div class="edac-reports-grid edac-reports-grid--two">
144+
<div class="edac-reports-card">
145+
<div class="edac-reports-card__header">
146+
<h3><?php esc_html_e( 'License Expired', 'accessibility-checker' ); ?></h3>
147+
</div>
148+
<p>
149+
<?php esc_html_e( 'Your license has expired. This site is still connected but reports may stop until your license is renewed.', 'accessibility-checker' ); ?>
150+
</p>
151+
<p>
152+
<a href="<?php echo esc_url( edac_link_wrapper( 'https://my.equalizedigital.com/', 'accessibility-reports', 'renew', false ) ); ?>" target="_blank" rel="noopener noreferrer">
153+
<?php esc_html_e( 'Renew your license', 'accessibility-checker' ); ?>
154+
</a>
155+
</p>
156+
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
157+
<input type="hidden" name="action" value="edac_jwt_unregister" />
158+
<?php wp_nonce_field( 'edac_jwt_unregister', 'edac_jwt_unregister_nonce' ); ?>
159+
<button type="submit" class="button edac-reports-page__button" name="edac_jwt_unregister">
160+
<?php esc_html_e( 'Disable Email Reports', 'accessibility-checker' ); ?>
161+
</button>
162+
</form>
163+
</div>
164+
</div>
165+
<?php elseif ( ! $is_connected ) : ?>
166+
<p class="edac-reports-page__intro">
167+
<?php
168+
if ( $is_pro ) {
169+
esc_html_e( 'Get recurring email reports with a snapshot of your site’s accessibility, including total issues, trends over time, most problematic pages, and the most severe issues to fix first.', 'accessibility-checker' );
170+
} else {
171+
esc_html_e( 'Get recurring email reports with a snapshot of your site’s accessibility, including total issues, trends over time, most problematic pages, and the most severe issues to fix first. Some details, like full-site coverage and issue breakdowns, are available in Pro.', 'accessibility-checker' );
172+
}
173+
?>
174+
</p>
175+
176+
<?php if ( $is_pro ) : ?>
177+
<div class="edac-reports-page__single-action">
178+
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
179+
<input type="hidden" name="action" value="edac_jwt_register" />
180+
<?php wp_nonce_field( 'edac_jwt_register', 'edac_jwt_register_nonce' ); ?>
181+
<button type="submit" class="button button-primary edac-reports-page__button">
182+
<?php esc_html_e( 'Enable Email Reports', 'accessibility-checker' ); ?>
183+
</button>
184+
</form>
185+
</div>
186+
<?php else : ?>
187+
<div class="edac-reports-grid edac-reports-grid--two">
188+
<div class="edac-reports-card">
189+
<h3><?php esc_html_e( 'Free License Key', 'accessibility-checker' ); ?></h3>
153190
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
154-
<input type="hidden" name="action" value="edac_jwt_register" />
155-
<?php wp_nonce_field( 'edac_jwt_register', 'edac_jwt_register_nonce' ); ?>
156-
<button type="submit" class="button button-primary edac-reports-page__button">
191+
<input type="hidden" name="action" value="edac_license" />
192+
<?php wp_nonce_field( 'edac_license_nonce', 'edac_license_nonce' ); ?>
193+
<label class="screen-reader-text" for="edac-reports-license-key"><?php esc_html_e( 'Free License Key', 'accessibility-checker' ); ?></label>
194+
<input id="edac-reports-license-key" name="edacp_license_key" type="text" class="regular-text edac-reports-page__license-input" value="<?php echo esc_attr( $license_key ); ?>" />
195+
<button type="submit" class="button button-primary edac-reports-page__button" name="edac_license_activate">
157196
<?php esc_html_e( 'Enable Email Reports', 'accessibility-checker' ); ?>
158197
</button>
159198
</form>
160199
</div>
161-
<?php else : ?>
162-
<div class="edac-reports-grid edac-reports-grid--two">
163-
<div class="edac-reports-card">
164-
<h3><?php esc_html_e( 'Free License Key', 'accessibility-checker' ); ?></h3>
165-
<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>">
166-
<input type="hidden" name="action" value="edac_license" />
167-
<?php wp_nonce_field( 'edac_license_nonce', 'edac_license_nonce' ); ?>
168-
<label class="screen-reader-text" for="edac-reports-license-key"><?php esc_html_e( 'Free License Key', 'accessibility-checker' ); ?></label>
169-
<input id="edac-reports-license-key" name="edacp_license_key" type="text" class="regular-text edac-reports-page__license-input" value="<?php echo esc_attr( $license_key ); ?>" />
170-
<button type="submit" class="button button-primary edac-reports-page__button" name="edac_license_activate">
171-
<?php esc_html_e( 'Enable Email Reports', 'accessibility-checker' ); ?>
172-
</button>
173-
</form>
174-
</div>
175200

176-
<div class="edac-reports-card">
177-
<h3><?php esc_html_e( 'Get a Free License Key', 'accessibility-checker' ); ?></h3>
178-
<p>
179-
<?php
180-
printf(
181-
/* translators: %s: dashboard URL. */
182-
wp_kses_post( __( 'Got the plugin from Equalize Digital? Your key is in your <a href="%s" target="_blank" rel="noopener noreferrer">dashboard</a>.', 'accessibility-checker' ) ),
183-
esc_url( $dashboard_url )
184-
);
185-
?>
186-
</p>
187-
<p>
188-
<?php
189-
printf(
190-
/* translators: %s: signup URL. */
191-
wp_kses_post( __( 'Installed from WordPress.org? <a href="%s" target="_blank" rel="noopener noreferrer">Create a free account</a> to get one.', 'accessibility-checker' ) ),
192-
esc_url( $signup_url )
193-
);
194-
?>
195-
</p>
196-
<p>
197-
<?php
198-
printf(
199-
/* translators: %s: signup URL. */
200-
wp_kses_post( __( 'Not sure? Just <a href="%s" target="_blank" rel="noopener noreferrer">create a free account</a>. It only takes a minute.', 'accessibility-checker' ) ),
201-
esc_url( $signup_url )
202-
);
203-
?>
204-
</p>
205-
</div>
201+
<div class="edac-reports-card">
202+
<h3><?php esc_html_e( 'Get a Free License Key', 'accessibility-checker' ); ?></h3>
203+
<p>
204+
<?php
205+
printf(
206+
/* translators: %s: dashboard URL. */
207+
wp_kses_post( __( 'Got the plugin from Equalize Digital? Your key is in your <a href="%s" target="_blank" rel="noopener noreferrer">dashboard</a>.', 'accessibility-checker' ) ),
208+
esc_url( $dashboard_url )
209+
);
210+
?>
211+
</p>
212+
<p>
213+
<?php
214+
printf(
215+
/* translators: %s: signup URL. */
216+
wp_kses_post( __( 'Installed from WordPress.org? <a href="%s" target="_blank" rel="noopener noreferrer">Create a free account</a> to get one.', 'accessibility-checker' ) ),
217+
esc_url( $signup_url )
218+
);
219+
?>
220+
</p>
221+
<p>
222+
<?php
223+
printf(
224+
/* translators: %s: signup URL. */
225+
wp_kses_post( __( 'Not sure? Just <a href="%s" target="_blank" rel="noopener noreferrer">create a free account</a>. It only takes a minute.', 'accessibility-checker' ) ),
226+
esc_url( $signup_url )
227+
);
228+
?>
229+
</p>
206230
</div>
207-
<?php endif; ?>
231+
</div>
232+
<?php endif; ?>
208233
<?php else : ?>
209234
<div class="edac-reports-grid edac-reports-grid--two">
210235
<div class="edac-reports-card">
@@ -304,7 +329,7 @@ class="edac-reports-preview__image"
304329
* Pro should only be treated as authoritative when it is both installed and valid.
305330
* Otherwise the reports page should fall back to the free plugin state.
306331
*
307-
* @return array{has_pro_plugin:bool,is_pro:bool,status:string,is_connected:bool}
332+
* @return array{has_pro_plugin:bool,is_pro:bool,status:string,is_connected:bool,fallback_active:bool}
308333
*/
309334
private function get_license_context(): array {
310335
$has_pro_plugin = defined( 'EDACP_VERSION' );
@@ -324,19 +349,23 @@ private function get_license_context(): array {
324349
* @param string $free_status Current free license status.
325350
* @param string $site_id Current connected site ID.
326351
* @param bool $fallback_active Whether a fallback from Pro to Free is currently active.
327-
* @return array{has_pro_plugin:bool,is_pro:bool,status:string,is_connected:bool}
352+
* @return array{has_pro_plugin:bool,is_pro:bool,status:string,is_connected:bool,is_registered:bool,fallback_active:bool}
328353
*/
329354
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;
331-
$status = $is_pro ? $pro_status : $free_status;
332-
$is_connected = 'valid' === $status && '' !== $site_id;
333-
355+
$is_pro = $has_pro_plugin && 'valid' === $pro_status && ! $fallback_active;
356+
$status = $is_pro ? $pro_status : $free_status;
357+
// is_connected is true when:
358+
// 1. License status is valid AND site_id exists, OR
359+
// 2. Pro exists but is expired/degraded (fallback_active), AND site_id exists (reports still flowing).
360+
$is_connected = ( 'valid' === $status && '' !== $site_id ) || ( $has_pro_plugin && $fallback_active && '' !== $site_id );
361+
$is_registered = '' !== $site_id;
334362

335363
return [
336364
'has_pro_plugin' => $has_pro_plugin,
337365
'is_pro' => $is_pro,
338366
'status' => $status,
339367
'is_connected' => $is_connected,
368+
'is_registered' => $is_registered,
340369
'fallback_active' => $fallback_active,
341370
];
342371
}

0 commit comments

Comments
 (0)