Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
a3d0cff
Fix: normalize FK grade values in (0,1) to 1 instead of collapsing to 0
SteveJonesDev May 28, 2026
dfa89d2
Fix: handle false/null from TextStatistics in edac_normalize_fk_grade
pattonwebz Jun 27, 2026
e616ede
chore: use x.x.x placeholder for @since tags on new function
pattonwebz Jun 27, 2026
a877530
Add @since placeholder update tool
pattonwebz Jun 27, 2026
1fb7859
Update release prep flow for @since sync and tag checks
pattonwebz Jun 27, 2026
4c1dfeb
Fix PHPCS issues in since-tag update tool
pattonwebz Jun 27, 2026
9eb48e0
Address code review feedback on @since tool and release script
pattonwebz Jun 27, 2026
84273c4
Tests: add Jest coverage for 6 scanner rules missing tests
pattonwebz Jun 27, 2026
231b13a
Tests: replace stub color contrast tests with real violation coverage
pattonwebz Jun 27, 2026
8acb930
Tests: simplify color contrast tests to rule config assertions only
pattonwebz Jun 27, 2026
a795a56
Tests: add missing image input alt edge cases to label tests
pattonwebz Jun 27, 2026
9e75891
Tests: address code review feedback on four test files
pattonwebz Jun 27, 2026
cc86fc0
Tests: add runtime smoke test to colorContrastFailure suite
pattonwebz Jun 27, 2026
190fc50
Fix: exclude core cover block elements from aria-hidden rule (PRO-966)
pattonwebz Jun 27, 2026
69359fa
Refactor: move spacer and separator exclusions from check to selector
pattonwebz Jun 27, 2026
7d62afe
Tests: add cover block before/after cases for PRO-966 aria-hidden fix
pattonwebz Jun 27, 2026
c442c9f
Tests: remove regression describe block, keep cover block passing cases
pattonwebz Jun 27, 2026
3f2c47a
Fix: narrow cover block selector exclusion to specific decorative cla…
pattonwebz Jun 27, 2026
909f8d6
Tests: address self-review findings on PR #1800
pattonwebz Jun 27, 2026
4976da4
docs: regenerate hooks docs
github-actions[bot] Jun 29, 2026
5349658
Merge pull request #1813 from equalizedigital/release/1.45.0
pattonwebz Jun 30, 2026
d9e4de8
fix: strip leading v from release tag before using as SVN version
pattonwebz Jun 30, 2026
ecc14b9
Merge pull request #1814 from equalizedigital/william/no-issue/strip-…
pattonwebz Jun 30, 2026
50b4b93
fix: show success icon in Accessibility Analysis panel when no issues…
SteveJonesDev Jul 1, 2026
e8fd5e1
refactor: drop redundant null initializer for iconName
SteveJonesDev Jul 1, 2026
8a91ec6
fix: add missing @wordpress jest module resolutions for IssueImage an…
SteveJonesDev Jul 1, 2026
a405947
fix: anchor @wordpress/components moduleNameMapper regex to prevent s…
SteveJonesDev Jul 1, 2026
27c4c59
Merge pull request #1815 from equalizedigital/fix/no-issue-1807-succe…
SteveJonesDev Jul 1, 2026
38c3c23
fix: don't flag .ogg audio as video content in video_present rule
pattonwebz Jul 2, 2026
e770024
perf: hoist string/DOM lookups out of the videoExtensions loop
pattonwebz Jul 2, 2026
27f4ce6
Fix settings page logo/heading overlap on RTL sites
claude Jul 5, 2026
e183be9
Fix RTL logo overlap via grid columns instead of forcing LTR
claude Jul 5, 2026
3e65840
fix: convey summary status in Reading Level card accessible name
claude Jul 5, 2026
8ce633e
fix: use accurate accessible name for settings navigation landmark
SteveJonesDev Jul 5, 2026
36f7c0d
fix: use "Accessibility Checker Settings" per maintainer feedback
SteveJonesDev Jul 5, 2026
7e09d1f
fix: make settings nav landmark aria-label translatable
SteveJonesDev Jul 5, 2026
cf46ebb
Merge pull request #1822 from equalizedigital/steve/pro-975-navigatio…
SteveJonesDev Jul 5, 2026
52bea85
Merge pull request #1820 from equalizedigital/steve/pro-996-reading-l…
SteveJonesDev Jul 5, 2026
35c2840
fix: adjust text alignment for RTL layout in settings page logo
SteveJonesDev Jul 5, 2026
16f8ce3
Merge pull request #1819 from equalizedigital/steve/pro-1124-settings…
SteveJonesDev Jul 5, 2026
4d20097
Merge pull request #1806 from equalizedigital/automation/regenerate-h…
SteveJonesDev Jul 5, 2026
af25621
Fix incorrect heading order summary to not claim specific heading levels
claude Jul 6, 2026
0c5c998
Merge pull request #1825 from equalizedigital/steve/pro-667-heading-o…
SteveJonesDev Jul 6, 2026
15d59c6
docs: regenerate hooks docs
github-actions[bot] Jul 6, 2026
35b5b92
chore: update plugin URI to equalizedigital.com
pattonwebz Jul 7, 2026
456dedd
chore: point plugin URI at the accessibility-checker page
pattonwebz Jul 7, 2026
5f7dade
Merge pull request #1817 from equalizedigital/william/pro-1168-audio-…
pattonwebz Jul 8, 2026
e5154f6
Merge pull request #1801 from equalizedigital/william/pro-966-exclude…
pattonwebz Jul 8, 2026
137f04c
Merge pull request #1725 from equalizedigital/steve/pro-626-bug-fk-re…
pattonwebz Jul 8, 2026
881b1ab
Merge pull request #1798 from equalizedigital/william/no-issue/add-si…
pattonwebz Jul 8, 2026
5b8bc93
Merge pull request #1800 from equalizedigital/william/pro-806-add-jes…
pattonwebz Jul 8, 2026
ba51df7
Merge pull request #1827 from equalizedigital/william/no-issue/update…
pattonwebz Jul 8, 2026
f3051be
Update POT translation file
pattonwebz Jul 8, 2026
a07b993
Merge pull request #1828 from equalizedigital/update-translations/dev…
pattonwebz Jul 8, 2026
ee7e747
Merge pull request #1826 from equalizedigital/automation/regenerate-h…
pattonwebz Jul 8, 2026
5e1c4c3
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
beb4908
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
5bba7e1
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
4fb4c5b
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
10e689e
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
7e4fc0e
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
f14c732
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
99a512e
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
579a4e5
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
9e20c2e
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
3f8c2c4
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
04b7943
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
40e8294
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
0d045f9
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
2292fae
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
e938ed2
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
fc8aa76
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
2d26fb9
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
c400c97
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
dac3d97
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
7a6c596
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
d854078
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
f988702
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
fa82117
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
68730af
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
590b22e
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
7827249
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
c136b31
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
6dbd780
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
7f4d440
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
677cf2e
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
acb2c67
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
64b2a93
PTC accessibility-checker (1985): Automatic Translations July 08, 202…
Jul 8, 2026
8cf9fd0
Merge pull request #1829 from equalizedigital/ptc_1985_automatic_tran…
pattonwebz Jul 8, 2026
7450eea
Bump version * Version: 1.45.0 -> 1.46.0
pattonwebz Jul 8, 2026
0f660e2
Update @since placeholders to 1.46.0
pattonwebz Jul 8, 2026
14fa77e
Add 1.46.0 changelog to readme.txt and changelog.txt
pattonwebz Jul 8, 2026
b5e9bdc
Fix truncated 1.45.0 changelog line in changelog.txt
pattonwebz Jul 8, 2026
ab7e2ff
Replace mapfile -d with a Bash 3.2-compatible read loop
pattonwebz Jul 8, 2026
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
8 changes: 7 additions & 1 deletion .github/workflows/deploy-on-release-to-dot-org.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,17 @@ jobs:
npm run dist:dotorg
echo "::set-output name=zip-path::./dist/${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip"

