Skip to content

Commit 0a04f4a

Browse files
authored
Merge pull request #1316 from equalizedigital/release/1.36.0
Release v1.36.0
2 parents b669336 + 398444d commit 0a04f4a

15 files changed

Lines changed: 442 additions & 18 deletions

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.35.0
13+
* Version: 1.36.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.35.0' );
39+
define( 'EDAC_VERSION', '1.36.0' );
4040
}
4141

4242
// Current database version.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?php
2+
/**
3+
* Handles plugin activation redirect to welcome page.
4+
*
5+
* @package Accessibility_Checker\Admin
6+
*/
7+
8+
namespace EqualizeDigital\AccessibilityChecker\Admin;
9+
10+
if ( ! defined( 'ABSPATH' ) ) {
11+
exit; // Exit if accessed directly.
12+
}
13+
14+
/**
15+
* Class Activation_Redirect
16+
*
17+
* Handles redirecting to the welcome page after plugin activation.
18+
*
19+
* @since 1.36.0
20+
*/
21+
class Activation_Redirect {
22+
23+
/**
24+
* The page slug for the welcome page.
25+
*
26+
* @since 1.36.0
27+
* @var string
28+
*/
29+
const WELCOME_PAGE_SLUG = 'accessibility_checker';
30+
31+
/**
32+
* Initialize the activation redirect.
33+
*
34+
* @since 1.36.0
35+
*/
36+
public function init(): void {
37+
add_action( 'admin_init', [ $this, 'maybe_redirect_to_welcome' ] );
38+
}
39+
40+
/**
41+
* Get the welcome page URL.
42+
*
43+
* @since 1.36.0
44+
* @return string The URL to the welcome page.
45+
*/
46+
public function get_welcome_page_url(): string {
47+
return admin_url( 'admin.php?page=' . self::WELCOME_PAGE_SLUG );
48+
}
49+
50+
/**
51+
* Redirect to welcome page after activation if conditions are met.
52+
*
53+
* This will only redirect if:
54+
* - The activation redirect transient is set
55+
* - We're not doing an AJAX request
56+
* - We're not in the network admin (multisite)
57+
* - We're not activating multiple plugins at once
58+
* - User has permission to access the welcome page
59+
*
60+
* @since 1.36.0
61+
* @return void
62+
*/
63+
public function maybe_redirect_to_welcome(): void {
64+
// Check if the activation redirect transient exists.
65+
if ( ! get_transient( 'edac_activation_redirect' ) ) {
66+
return;
67+
}
68+
69+
// Don't redirect during AJAX requests.
70+
if ( wp_doing_ajax() ) {
71+
return;
72+
}
73+
74+
// Don't redirect during REST API requests.
75+
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
76+
return;
77+
}
78+
79+
// Don't redirect in network admin (multisite).
80+
if ( is_network_admin() ) {
81+
return;
82+
}
83+
84+
// Don't redirect if multiple plugins are being activated at once.
85+
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- We're checking $_GET, not processing form data.
86+
if ( isset( $_GET['activate-multi'] ) ) {
87+
return;
88+
}
89+
90+
// Don't redirect if user doesn't have permission to see the welcome page.
91+
// Uses 'edit_posts' to match the welcome page's capability check (see includes/options-page.php).
92+
// This allows Authors and above to access the welcome page, as intended by the plugin design.
93+
if ( ! current_user_can( 'edit_posts' ) ) {
94+
return;
95+
}
96+
97+
// Don't redirect if we're in a test environment.
98+
if ( defined( 'WP_TESTS_DOMAIN' ) ) {
99+
return;
100+
}
101+
102+
// Delete the transient to prevent redirect loops.
103+
delete_transient( 'edac_activation_redirect' );
104+
105+
// Perform the redirect to the welcome page.
106+
wp_safe_redirect( $this->get_welcome_page_url() );
107+
exit;
108+
}
109+
}

admin/class-admin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use EDAC\Admin\Post_Save;
1414
use EqualizeDigital\AccessibilityChecker\Admin\Upgrade_Promotion;
1515
use EqualizeDigital\AccessibilityChecker\Admin\Admin_Footer_Text;
16+
use EqualizeDigital\AccessibilityChecker\Admin\Activation_Redirect;
1617

