Skip to content

Commit 03fa688

Browse files
authored
Merge pull request #1834 from equalizedigital/release/1.47.0
Release v1.47.0
2 parents 29f381f + bcffe72 commit 03fa688

20 files changed

Lines changed: 518 additions & 316 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://equalizedigital.com/accessibility-checker
1212
* Description: Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.
13-
* Version: 1.46.0
13+
* Version: 1.47.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.46.0' );
39+
define( 'EDAC_VERSION', '1.47.0' );
4040
}
4141

4242
// Current database version.

admin/class-ajax.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,15 @@ function ( $a, $b ) {
526526
)
527527
) . '" />';
528528
} elseif ( $object_svg ) {
529-
$html .= $object_svg;
529+
// Rendered as an <img> via a data URI, not injected as inline markup -
530+
// see edac_svg_markup_to_data_uri()'s docblock for why.
531+
$html .= '<img src="' . esc_url( edac_svg_markup_to_data_uri( $object_svg ), [ 'data', 'http', 'https' ] ) . '" alt="' . esc_attr(
532+
sprintf(
533+
/* translators: %d: issue ID number */
534+
__( 'image for issue %d', 'accessibility-checker' ),
535+
$id
536+
)
537+
) . '" />';
530538
}
531539

532540
$html .= '</div>';

admin/class-enqueue-admin.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
7878

