Improve admin UI accessibility - #1420
Conversation
Enhance accessibility throughout the plugin check admin interface: - Add screen reader announcements for check status (starting, success, errors) - Improve CSS for screen-reader-text with clip-path and white-space - Use semantic HTML: convert table header <td> to <th scope="col"> - Fix legend text to display labels instead of IDs for better context - Correct escaping functions: esc_html_e() instead of esc_attr_e() for headings - Use textContent instead of innerText in JS for better practice - Add wp-a11y dependency for ARIA live regions - Remove duplicate spinner element - Improve html_entity_decode() with proper flags
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Thanks to Codex’s review, I noticed that the final screen-reader announcement reports only the runtime cleanup status (for example, “Runtime environment cleanup successful”). This does not tell users whether the checks found errors or warnings. Could we announce the summary generated by |
Enhance accessibility throughout the plugin check admin interface:
What?
This PR improves accessibility (WCAG compliance), HTML standards, screen reader notifications, and PHP 8+ compatibility across the Plugin Check admin UI and core libraries.
Why?
#plugin-check__spinner), unlocalized raw slug text in<legend>tags, and incorrect escaping functions (esc_attr_e()instead ofesc_html_e()).<thead>used non-semantic<td>cells rather than<th scope="col">cells.clipproperties without modernclip-path: inset(50%)andwhite-space: nowrap.innerTextinstead oftextContent, causing unnecessary browser style recalculations and reflows.html_entity_decode()inParser.phpwas missing explicit$flags, triggering PHP 8.1+ default parameter deprecation issues.How?
ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401flags tohtml_entity_decode()inincludes/Lib/Readme/Parser.php.plugin-check__spinnerelement intemplates/admin-page.php.<h4>tags to useesc_html_e().<legend>screen-reader text to display human-readable labels ($label) instead of raw slugs.<thead>cells from<td>to<th scope="col">intemplates/results-table.php.'wp-a11y'dependency toplugin-check-adminscript registration inincludes/Admin/Admin_Page.php.wp.a11y.speak()notifications inassets/js/plugin-check-admin.jsfor check startup, execution summary, and error reporting.innerText = ''withtextContent = ''for clearing results containers.assets/css/plugin-check-admin.csswithclip-path: inset(50%)andwhite-space: nowrap.Testing Instructions
<thead>cells use<th scope="col">.#plugin-check__spinnerIDs exist on the page.vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 8.0-8.5and verify 0 compatibility errors.vendor/bin/phpcsandvendor/bin/phpstan analyseto verify linting and static analysis pass cleanly.AI Usage Disclosure
If AI tools were used, please describe how they were used:
Used AI coding agent to perform static analysis auditing for PHP 8+ compatibility, WCAG accessibility standards adherence, and automated linting verification.
Screenshots or screencast