1718
/**
1819
* Admin handling class.
@@ -76,6 +77,9 @@ public function init(): void {
7677
$admin_footer_text = new Admin_Footer_Text();
7778
$admin_footer_text->init();
7879

80+
$activation_redirect = new Activation_Redirect();
81+
$activation_redirect->init();
82+
7983
$this->init_ajax();
8084

8185
$this->meta_boxes->init_hooks();

admin/class-scans-stats.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,9 @@ function ( $item ) {
184184
$rule_query = new Issues_Query(
185185
[
186186
'rule_slugs' => [ $rule_slug ],
187+
'post_types' => Settings::get_scannable_post_types(),
187188
],
188-
1,
189-
Issues_Query::FLAG_INCLUDE_ALL_POST_TYPES
189+
1
190190
);
191191

192192
if ( $rule_query->count() ) {
@@ -195,8 +195,9 @@ function ( $item ) {
195195
}
196196
$data['rules_passed'] = $this->rule_count - $data['rules_failed'];
197197

198-
$data['passed_percentage'] = 100;
199-
if ( $data['posts_scanned'] > 0 && $tests_count > 0 ) {
198+
$data['passed_percentage'] = 'N/A';
199+
$scannable_post_types = Settings::get_scannable_post_types();
200+
if ( ! empty( $scannable_post_types ) && $data['posts_scanned'] > 0 && $tests_count > 0 ) {
200201
$data['passed_percentage'] = round( ( $data['rules_passed'] / $this->rule_count ) * 100, 2 );
201202
}
202203

changelog.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
*** Accessibility Checker ***
2+
3+
2025-15-22 - version 1.36.0
4+
* Fix - passed tests percentage logic now accounts times no posts are scanned
5+
* Fix - don't prevent scan speed saving when pro plugin is enabled.
6+
* Add - new trigger for invalid alt text - "an image".
7+
* Add - allow role="menuitem" with aria-expanded in link validation checks
8+
* New - visit welcome screen on plugin activation.
9+
210
2025-12-05 - version 1.35.0
311
* Fix - Ignored issues no longer count in density scores.
412
* Fix - Ignored issues count comparison and message logic in frontend highlighter.

includes/activation.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ function edac_activation() {
2222

2323
// This is an add_option on purpose to not overwrite user settings on update.
2424
add_option( 'edacp_ignore_user_roles', [ 'administrator' ] );
25+
26+
// Set transient to trigger redirect to welcome page.
27+
// This will be checked on admin_init and deleted after redirect.
28+
set_transient( 'edac_activation_redirect', true, 60 );
2529
}

includes/options-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ function edac_full_site_scan_speed_cb() {
413413
<?php foreach ( $speed_values as $value => $label ) : ?>
414414
<option
415415
value="<?php echo esc_attr( $value ); ?>"
416-
<?php selected( $full_site_scan_speed, (int) $value, false ); ?>
416+
<?php selected( $full_site_scan_speed, (int) $value ); ?>
417417
>
418418
<?php echo esc_html( $label ); ?>
419419
</option>

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "accessibility-checker",
3-
"version": "1.35.0",
3+
"version": "1.36.0",
44
"description": "Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.",
55
"author": "Equalize Digital",
66
"license": "GPL-2.0+",

readme.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: equalizedigital, alh0319, stevejonesdev
33
Tags: accessibility, accessible, wcag, ada, WP accessibility
44
Requires at least: 6.6
55
Tested up to: 6.9
6-
Stable tag: 1.35.0
6+
Stable tag: 1.36.0
77
License: GPLv2 or later
88
License URI: http://www.gnu.org/licenses/gpl-2.0.html
99

@@ -210,6 +210,14 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
210210
10. Accessibility Checker automated fix settings.
211211

212212
== Changelog ==
213+
214+
2025-15-22 - version 1.36.0
215+
* Fix - passed tests percentage logic now accounts times no posts are scanned
216+
* Fix - don't prevent scan speed saving when pro plugin is enabled.
217+
* Add - new trigger for invalid alt text - "an image".
218+
* Add - allow role="menuitem" with aria-expanded in link validation checks
219+
* New - visit welcome screen on plugin activation.
220+
213221
2025-12-05 - version 1.35.0
214222
* Fix - Ignored issues no longer count in density scores.
215223
* Fix - Ignored issues count comparison and message logic in frontend highlighter.

0 commit comments

Comments
 (0)