- name: Normalize release version for SVN tag
id: normalize-version
run: |
TAG="${{ github.event.release.tag_name }}"
echo "version=${TAG#v}" >> "$GITHUB_OUTPUT"

- name: WordPress plugin deploy
id: deploy
uses: 10up/action-wordpress-plugin-deploy@stable
env:
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
BUILD_DIR: ./dist/${{ github.event.repository.name }}/
VERSION: ${{ github.event.release.tag_name }}
VERSION: ${{ steps.normalize-version.outputs.version }}
6 changes: 3 additions & 3 deletions accessibility-checker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*
* @wordpress-plugin
* Plugin Name: Accessibility Checker
* Plugin URI: https://a11ychecker.com
* Plugin URI: https://equalizedigital.com/accessibility-checker
* Description: Audit and check your website for accessibility before you hit publish. In-post accessibility scanner and guidance.
* Version: 1.45.0
* Version: 1.46.0
* Requires PHP: 7.4
* Author: Equalize Digital
* Author URI: https://equalizedigital.com
Expand All @@ -36,7 +36,7 @@

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

// Current database version.
Expand Down
4 changes: 2 additions & 2 deletions admin/class-ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function summary() {
$simplified_summary_grade = 0;
if ( class_exists( 'DaveChild\TextStatistics\TextStatistics' ) ) {
$text_statistics = new \DaveChild\TextStatistics\TextStatistics();
$simplified_summary_grade = (int) floor( $text_statistics->fleschKincaidGradeLevel( $simplified_summary ) );
$simplified_summary_grade = edac_normalize_fk_grade( $text_statistics->fleschKincaidGradeLevel( $simplified_summary ) );
}
$simplified_summary_grade_failed = ( $simplified_summary_grade > 9 ) ? true : false;

Expand Down Expand Up @@ -671,7 +671,7 @@ public function readability() {
$simplified_summary_grade = 0;
if ( class_exists( 'DaveChild\TextStatistics\TextStatistics' ) ) {
$text_statistics = new \DaveChild\TextStatistics\TextStatistics();
$simplified_summary_grade = (int) floor( $text_statistics->fleschKincaidGradeLevel( $simplified_summary ) );
$simplified_summary_grade = edac_normalize_fk_grade( $text_statistics->fleschKincaidGradeLevel( $simplified_summary ) );
}

$simplified_summary_grade_failed = ( $simplified_summary_grade > 9 ) ? true : false;
Expand Down
13 changes: 12 additions & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
*** Accessibility Checker ***

2026-07-08 - version 1.46.0
* Updated - the aria-hidden rule no longer flags core Cover blocks.
* Updated - the Incorrect Heading Order summary no longer claims specific heading levels that may not match the actual issue.
* Updated - more strings translated into other languages.
* Fix - .ogg audio files are no longer treated as video content by the video checks.
* Fix - reading level grades between 0 and 1 are now rounded up to grade 1 instead of being treated as not calculable.
* Fix - Accessibility Analysis panel now shows a success icon when no issues are found.
* Fix - Reading Level summary card now conveys its status to screen readers.
* Fix - corrected the accessible name on the settings page navigation landmark.
* Fix - settings page logo now displays correctly on right-to-left site languages.

2026-06-30 - version 1.45.0
* Updated - default dismiss reasons are now reordered so first item is confirmed accessible.
* New - added filter edac_dismiss_reasons to allow adding or removing dismiss reasons.
* Fix - keep focus well positioned when c
* Fix - keep focus well positioned when clearing dismiss notice.

2026-06-23 - version 1.44.1
* Updated - improved the dismiss panel screen reader announcements.
Expand Down
7 changes: 5 additions & 2 deletions docs/hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This document is auto-generated by `tools/generate-hooks-docs.php`. It lists onl
| ---- | ---- | ---- | ---- | ----------- | ----- |
| `edac_action_enqueue_frontend_fixes` | action | [includes/classes/Fixes/FixesManager.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/Fixes/FixesManager.php#L120) | 120 | Maybe enqueue the frontend scripts. | |
| `edac_admin_toolbar_menu_items` | filter | [includes/classes/class-admin-toolbar.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/class-admin-toolbar.php#L77) | 77 | Filters the admin toolbar menu items for Accessibility Checker. | 1.27.0 |
| `edac_after_ignore_change` | action | [includes/classes/class-rest-api.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/class-rest-api.php#L1345) | 1345 | Fires after an ignore state change succeeds. | |
| `edac_after_meta_box` | action | [admin/class-meta-boxes.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-meta-boxes.php#L77) | 77 | Fires after the meta box is rendered. | 1.10.0 |
| `edac_after_rule` | action | [includes/classes/class-rest-api.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/class-rest-api.php#L568) | 568 | Fires after a rule is run against the content. | 1.5.0 |
| `edac_after_validate` | action | [includes/classes/class-rest-api.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/class-rest-api.php#L584) | 584 | Fires after the validation process is complete. | 1.5.0 |
Expand All @@ -15,6 +16,7 @@ This document is auto-generated by `tools/generate-hooks-docs.php`. It lists onl
| `edac_before_validate` | action | [includes/classes/class-rest-api.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/class-rest-api.php#L501) | 501 | Fires before the validation process starts. | 1.5.0 |
| `edac_check_license_hook` | action | [includes/classes/MyDot/Connector.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/MyDot/Connector.php#L154) | 154 | Sets up the license page and handlers. | 1.xx.x |
| `edac_debug_information` | filter | [admin/site-health/class-information.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/site-health/class-information.php#L79) | 79 | Filter the debug information. | 1.6.10 |
| `edac_dismiss_reasons` | filter | [admin/class-ignore-ui.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-ignore-ui.php#L64) | 64 | Filters the dismiss reasons available in the ignore/dismiss panel. | 1.xx.x |
| `edac_filter_admin_scripts_slugs` | filter | [admin/class-enqueue-admin.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-enqueue-admin.php#L58) | 58 | Enqueue the admin and editorApp scripts. | |
| `edac_filter_command_classes` | filter | [includes/classes/WPCLI/BootstrapCLI.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/WPCLI/BootstrapCLI.php#L83) | 83 | Filter the list of classes that hold the commands to be registered. | 1.15.0 |
| `edac_filter_dashboard_widget_capability` | filter | [admin/class-helpers.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-helpers.php#L229) | 229 | Filter the capability required to view the dashboard widget. | 1.9.3 |
Expand All @@ -36,14 +38,15 @@ This document is auto-generated by `tools/generate-hooks-docs.php`. It lists onl
| `edac_filter_simplified_summary_heading` | filter | [includes/classes/class-simplified-summary.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/class-simplified-summary.php#L75) | 75 | Filter the heading that gets output before the simplified summary inside an <h2> tag. | 1.4.0 |
| `edac_fix_underline_target` | filter | [includes/classes/Fixes/Fix/LinkUnderline.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/Fixes/Fix/LinkUnderline.php#L118) | 118 | Filters the target element selector for forcing underlines. | 1.16.0 |
| `edac_free_product_id` | filter | [includes/classes/MyDot/Connector.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/MyDot/Connector.php#L144) | 144 | Sets up the license page and handlers. | 1.xx.x |
| `edac_get_origin_url_for_virtual_page` | filter | [admin/class-enqueue-admin.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-enqueue-admin.php#L118) | 118 | Enqueue the admin and editorApp scripts. | |
| `edac_get_origin_url_for_virtual_page` | filter | [admin/class-enqueue-admin.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-enqueue-admin.php#L120) | 120 | Enqueue the admin and editorApp scripts. | |
| `edac_ignore_permission` | filter | [admin/class-ajax.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-ajax.php#L326) | 326 | Filters if a user can ignore issues. | 1.4.0 |
| `edac_is_sale_time` | filter | [admin/class-upgrade-promotion.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-upgrade-promotion.php#L207) | 207 | Filter whether it's currently sale time for upgrade promotions. | 1.27.0 |
| `edac_jwt_audience` | filter | [includes/classes/MyDot/Connector.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/MyDot/Connector.php#L925) | 925 | Get the expected audience for JWT validation (RFC 8725). | 1.xx.x |
| `edac_jwt_issuer` | filter | [includes/classes/MyDot/Connector.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/MyDot/Connector.php#L913) | 913 | Get the expected issuer for JWT validation (RFC 8725). | 1.xx.x |
| `edac_landmark_types` | filter | [includes/helper-functions.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/helper-functions.php#L868) | 868 | Filter the landmark types used by the scanner and Issues Explorer filter. | 1.44.0 |
| `edac_link_wrapper_mock` | filter | [tests/phpunit/Admin/PluginRowMetaTest.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/tests/phpunit/Admin/PluginRowMetaTest.php#L57) | 57 | Wrapper function that delegates to mock in test mode. | |
| `edac_link_wrapper_test_mode` | filter | [tests/phpunit/Admin/PluginRowMetaTest.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/tests/phpunit/Admin/PluginRowMetaTest.php#L56) | 56 | Wrapper function that delegates to mock in test mode. | |
| `edac_max_alt_length` | filter | [admin/class-enqueue-admin.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-enqueue-admin.php#L144) | 144 | Enqueue the admin and editorApp scripts. | |
| `edac_max_alt_length` | filter | [admin/class-enqueue-admin.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/admin/class-enqueue-admin.php#L146) | 146 | Enqueue the admin and editorApp scripts. | |
| `edac_mydot_api_endpoint` | filter | [includes/classes/MyDot/Connector.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/MyDot/Connector.php#L528) | 528 | Filters the MyDot API endpoint URL. | 1.xx.x |
| `edac_mydot_product_id` | filter | [includes/classes/MyDot/Connector.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/MyDot/Connector.php#L548) | 548 | Filters the MyDot product ID. | 1.xx.x |
| `edac_pro_product_id` | filter | [includes/classes/MyDot/Connector.php](https://github.com/equalizedigital/accessibility-checker/blob/develop/includes/classes/MyDot/Connector.php#L1302) | 1302 | Infer license metadata from an EDD response. | 1.xx.x |
Expand Down
7 changes: 1 addition & 6 deletions includes/classes/Rules/Rule/IncorrectHeadingOrderRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ public static function get_rule(): array {
'info_url' => 'https://a11ychecker.com/help1940',
'slug' => 'incorrect_heading_order',
'rule_type' => 'error',
'summary' => sprintf(
// translators: %1$s is the found heading level (e.g., <h3>), %2$s is the previous heading level (e.g., <h1>.
esc_html__( 'This page uses headings out of order. This is an %1$s after an %2$s, skipping one or more heading levels.', 'accessibility-checker' ),
'<code>&lt;h3&gt;</code>',
'<code>&lt;h1&gt;</code>'
),
'summary' => esc_html__( 'This page uses headings out of order, skipping one or more heading levels.', 'accessibility-checker' ),
'summary_plural' => sprintf(
// translators: %1$s is <code>&lt;h1&gt;</code>, %2$s is <code>&lt;h3&gt;</code>, %3$s is <code>&lt;h2&gt;</code.
esc_html__( 'These pages use headings out of order, skipping one or more heading levels, such as going from %1$s to %2$s without an %3$s between.', 'accessibility-checker' ),
Expand Down
2 changes: 1 addition & 1 deletion includes/classes/class-rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ private function get_readability_data( $post_id ) {
$simplified_summary_grade = 0;
if ( class_exists( 'DaveChild\TextStatistics\TextStatistics' ) ) {
$text_statistics = new \DaveChild\TextStatistics\TextStatistics();
$simplified_summary_grade = (int) floor( $text_statistics->fleschKincaidGradeLevel( $simplified_summary ) );
$simplified_summary_grade = edac_normalize_fk_grade( $text_statistics->fleschKincaidGradeLevel( $simplified_summary ) );
}

$simplified_summary_grade_failed = $simplified_summary_grade >= 9;
Expand Down
4 changes: 1 addition & 3 deletions includes/classes/class-summary-generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,7 @@ private function calculate_content_grade() {
$content_grade = 0;

if ( class_exists( 'DaveChild\TextStatistics\TextStatistics' ) ) {
$content_grade = floor(
( new \DaveChild\TextStatistics\TextStatistics() )->fleschKincaidGradeLevel( $content )
);
$content_grade = edac_normalize_fk_grade( ( new \DaveChild\TextStatistics\TextStatistics() )->fleschKincaidGradeLevel( $content ) );
}

return (int) round( $content_grade );
Expand Down
21 changes: 21 additions & 0 deletions includes/helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,27 @@ function edac_format_datetime_from_utc( string $utc_datetime ): string {
return wp_date( $format, $timestamp );
}

/**
* Normalize a raw Flesch-Kincaid grade level float to a whole-number grade.
*
* `floor()` alone collapses any FK value in (0, 1) to 0, which misrepresents
* very simple content as "not calculable." Values above 0 but below 1 are
* normalized to 1 so that compliance checks treat them correctly.
*
* @since 1.46.0
*
* @param float|bool|null $fk_grade Raw Flesch-Kincaid grade level returned by the library.
* @return int Normalized grade: 0 when the library returned 0, false, or null (not enough content),
* otherwise max(1, floor($fk_grade)).
*/
function edac_normalize_fk_grade( $fk_grade ): int {
$fk_grade = (float) $fk_grade;
if ( $fk_grade <= 0 ) {
return 0;
}
return max( 1, (int) floor( $fk_grade ) );
}

/**
* Determine the icon name to display for the readability panel.
*
Expand Down
Loading
Loading