Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.16.4 #825

Merged
merged 29 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
71840dc
Pass an editor url via data attribute on fix button for open issues f…
pattonwebz Nov 18, 2024
d7b4e97
Handle editor link set in edac_script_vars when saving fix settings f…
pattonwebz Nov 18, 2024
396f04b
Set a transient when fixes settings are updated
pattonwebz Nov 19, 2024
c58e567
Show a notice about rescan and cache flushing when fixes are saved.
pattonwebz Nov 19, 2024
5c73b28
Make settings saved notice dismissable.
pattonwebz Nov 19, 2024
7b0b896
Update fix settings save message
pattonwebz Nov 19, 2024
8df5d07
Merge pull request #818 from equalizedigital/release/1.16.3
pattonwebz Nov 19, 2024
196e2fd
Use double quotes for save message
pattonwebz Nov 19, 2024
0384ef1
Replace node-sass with sass package
pattonwebz Nov 21, 2024
171dce0
Replace inline divisions with calc calls in sass file
pattonwebz Nov 21, 2024
c95ee1f
Replace all @import statements with @use statements
pattonwebz Nov 21, 2024
347a7a8
Wrap a mixed-decl issue
pattonwebz Nov 21, 2024
9d10862
Update webpack and sass-loader to avoid deprecation notices
pattonwebz Nov 21, 2024
3393abd
Fix: Improve table header detection logic to correctly validate row h…
SteveJonesDev Nov 22, 2024
3041af6
fixed: WPCS
SteveJonesDev Nov 22, 2024
9acd10b
Merge pull request #816 from equalizedigital/william/7965823554/show-…
pattonwebz Nov 22, 2024
702c2c4
Merge pull request #817 from equalizedigital/william/7973474980/show-…
pattonwebz Nov 22, 2024
cf1f2e6
Merge pull request #819 from equalizedigital/william/8044513515/repla…
pattonwebz Nov 22, 2024
3585c1a
Remove a duplicated siteid reference in query
pattonwebz Nov 26, 2024
f12dce1
Return early when checking possible heading if the element doesn't ha…
pattonwebz Nov 27, 2024
a502fa3
Merge pull request #820 from equalizedigital/steve/8057688694/missing…
pattonwebz Dec 5, 2024
0410cfb
Merge pull request #823 from equalizedigital/william/fix-warnings-cou…
pattonwebz Dec 5, 2024
408defa
Update where a scan button link points to
pattonwebz Dec 5, 2024
1676a05
Merge pull request #824 from equalizedigital/william/no-issue/update-…
SteveJonesDev Dec 5, 2024
68dd4e5
Merge branch 'develop' of github.com:equalizedigital/accessibility-ch…
pattonwebz Dec 5, 2024
3f27ae5
Bump version 1.16.3 -> 1.16.4
pattonwebz Dec 5, 2024
04a0ae5
Merge branch 'main' into release/1.16.4
pattonwebz Dec 5, 2024
90d0101
Add changelog for 1.16.4
pattonwebz Dec 5, 2024
8d1d438
Merge remote-tracking branch 'origin/release/1.16.4' into release/1.16.4
pattonwebz Dec 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions accessibility-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Plugin Name: Accessibility Checker
* Plugin URI: https://a11ychecker.com
* Description: Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.
* Version: 1.16.3
* Version: 1.16.4
* Author: Equalize Digital
* Author URI: https://equalizedigital.com
* License: GPL-2.0+
Expand All @@ -35,7 +35,7 @@

// Current plugin version.
if ( ! defined( 'EDAC_VERSION' ) ) {
define( 'EDAC_VERSION', '1.16.3' );
define( 'EDAC_VERSION', '1.16.4' );
}

// Current database version.
Expand Down
25 changes: 25 additions & 0 deletions admin/class-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace EDAC\Admin;

use EqualizeDigital\AccessibilityChecker\Fixes\FixesManager;

/**
* Class that handles admin notices
*/
Expand All @@ -27,6 +29,7 @@ public function init_hooks() {

add_action( 'in_admin_header', [ $this, 'edac_remove_admin_notices' ], 1000 );
add_action( 'init', [ $this, 'hook_notices' ] );
add_action( 'updated_option', [ $this, 'set_fixes_transient_on_save' ] );
}