7979
global $post;
8080
$post_id = is_object( $post ) ? $post->ID : null;
81+
82+
// On a latest-posts homepage the global $post is the first blog post, not the page;
83+
// let extensions supply the correct ID (e.g. a Pro virtual-page ID).
84+
$post_id = apply_filters( 'edac_filter_admin_post_id', $post_id );
85+
8186
wp_enqueue_script( 'edac', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/admin.bundle.js', [ 'jquery' ], EDAC_VERSION, false );
8287
wp_set_script_translations( 'edac', 'accessibility-checker', plugin_dir_path( EDAC_PLUGIN_FILE ) . 'languages' );
8388

@@ -99,8 +104,9 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
99104

100105
if ( 'post.php' === $pagenow || 'post-new.php' === $pagenow ) {
101106

102-
// Is this posttype setup to be checked?
103-
$active = $is_scannable_post;
107+
// Base the scannable check on the filtered $post_id, not the original global $post.
108+
$filtered_post_type = $post_id ? get_post_type( $post_id ) : false;
109+
$active = $filtered_post_type && is_array( $post_types ) && in_array( $filtered_post_type, $post_types, true );
104110

105111
$pro = defined( 'EDACP_VERSION' ) && EDAC_KEY_VALID;
106112

@@ -113,8 +119,15 @@ public static function maybe_enqueue_admin_and_editor_app_scripts() {
113119
wp_enqueue_script( 'edac-editor-app', plugin_dir_url( EDAC_PLUGIN_FILE ) . 'build/editorApp.bundle.js', false, EDAC_VERSION, false );
114120
wp_set_script_translations( 'edac-editor-app', 'accessibility-checker', plugin_dir_path( EDAC_PLUGIN_FILE ) . 'languages' );
115121

116-
// If this is the frontpage or homepage, preview URLs won't work. Use the live URL.
117-
if ( (int) get_option( 'page_on_front' ) === $post_id || (int) get_option( 'page_for_posts' ) === $post_id ) {
122+
// Preview URLs don't work for the homepage. On a latest-posts homepage (including the
123+
// show_on_front=page fallback with no static front page) use the live home URL instead.
124+
$show_on_front = get_option( 'show_on_front', 'posts' );
125+
$is_latest_posts_home = ( 'posts' === $show_on_front || ( 'page' === $show_on_front && ! get_option( 'page_on_front' ) ) )
126+
&& apply_filters( 'edac_filter_post_is_latest_posts_home', false, $post_id );
127+
128+
if ( $is_latest_posts_home ) {
129+
$scan_url = add_query_arg( 'edac_pageScanner', 1, trailingslashit( get_home_url() ) );
130+
} elseif ( (int) get_option( 'page_on_front' ) === $post_id || (int) get_option( 'page_for_posts' ) === $post_id ) {
118131
$scan_url = add_query_arg( 'edac_pageScanner', 1, get_permalink( $post_id ) );
119132
} else {
120133
$post_view_link = apply_filters(

admin/class-helpers.php

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -139,54 +139,6 @@ public static function get_option_as_array( $option_name ) {
139139
return [];
140140
}
141141

142-
143-
/**
144-
* Determine if a domain is hosted on a local loopback
145-
*
146-
* @param string $domain The domain to check.
147-
* @return boolean
148-
*/
149-
public static function is_domain_loopback( $domain ) {
150-
151-
// Check if this is an ipv4 address in the loopback range.
152-
153-
$record = gethostbyname( $domain );
154-
$loopback_start = ip2long( '127.0.0.0' );
155-
$loopback_end = ip2long( '127.255.255.255' );
156-
$ip_long = ip2long( $record );
157-
158-
if ( $ip_long >= $loopback_start && $ip_long <= $loopback_end ) {
159-
return true;
160-
}
161-
162-
// Check if this is an ipv6 loopback.
163-
164-
try {
165-
$records = dns_get_record( $domain, DNS_AAAA );
166-
} catch ( \Throwable $th ) {
167-
return false;
168-
}
169-
170-
foreach ( $records as $record ) {
171-
172-
// Do ipv6 check.
173-
if ( isset( $record['type'] ) && 'AAAA' === $record['type'] ) {
174-
175-
// Normalize the IPv6 address for comparison.
176-
$normalized_ipv6 = inet_pton( $record['ipv6'] );
177-
178-
// Normalize the loopback address.
179-
$loopback_ipv6 = inet_pton( '::1' );
180-
181-
if ( $normalized_ipv6 === $loopback_ipv6 ) {
182-
return true;
183-
}
184-
}
185-
}
186-
187-
return false;
188-
}
189-
190142
/**
191143
* Filter out inactive rules from the results returned.
192144
*

changelog.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
*** Accessibility Checker ***
22

3+
2026-07-14 - version 1.47.0
4+
* Updated - the frontend highlighter now draws a white ring around the outline so highlighted elements stay visible on any background color.
5+
* Updated - the empty alt text check no longer flags 1x1 tracking pixels.
6+
* Updated - the link protocol checks now handle href values that contain leading whitespace.
7+
* Updated - SVG code snippets in the Accessibility Analysis panel are now rendered as images instead of raw markup.
8+
* Fix - scan results for the homepage are now stored against the homepage instead of the first blog post when the site is set to show latest posts.
9+
* Fix - the Simplified Summary text areas in the editor sidebar now have a label that assistive technology can announce.
10+
* Fix - corrected a caching issue that could cause database table name lookups to return the wrong table.
11+
* Remove - deleted an unused internal helper function.
12+
313
2026-07-08 - version 1.46.0
414
* Updated - the aria-hidden rule no longer flags core Cover blocks.
515
* Updated - the Incorrect Heading Order summary no longer claims specific heading levels that may not match the actual issue.

includes/classes/class-enqueue-frontend.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,14 @@ public static function maybe_enqueue_frontend_highlighter() {
102102

103103
// Don't load on the frontend if we don't have a post to work with.
104104
global $post;
105-
$post_id = apply_filters( 'edac_filter_frontend_highlight_post_id', is_object( $post ) ? $post->ID : null );
105+
106+
// On a latest-posts homepage the global $post is the first blog post, so using its ID
107+
// would misattribute results; pass null and let the filter supply an ID (Pro) or bail.
108+
$default_post_id = ( is_home() && is_front_page() )
109+
? null
110+
: ( is_object( $post ) ? $post->ID : null );
111+
112+
$post_id = apply_filters( 'edac_filter_frontend_highlight_post_id', $default_post_id );
106113

107114
if ( null === $post_id ) {
108115
return;

includes/helper-functions.php

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ function edac_get_post_type_label( string $post_type ): string {
248248
*/
249249
function edac_get_valid_table_name( $table_name ) {
250250
global $wpdb;
251-
static $found_table_name;
251+
static $found_table_names = [];
252252

253-
if ( isset( $found_table_name ) ) {
254-
return $found_table_name;
253+
if ( isset( $found_table_names[ $table_name ] ) ) {
254+
return $found_table_names[ $table_name ];
255255
}
256256

257257
// Check if table name only contains alphanumeric characters, underscores, or hyphens.
@@ -267,8 +267,8 @@ function edac_get_valid_table_name( $table_name ) {
267267
return null;
268268
}
269269

270-
$found_table_name = $table_name;
271-
return $found_table_name;
270+
$found_table_names[ $table_name ] = $table_name;
271+
return $table_name;
272272
}
273273

274274
/**
@@ -788,6 +788,27 @@ function edac_parse_html_for_media( $html ) {
788788
];
789789
}
790790

791+
/**
792+
* Convert raw SVG markup into a data: URI, safe as an <img> src - browsers
793+
* don't execute scripts or event handlers in SVGs loaded as images. Returns
794+
* a bare (payload-less) data URI if given anything other than a string.
795+
*
796+
* @since 1.47.0
797+
*
798+
* @param mixed $svg_markup Raw SVG markup - expected to be a string.
799+
* @return string Unescaped data URI - callers must esc_url() it before output,
800+
* passing a protocols list that includes 'data' (e.g.
801+
* esc_url( $uri, [ 'data', 'http', 'https' ] )); with the
802+
* default protocols esc_url() rejects data: URIs and returns ''.
803+
*/
804+
function edac_svg_markup_to_data_uri( $svg_markup ): string {
805+
if ( ! is_string( $svg_markup ) ) {
806+
return 'data:image/svg+xml,';
807+
}
808+
809+
return 'data:image/svg+xml,' . rawurlencode( $svg_markup );
810+
}
811+
791812
/**
792813
* Remove corrected posts
793814
*

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.46.0",
3+
"version": "1.47.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: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
=== Equalize Digital Accessibility Checker - WCAG, ADA, EAA and Section 508 compliance ===
22
Contributors: equalizedigital, alh0319, stevejonesdev
33
Tags: accessibility, EAA, WCAG, ADA, WP accessibility
4-
Requires at least: 6.7
4+
Requires at least: 6.8
55
Tested up to: 7.0
6-
Stable tag: 1.46.0
6+
Stable tag: 1.47.0
77
Requires PHP: 7.4
88
License: GPL-2.0-or-later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -279,6 +279,16 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
279279

280280
== Changelog ==
281281

282+
2026-07-14 - version 1.47.0
283+
* Updated - the frontend highlighter now draws a white ring around the outline so highlighted elements stay visible on any background color.
284+
* Updated - the empty alt text check no longer flags 1x1 tracking pixels.
285+
* Updated - the link protocol checks now handle href values that contain leading whitespace.
286+
* Updated - SVG code snippets in the Accessibility Analysis panel are now rendered as images instead of raw markup.
287+
* Fix - scan results for the homepage are now stored against the homepage instead of the first blog post when the site is set to show latest posts.
288+
* Fix - the Simplified Summary text areas in the editor sidebar now have a label that assistive technology can announce.
289+
* Fix - corrected a caching issue that could cause database table name lookups to return the wrong table.
290+
* Remove - deleted an unused internal helper function.
291+
282292
2026-07-08 - version 1.46.0
283293
* Updated - the aria-hidden rule no longer flags core Cover blocks.
284294
* Updated - the Incorrect Heading Order summary no longer claims specific heading levels that may not match the actual issue.

src/frontendHighlighterApp/sass/app.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ body {
4949

5050
&-element-selected {
5151
outline: dashed 4px transparent !important;
52-
outline-offset: 5px !important;
52+
outline-offset: 2px !important;
5353
outline-color: magenta !important;
54+
box-shadow: 0 0 0 8px variables.$color-white !important;
5455

5556
&-min-width {
5657
min-width: 25px !important;

0 commit comments

Comments
 (0)