Skip to content

Commit

Permalink
Merge pull request #811 from equalizedigital/release/1.16.2
Browse files Browse the repository at this point in the history
Release v1.16.2
  • Loading branch information
pattonwebz authored Nov 14, 2024
2 parents 99e5728 + 3fab5fc commit 7443360
Show file tree
Hide file tree
Showing 13 changed files with 129 additions and 145 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.16.1
* Version: 1.16.2
* 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.1' );
define( 'EDAC_VERSION', '1.16.2' );
}

// Current database version.
Expand Down
18 changes: 7 additions & 11 deletions admin/class-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,19 @@ public function edac_remove_admin_notices() {
public function edac_black_friday_notice() {

// check if accessibility checker pro is active.
$pro = is_plugin_active( 'accessibility-checker-pro/accessibility-checker-pro.php' );
if ( $pro ) {
if ( is_plugin_active( 'accessibility-checker-pro/accessibility-checker-pro.php' ) ) {
return;
}

// Get the value of the 'edac_gaad_notice_dismiss' option and sanitize it.
$dismissed = absint( get_option( 'edac_black_friday_2023_notice_dismiss', 0 ) );

// Check if the notice has been dismissed.
if ( $dismissed ) {
if ( absint( get_option( 'edac_black_friday_2024_notice_dismiss', 0 ) ) ) {
return;
}

// Show from November 20-30.
// Show from November 25 to December 03.
$current_date = date_i18n( 'Ymd' ); // Use date_i18n for localization.
$start_date = '20231120';
$end_date = '20231130';
$start_date = '20241125';
$end_date = '20241203';

if ( $current_date >= $start_date && $current_date <= $end_date ) {

Expand All @@ -131,7 +127,7 @@ public function edac_get_black_friday_message() {
// Construct the promotional message.
$message = '<div class="edac_black_friday_notice notice notice-info is-dismissible">';
$message .= '<p><strong>' . esc_html__( '🎉 Black Friday special! 🎉', 'accessibility-checker' ) . '</strong><br />';
$message .= esc_html__( 'Upgrade to a paid version of Accessibility Checker from November 20-30 and get 40% off! Full site scanning, site-wide open issues report, ignore logs, and more.', 'accessibility-checker' ) . '<br />';
$message .= esc_html__( 'Upgrade to a paid version of Accessibility Checker from November 25th to December 3rd and get 30% off! Full site scanning, site-wide open issues report, ignore logs, and more.', 'accessibility-checker' ) . '<br />';
$message .= '<a class="button button-primary" href="' . esc_url( 'https://my.equalizedigital.com/support/pre-sale-questions/?utm_source=accessibility-checker&utm_medium=software&utm_campaign=BlackFriday' ) . '">' . esc_html__( 'Ask a Pre-Sale Question', 'accessibility-checker' ) . '</a> ';
$message .= '<a class="button button-primary" href="' . esc_url( 'https://equalizedigital.com/accessibility-checker/pricing/?utm_source=WPadmin&utm_medium=banner&utm_campaign=BlackFriday' ) . '">' . esc_html__( 'Upgrade Now', 'accessibility-checker' ) . '</a></p>';
$message .= '</div>';
Expand All @@ -157,7 +153,7 @@ public function edac_black_friday_notice_ajax() {

}

$results = update_option( 'edac_black_friday_2023_notice_dismiss', true );
$results = update_option( 'edac_black_friday_2024_notice_dismiss', true );

if ( ! $results ) {

Expand Down
41 changes: 41 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
Newer versions can be found in readme.txt.

= 1.14.3 =
* Fixed: Allow empty_link rule to detect actually empty links

= 1.14.2 =
* Enhancement: Reduce false positives for underlined text check
* Fixed: Frontend highlighter could not be moved to the right side of the window on mobile
* Fixed: Issue where ignores were not being saved and failing silently

= 1.14.1 =
* Fixed: Prevent settings page layout issue

= 1.14.0 =
* Added: Option to move front-end highlighter to opposite side of the window
* Fixed: Prevent image from overspilling container in issue view
* Fixed: Make empty paragraph check more accurate
* Enhancement: Improved styling for settings page
* Enhancement: Updated summary widget with better semantics
* Enhancement: Improved aria labeling for view on page links
* Enhancement: Added large batch processing capabilities for issue ignoring

= 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
* Fixed: Properly determine possible headings with computed styles
* Improved: Better detection of the underlined text
* Improved: Better detection of small text
* Improved: Better detection of justified text
* Improved: Better detection of blink and marquee tags
* Improved: No longer flagging GTM iframes as missing title since they are display: none and visibility: hidden
* Enhancement: Do not show 'View on page' link to frontend when the issues cannot be viewed

= 1.12.0 =
* Fixed: Use the last generation time in summary widgets rather than last completed scan time
* Improved: More accessible panels in the editor
* Improved: Filter and action docs added/improved

= 1.11.2
* Fixed: Avoid displaying `0th` for readability score
* Removed: Some custom WP Playground detection code
Expand Down
3 changes: 2 additions & 1 deletion includes/rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
TabindexFix,
AddLabelToUnlabelledFormFieldsFix,
CommentSearchLabelFix,
ReadMoreAddTitleFix,
PreventLinksOpeningNewWindowFix,
HTMLLangAndDirFix,
AddMissingOrEmptyPageTitleFix,
Expand Down Expand Up @@ -243,13 +242,15 @@
'slug' => 'link_ms_office_file',
'rule_type' => 'warning',
'summary' => esc_html__( 'A Link to MS Office File warning means that one or more of the links on your page or post directs to a file with one of the following file extensions: .doc, .docx, .xls, .xlsx, .ppt, .pptx, .pps or .ppsx. This warning appears when an MS Office file is present as a reminder to manually test your Word documents, PowerPoint presentations, and Excel spreadsheets for accessibility and to confirm that they conform to all relevant WCAG guidelines. To resolve a Link to MS Office File warning, you need to: (1) ensure a direct link to view or download the document is present if you\'re using a plugin to embed it on the page; (2) ensure the link to the document warns users it is a link to a document by displaying the specific file extension in the link anchor; and (3) test and remediate your MS Office file for accessibility errors. After determining your file is fully accessible, you can safely “Ignore” the warning.', 'accessibility-checker' ),
'ruleset' => 'js',
],
[
'title' => esc_html__( 'Link to PDF', 'accessibility-checker' ),
'info_url' => 'https://a11ychecker.com/help1972',
'slug' => 'link_pdf',
'rule_type' => 'warning',
'summary' => esc_html__( 'A Link to PDF warning means that one or more of the links on your page or post directs to a PDF file. This warning is a reminder to manually test the linked PDF for accessibility and to confirm that it conforms to all relevant WCAG guidelines. To resolve a Link to PDF warning, you need to: (1) ensure a direct link to view or download the document is present if you\'re using a plugin to embed it on the page; (2) ensure the link to the document warns users it is a link to a document by displaying the specific file extension in the link anchor; and (3) test and remediate your document for accessibility errors. After determining your file is fully accessible, you can safely “Ignore” the warning.', 'accessibility-checker' ),
'ruleset' => 'js',
],
[
'title' => esc_html__( 'Link to Non-HTML File', 'accessibility-checker' ),
Expand Down
44 changes: 0 additions & 44 deletions includes/rules/link_ms_office_file.php

This file was deleted.

32 changes: 0 additions & 32 deletions includes/rules/link_pdf.php

This file was deleted.

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.16.1",
"version": "1.16.2",
"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
59 changes: 13 additions & 46 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: equalizedigital, alh0319, stevejonesdev
Tags: accessibility, accessible, wcag, ada, WP accessibility
Requires at least: 6.2
Tested up to: 6.7.0
Stable tag: 1.16.1
Stable tag: 1.16.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= 1.16.2 =

* Enhancement: Use better names for fix modal titles.
* Enhancement: Improve the link_pdf rule to detect more accurately.
* Enhancement: Improve the link_ms_office_doc rule to detect more accurately.
* Fixed: Rely on labels for link_ambiguous_text rule first before checking just the text content.
* Fixed: Remove a duplicatable rule empty_form_label.

= 1.16.1 =
* Fix: Remove redundant empty_form_label rule definition.
* Fixed: Remove redundant empty_form_label rule definition.

= 1.16.0 =
* New: Introduced a system to handle automated fixes for issues that the scanner would discover.
Expand All @@ -191,9 +199,9 @@ No, Accessibility Checker runs completely on your server and does not require yo
* Enhancement: Improve the document title check to check on fully rendered pages.
* Enhancement: Add a clear button to the editor to allow for .
* Enhancement: Improved GTM iframe detection.
* Fix: Avoid showing 100% passed results when scans are not complete.
* Fix: Improve or add better aria-labels in several places.
* Fix: Don't flag empty paragraphs if they have aria-hidden.
* Fixed: Avoid showing 100% passed results when scans are not complete.
* Fixed: Improve or add better aria-labels in several places.
* Fixed: Don't flag empty paragraphs if they have aria-hidden.

= 1.15.3 =
* Enhancement: Detect missing labels on more elements.
Expand All @@ -214,46 +222,5 @@ No, Accessibility Checker runs completely on your server and does not require yo
* Fixed: Handle stacking contexts for callout button in admin correctly
* Fixed: PHP 8.4 deprecation notice fix for implicitly nullable Meta_Boxes

= 1.14.3 =
* Fixed: Allow empty_link rule to detect actually empty links

= 1.14.2 =
* Enhancement: Reduce false positives for underlined text check
* Fixed: Frontend highlighter could not be moved to the right side of the window on mobile
* Fixed: Issue where ignores were not being saved and failing silently

= 1.14.1 =
* Fixed: Prevent settings page layout issue

= 1.14.0 =
* Added: Option to move front-end highlighter to opposite side of the window
* Fixed: Prevent image from overspilling container in issue view
* Fixed: Make empty paragraph check more accurate
* Enhancement: Improved styling for settings page
* Enhancement: Updated summary widget with better semantics
* Enhancement: Improved aria labeling for view on page links
* Enhancement: Added large batch processing capabilities for issue ignoring

= 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
* Fixed: Properly determine possible headings with computed styles
* Improved: Better detection of the underlined text
* Improved: Better detection of small text
* Improved: Better detection of justified text
* Improved: Better detection of blink and marquee tags
* Improved: No longer flagging GTM iframes as missing title since they are display: none and visibility: hidden
* Enhancement: Do not show 'View on page' link to frontend when the issues cannot be viewed

= 1.12.0 =
* Fixed: Use the last generation time in summary widgets rather than last completed scan time
* Improved: More accessible panels in the editor
* Improved: Filter and action docs added/improved

Older versions can be found in the plugins `changelog.txt`.

9 changes: 8 additions & 1 deletion src/admin/summary/summary-tab-input-event-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,16 @@ export const initFixButtonEventHandlers = () => {
fixSettings.classList.toggle( 'active' );
document.querySelector( 'body' ).classList.add( 'edac-fix-modal-present' );

// try to find a fancy name for the modal
const fancyNameEl = fixSettings.querySelector( '[data-fancy-name]' );
let modalTitle = __( 'Fix Settings', 'accessibility-checker' );
if ( fancyNameEl && fancyNameEl.getAttribute( 'data-fancy-name' ).length > 0 ) {
modalTitle = fancyNameEl.getAttribute( 'data-fancy-name' );
}

// trigger a thickbox that contains the contents of the fixSettings
// eslint-disable-next-line no-undef
tb_show( __( 'Fix Settings', 'accessibility-checker' ), '#TB_inline?width=750&inlineId=' + fixSettings.id );
tb_show( modalTitle, '#TB_inline?width=750&inlineId=' + fixSettings.id );

const thickbox = document.getElementById( 'TB_window' );
thickbox.querySelector( '[aria-live]' ).innerText = '';
Expand Down
9 changes: 4 additions & 5 deletions src/pageScanner/checks/has-ambiguous-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ const checkAmbiguousPhrase = ( text ) => {
export default {
id: 'has_ambiguous_text',
evaluate: ( node ) => {
const textContent = node.textContent;
if ( checkAmbiguousPhrase( textContent ) ) {
return true;
}

if ( node.hasAttribute( 'aria-label' ) ) {
const ariaLabel = node.getAttribute( 'aria-label' );
return checkAmbiguousPhrase( ariaLabel );
Expand All @@ -49,6 +44,10 @@ export default {
return checkAmbiguousPhrase( labelText );
}

if ( node.textContent && node.textContent !== '' ) {
return checkAmbiguousPhrase( node.textContent );
}

const images = node.querySelectorAll( 'img' );
for ( const image of images ) {
const altText = image.getAttribute( 'alt' );
Expand Down
10 changes: 8 additions & 2 deletions src/pageScanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ import brokenAnchorLink from './rules/broken-anchor-link';
import anchorExists from './checks/anchor-exists';
import labelExtended from './rules/extended/label';
import imageInputHasAlt from './checks/image-input-has-alt';
import linkPDF from './rules/link-pdf';
import linkMsOfficeFile from './rules/link-ms-office-file';

//TODO: examples:
//import customRule1 from './rules/custom-rule-1';
//import alwaysFail from './checks/always-fail';
import alwaysFail from './checks/always-fail';

//TODO:
//see: https://github.com/dequelabs/axe-core/blob/develop/doc/developer-guide.md#api-reference
Expand Down Expand Up @@ -62,11 +64,13 @@ const scan = async (
textJustified,
linkTargetBlank,
linkAmbiguousText,
linkPDF,
linkMsOfficeFile,
brokenAnchorLink,
labelExtended,
],
checks: [
//alwaysFail,
alwaysFail,
elementIsAUTag,
elementWithUnderline,
paragraphStyledAsHeader,
Expand Down Expand Up @@ -101,6 +105,8 @@ const scan = async (
textJustified.id,
linkTargetBlank.id,
linkAmbiguousText.id,
linkPDF.id,
linkMsOfficeFile.id,
brokenAnchorLink.id,
labelExtended.id,
],
Expand Down
Loading

0 comments on commit 7443360

Please sign in to comment.