/**
Expand Down Expand Up @@ -422,4 +425,26 @@ public function edac_password_protected_notice_ajax() {

wp_send_json_success( wp_json_encode( $results ) );
}

/**
* Save a transient to indicate that the fixes settings have been updated.
*
* @param string $option The option name that was saved.
*
* @return void
*/
public function set_fixes_transient_on_save( $option ) {
if ( ! class_exists( 'EqualizeDigital\AccessibilityChecker\Fixes\FixesManager' ) ) {
return;
}
$fixes_settings = FixesManager::get_instance()->get_fixes_settings();
$options_keys = [];
foreach ( $fixes_settings as $fix ) {
$options_keys = array_merge( $options_keys, array_keys( $fix['fields'] ) );
}
if ( in_array( $option, $options_keys, true ) ) {
// Set a custom transient as a flag.
set_transient( 'edac_fixes_settings_saved', true, 60 );
}
}
}
2 changes: 1 addition & 1 deletion admin/class-welcome-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static function render_summary() {
<?php esc_html_e( 'Update Counts', 'accessibility-checker' ); ?>
</button>

<a class="edac-ml-1 button" href="<?php echo esc_url( admin_url( 'admin.php?page=accessibility_checker_settings&tab=scan' ) ); ?>">
<a class="edac-ml-1 button" href="<?php echo esc_url( admin_url( 'admin.php?page=accessibility_checker_full_site_scan' ) ); ?>">
<?php esc_html_e( 'Start New Scan', 'accessibility-checker' ); ?>
</a>

Expand Down
2 changes: 1 addition & 1 deletion includes/classes/class-summary-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private function count_warnings() {
global $wpdb;

$warnings_parameters = [ get_current_blog_id(), $this->post_id, 'warning', 0 ];
$warnings_where = 'WHERE siteid = siteid = %d and postid = %d and ruletype = %s and ignre = %d';
$warnings_where = 'WHERE siteid = %d and postid = %d and ruletype = %s and ignre = %d';
if ( EDAC_ANWW_ACTIVE ) {
array_push( $warnings_parameters, 'link_blank' );
$warnings_where .= ' and rule != %s';
Expand Down
41 changes: 26 additions & 15 deletions includes/rules/missing_table_header.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase -- underscore is for valid function name.
/**
* Accessibility Checker pluign file.
* Accessibility Checker plugin file.
*
* @package Accessibility_Checker
*/
Expand All @@ -19,32 +19,43 @@ function edac_rule_missing_table_header( $content, $post ) { // phpcs:ignore --
$tables = $dom->find( 'table' );

if ( ! $tables ) {
return;
return $errors; // Return empty errors array if no tables are found.
}
foreach ( $tables as $table ) {

if ( ! edac_th_match_td( $table ) ) {
foreach ( $tables as $table ) {
// Check if the table has proper headers.
if ( ! edac_has_proper_headers( $table ) ) {
$errors[] = $table;
}
}

return $errors;
}

/**
* Check for TH TD matching
* Check if the table has proper headers
*
* @param obj $table Object to check.
* @return int
* @param object $table Object to check.
* @return bool
*/
function edac_th_match_td( $table ) {
$table_rows = $table->find( 'tr' );
$header_count = 0;
$max_rows = 0;
function edac_has_proper_headers( $table ) {
$table_rows = $table->find( 'tr' );
$has_headers = false;

foreach ( $table_rows as $table_row ) {
if ( 0 === $header_count ) {
$header_count = count( $table_row->find( 'th' ) );
// Check for row or column headers in the current row.
$headers = $table_row->find( 'th' );
foreach ( $headers as $header ) {
// Check if the header has a valid scope or contains text.
$scope = $header->getAttribute( 'scope' );
$text = trim( $header->plaintext );

if ( ! empty( $text ) && ( in_array( $scope, [ 'row', 'col', 'rowgroup', 'colgroup' ], true ) || empty( $scope ) ) ) {
$has_headers = true;
break 2; // Exit both loops as headers are valid.
}
}
$max_rows = max( $max_rows, count( $table_row->find( 'td' ) ) );
}
return $max_rows <= $header_count;

return $has_headers;
}
Loading
Loading