Fix invalid aria-label on SMTP page install/activate link - #3496
vivi-the-going-merry[bot] wants to merge 2 commits into
Conversation
The "Install"/"Activate WP Mail SMTP" <a> on the SMTP settings admin
page has no href, so it takes the implicit ARIA role "generic" -
which doesn't support aria-label per the aria_attribute_valid rule.
The link's visible text ("Install WP Mail SMTP" / "Activate WP Mail
SMTP") already conveys its purpose, so the attribute (and the
button_action value that only ever fed it) is removed rather than
given a role.
Verified with IBM's accessibility-checker CLI against the real
rendered admin page (formidable-preview-env): the aria_attribute_valid
violation on this element is gone after the fix, with no change to
any other violation.
Fixes Strategy11/formidable-pro#6759
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Repository: Strategy11/formidable-forms/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Diagnosis and fix verified directly, not just trusted from the description. FrmSMTPController::output_section_step_install()'s anchor has no href/role, so it does take the implicit ARIA-in-HTML role "generic" (confirmed live — see accessibility-tree snapshot below), on which aria-label is invalid; removing it plus the now-dead button_action PHP value is the correct, complete fix, applied uniformly across all three get_data_step_install() branches (not-installed / needs-activation / installed-and-activated).
Live-verified on the "not installed" branch (only one reachable in this sandbox — no network path here to actually install WP Mail SMTP for the other two states, so those are source-verified only: same three-line pattern, same class list, same missing role):
<a rel="https://downloads.wordpress.org/plugin/wp-mail-smtp.zip" class="button button-primary frm-button-primary frm-install-addon">Install WP Mail SMTP</a>Playwright's own accessibility snapshot resolves this element as generic, matching the PR's stated diagnosis exactly (not just the markup, the actual computed role):
Non-blocking — same bug, unpatched sibling instance: classes/helpers/FrmFormMigratorsHelper.php:168, install_button()'s not-installed branch, renders the identical shape — <a class="frm-install-addon ..." aria-label="<?php esc_attr_e( 'Install', ... ); ?>">, no href, no role — called live from two sites (FrmFormMigratorsHelper.php:35 and :136). Same aria_attribute_valid violation this PR fixes, just in the form-migrators "Get Started"/import UI instead of the SMTP page. Worth a follow-up fix (or extending this PR), not blocking this one.
Approved — the cited fix is correct and complete for its own stated scope.
Same aria_attribute_valid violation as the SMTP page fix in this PR,
flagged as a non-blocking sibling instance during review:
FrmFormMigratorsHelper::install_button()'s not-installed branch renders
an <a> with no href/role and an aria-label, which is invalid for its
implicit "generic" role. The button's own visible text ("Get Started" /
"Install <Name> Importer") already conveys purpose.
Verified with IBM's accessibility-checker CLI against the rendered
markup directly (install_button() invoked via reflection, both
installed/not-installed branches): aria_attribute_valid violation count
drops from 1 to 0 with no other rule's count changing.
|
Method: in-place push |
|
Fixed the non-blocking sibling instance too: FrmFormMigratorsHelper.php:168, same aria-label-on-a-generic-role-anchor pattern, in cffd748. Verified via accessibility-checker CLI against install_button() rendered directly (both installed/not-installed branches) — aria_attribute_valid drops from 1 to 0, no other rule count changed. |
There was a problem hiding this comment.
Re-reviewed at the current head — the non-blocking sibling instance flagged in the prior approval (FrmFormMigratorsHelper.php:168) is now fixed in the same PR (cffd748e2), removing the identical invalid aria-label from install_button()'s not-installed branch. Structurally identical to the SMTP fix already approved: no href/role on the anchor, so it takes the implicit "generic" role, on which aria-label is invalid; the button's own visible text still conveys purpose, so no accessible-name regression.
This specific instance is source-verified only, not exercised in a live render — install_button()'s not-installed branch only renders when a source plugin (Gravity Forms/Pirate Forms/etc.) is active but its Formidable importer isn't yet installed, a dependency this sandbox doesn't have set up. Verification: diffed the exact markup shape against the already-verified SMTP instance (identical anchor structure, same missing href/role), plus a repo-wide grep for any other sibling of the same shape — none found. The two other aria-label hits in the repo are a different, non-matching shape: FrmAddonsController.php:1803 has a real href so takes role link (aria-label is valid there), and FrmSolution.php:302 is an <svg> icon using the standard accessible-icon pattern.
code-review skill re-run clean against the full current diff (both commits) — no findings.
CI: Stylelint is red, but on resources/scss/admin/components/settings/_misc-components.scss, a file this diff never touches — pre-existing repo debt, not this PR's fault. Every other check is green.
Approved.

What was broken
IBM Equal Access flagged
aria_attribute_validonce on the SMTP settings admin page (Formidable > SMTP). The "Install"/"Activate WP Mail SMTP"<a>inFrmSMTPController::output_section_step_install()has nohref(it's driven entirely by a JS click handler via thefrm-install-addon/frm-activate-addonclasses), so per ARIA-in-HTML it takes the implicit role "generic" — andaria-labelisn't a valid attribute for that role.This is a distinct instance from #6701 (fixed by #3373, an
aria-selectedissue on the payment settings tab, unrelated element) — not a re-appearance of that fix failing to hold.What changed
Removed the
aria-labelattribute from the element. The link's own visible text ("Install WP Mail SMTP" / "Activate WP Mail SMTP" / "WP Mail SMTP Installed & Activated") already conveys its purpose, so no replacement label is needed. Also removed$step['button_action'], the PHP value that only ever fed that now-removed attribute (three assignment sites inget_data_step_install()) — dead code once the attribute is gone.Markup/PHP-array only — no CSS, no JS, no behavior change.
Noted but out of scope: self-review turned up that a fully "correct" semantic fix would give this element
role="button"(it behaves like a button, not a link), matching a precedent elsewhere in this codebase (js/addons-page.jssetsrole="button"on a near-identical anchor). That's not done here because the element currently has notabindex/keydown handler, so addingrole="button"alone would make it keyboard-unreachable while claiming button semantics — worse than the current state. That would need a JS-scoped follow-up (role + tabindex + keydown), out of scope for this markup-only a11y-checker fix.How verified
Not provable via Cypress CI —
checkIbmAccessibilitycalls.assertCompliance(false), so the a11y job never fails on violation count regardless of the fix. Verified directly instead:formidable-preview-env, Formidable Lite only) and fetched it authenticated via curl, before and after the fix.accessibility-checkerCLI (npx accessibility-checker --outputFormat json) against both saved pages.aria_attribute_validviolation, on exactly this<a>(.../section[3]/div[1]/span[1]/a[1]), matching the issue's stated baseline count.aria_attribute_validviolations. Total violation count dropped from 19 to 18 with no other rule's count changing — confirms this is the only difference.Closes Strategy11/formidable-pro#6759
🤖 Generated with Claude Code