Improve Accessibility and Functionality - #2598
Conversation
Add `rel="noopener"` attribute to all links with `target="_blank"` to prevent security vulnerabilities. Add aria-labels to buttons and links to improve screen reader support. Update wp_kses allowed attributes to include the 'rel' attribute where external links are used.
|
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. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## trunk #2598 +/- ##
==========================================
- Coverage 70.35% 70.30% -0.06%
==========================================
Files 91 91
Lines 7867 7876 +9
==========================================
+ Hits 5535 5537 +2
- Misses 2332 2339 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Thanks @murshed for the PR!
The changes look solid to me.
Summary
Addresses accessibility and security improvements across Performance Lab plugins.
This PR improves screen reader accessibility on the Performance Lab admin screen (WCAG 2.4.4 Link Purpose) by providing contextual
aria-labelattributes for action links and buttons. It also enforces security best practices by addingrel="noopener"to external links opening in new tabs (target="_blank").Relevant technical choices
performance-lab): Added descriptivearia-labelattributes to plugin card actions inperflab_render_plugin_card()(e.g.,Activate {Plugin Name},Settings for {Plugin Name},{Plugin Name} is active) so screen reader users hear contextual labels instead of repetitive link text.target="_blank" rel="noopener"): Addedrel="noopener"to all external links opening in a new tab acrossperformance-lab,speculation-rules,embed-optimizer,optimization-detective, andsite-healthaudit helpers to prevent reverse-tabnabbing security risks.wp_kses()allowed attributes arrays (such as inspeculation-rules/settings.php) to permit'rel' => array()on anchor tags.