Skip to content

Commit

Permalink
Merge pull request #661 from equalizedigital/release/1.13.1
Browse files Browse the repository at this point in the history
Release v1.13.1
  • Loading branch information
pattonwebz authored Jun 6, 2024
2 parents 55a2aef + c927304 commit 20c4eff
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 93 deletions.
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.13.0
* Version: 1.13.1
* 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.13.0' );
define( 'EDAC_VERSION', '1.13.1' );
}

// Current database version.
Expand Down
72 changes: 0 additions & 72 deletions includes/purge.php

This file was deleted.

8 changes: 2 additions & 6 deletions includes/rules/link_blank.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,11 @@ function edac_check_link_blank_text( $text ) {

$text = strtolower( $text );

// phrases.
$allowed_phrases = [
__( 'opens a new window', 'accessibility-checker' ),
__( 'opens a new tab', 'accessibility-checker' ),
__( 'opens new window', 'accessibility-checker' ),
__( 'opens new tab', 'accessibility-checker' ),
__( 'new window', 'accessibility-checker' ),
__( 'new tab', 'accessibility-checker' ),
];

// check if text contains any of the allowed phrases.
foreach ( $allowed_phrases as $allowed_phrase ) {
if ( strpos( $text, $allowed_phrase ) !== false ) {
return true;
Expand Down
17 changes: 10 additions & 7 deletions includes/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,19 @@ function edac_validate( $post_ID, $post, $action ) {
function edac_remove_corrected_posts( $post_ID, $type, $pre = 1, $ruleset = 'php' ) {
global $wpdb;

$rules = edac_register_rules();
$rule_slugs = [];
$rules = edac_register_rules();
$js_rule_slugs = [];
$php_rule_slugs = [];
// Separate the JS rules and the PHP rules.
foreach ( $rules as $rule ) {
if ( 'js' === $ruleset && isset( $rule['ruleset'] ) && 'js' === $rule['ruleset'] ) {
$rule_slugs[] = $rule['slug'];
} elseif ( 'js' !== $ruleset ) {
$rule_slugs[] = $rule['slug'];
if ( isset( $rule['ruleset'] ) && 'js' === $rule['ruleset'] ) {
$js_rule_slugs[] = $rule['slug'];
} else {
$php_rule_slugs[] = $rule['slug'];
}
}

// Operate only on the slugs for the ruleset we are checking in this call.
$rule_slugs = 'js' === $ruleset ? $js_rule_slugs : $php_rule_slugs;
if ( 0 === count( $rule_slugs ) ) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "accessibility-checker",
"version": "1.13.0",
"version": "1.13.1",
"description": "Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.",
"author": "Equalize Digital",
"license": "GPL-2.0+",
Expand Down
9 changes: 7 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Contributors: equalizedigital, alh0319, stevejonesdev
Tags: accessibility, accessible, wcag, ada, WP accessibility
Requires at least: 6.2
Tested up to: 6.5.3
Stable tag: 1.13.0
Tested up to: 6.5.4
Stable tag: 1.13.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -171,6 +171,11 @@ No, Accessibility Checker runs completely on your server and does not require yo

== Changelog ==

= 1.13.1 =
* Enhancement: Make the new window warning detection less rigid
* Fixed: Avoid flagging possible headings when the entire text is not wrapped
* Fixed: Allow JS checked rules to retain ignored state between scans

= 1.13.0 =
* Added: Meta Viewport zoom-able and scale-able check
* Added: Empty Paragraph warning
Expand Down
12 changes: 9 additions & 3 deletions src/pageScanner/checks/paragraph-styled-as-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ export default {
const fontStyle = style.getPropertyValue( 'font-style' );
const isItalic = [ 'italic', 'oblique' ].includes( fontStyle );

const hasBoldOrItalicTag = node.querySelector( 'b, strong, i, em' ) !== null;

if ( isBold || isItalic || hasBoldOrItalicTag ) {
let wrappedByBoldOrItalicTag = false;
const boldOrItalicTags = node.querySelectorAll( 'b, strong, i, em' );
boldOrItalicTags.forEach( ( tag ) => {
if ( tag.textContent === node.textContent ) {
wrappedByBoldOrItalicTag = true;
}
} );

if ( isBold || isItalic || wrappedByBoldOrItalicTag ) {
return true;
}

Expand Down

0 comments on commit 20c4eff

Please sign in to comment.