Skip to content

Fix invalid aria-label on SMTP page install/activate link - #3496

Open
vivi-the-going-merry[bot] wants to merge 2 commits into
masterfrom
fix/issue-6759-smtp-aria-label
Open

vivi-the-going-merry[bot] wants to merge 2 commits into
masterfrom
fix/issue-6759-smtp-aria-label

Conversation

@vivi-the-going-merry

Copy link
Copy Markdown
Contributor

What was broken

IBM Equal Access flagged aria_attribute_valid once on the SMTP settings admin page (Formidable > SMTP). The "Install"/"Activate WP Mail SMTP" <a> in FrmSMTPController::output_section_step_install() has no href (it's driven entirely by a JS click handler via the frm-install-addon/frm-activate-addon classes), so per ARIA-in-HTML it takes the implicit role "generic" — and aria-label isn't a valid attribute for that role.

This is a distinct instance from #6701 (fixed by #3373, an aria-selected issue on the payment settings tab, unrelated element) — not a re-appearance of that fix failing to hold.

What changed

Removed the aria-label attribute 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 in get_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.js sets role="button" on a near-identical anchor). That's not done here because the element currently has no tabindex/keydown handler, so adding role="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 — checkIbmAccessibility calls .assertCompliance(false), so the a11y job never fails on violation count regardless of the fix. Verified directly instead:

  • Rendered the real SMTP settings page (formidable-preview-env, Formidable Lite only) and fetched it authenticated via curl, before and after the fix.
  • Ran IBM's own accessibility-checker CLI (npx accessibility-checker --outputFormat json) against both saved pages.
  • Before: 1 aria_attribute_valid violation, on exactly this <a> (.../section[3]/div[1]/span[1]/a[1]), matching the issue's stated baseline count.
  • After: 0 aria_attribute_valid violations. 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

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
@coderabbitai

coderabbitai Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: Strategy11/formidable-forms/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a206d6b1-224b-4ab0-8d24-13a0c4a4724f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@franky-the-going-merry franky-the-going-merry Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

install button

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.

@vivi-the-going-merry vivi-the-going-merry Bot added vivi-working Vivi is actively working this and removed vivi-pickup labels Sep 26, 2026
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.
@vivi-the-going-merry vivi-the-going-merry Bot added franky-review and removed vivi-working Vivi is actively working this labels Sep 26, 2026
@vivi-the-going-merry

Copy link
Copy Markdown
Contributor Author

Method: in-place push
Pushed to: #3496 (branch fix/issue-6759-smtp-aria-label, unchanged PR number)

@vivi-the-going-merry

Copy link
Copy Markdown
Contributor Author

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.

@franky-the-going-merry franky-the-going-merry Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants