Fix invalid label for= references on the styles page (IBM label_ref_valid) - #3366
vivi-the-going-merry[bot] wants to merge 2 commits into
Conversation
…alid) The "Vertical Spacing", "Input Field Padding", "Base Font Size", and "Corner Radius" headings pointed at the slider component's hidden storage input (type="hidden" is not a labelable element), and "Field Shape"/"Style Class" pointed at ids that were never rendered at all. None of these headings ever had a single real control to label - the sliders' actual visible inputs already carry their own aria-label, and Style Class has no control at all. Drop the dangling for attribute rather than invent a target. Closes Strategy11/formidable-pro#6690
Nothing renders it (FrmFieldShapeStyleComponent's template hardcodes its own radio ids) and its only consumer was the label removed in the previous commit.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Path: .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 |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| PHP | Sep 17, 2026 9:01p.m. | Review ↗ | |
| JavaScript | Sep 17, 2026 9:01p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
|
Filed Strategy11/formidable-pro#6709: the same dangling-`for`/hidden-input-or-dropped-id defect exists in 8 more headings in these same two files (Font Size, Height, Width, Border Width, Padding, Form Width, Alignment, Direction), verified live in the DOM. Not fixed here — the IBM checker's current scan doesn't reach them (they sit in a collapsed accordion section with no always-visible duplicate, unlike the 6 fixed here), so there's no red state to go green against. Root cause is component-level (`FrmSliderStyleComponent`/`FrmAlignStyleComponent`/`FrmDirectionStyleComponent`/`FrmFieldShapeStyleComponent` all mishandle the caller's `id`) — left for a scoped follow-up per #6709 rather than widened here without a verified red state. |
What was broken
formidable-pro#6687's IBM Equal Access baseline flagged 15label_ref_validviolations, all on the Formidable Lite Styles page (/wp-admin/admin.php?page=formidable-styles) — the checker and both a11y specs (admin-a11y.cy.js,form-preview-a11y.cy.js) live in this repo (Lite), notformidable-pro, even though the issue is tracked there per convention.Reproduced locally (wp-env, port 3010) with a temporary instrumented
checkIbmAccessibilitythat logged each violation'spath/snippet. Of the 15, 6 were genuine brokenfor/id pairings, all on<label class="frm-style-item-heading">section headings:type="hidden"storage input (FrmSliderStyleComponent) — a hidden input is not a labelable element, so the reference was never valid.frm_field_shape, an idFrmFieldShapeStyleComponent's template never actually renders (its four radio inputs use their own hardcoded ids instead)._quick-settings.phpand_general.php) pointed atfrm_style_class, which was never rendered anywhere — the adjacent content is a copy-to-clipboard<label class="frm-copy-text">, not a form control.What changed
Dropped the dangling
forattribute from all 6 headings (2 duplicated across_quick-settings.php/_field-sizes.php/_general.phpsince Quick Settings and the Advanced accordion sections render the same field twice). No CSS/JS change —.frm-style-item-headingis styled by class, not tag, and the underlying inputs/ids these headings never validly labeled are untouched (the hidden storage inputs are still read byjs/admin/style.jsfor the slider widgets). Also dropped_quick-settings.php's now-fully-dead'id' => 'frm_field_shape'array key — nothing consumes it.What's still open (not touched here, on purpose)
The remaining 9/15
label_ref_validinstances have a real, unique, correctly-associated element at the target id — but each is genuinely inaccessible for a different reason than "broken pairing":frm-field-shape-regular/-rounded-corners/-circle/-underline) aredisplay:none(.frm-style-component .frm-radio-container input{display:none},css/admin/frm-settings-components.css) — removed from the accessibility tree entirely, replaced visually by their sibling<label>'s SVG icon.frm_style_qsettings_submit_bg_coloretc.) and 1 custom-CSS-toggle label (frm_enable_single_style_custom_css) target inputs that are also nested inside a second, JS-generated wrapping<label>(WP core'swp-color-picker/Iris for the colors; this plugin's own toggle markup for the checkbox) — a double-label situation the checker flags even though each individual pairing resolves.Fixing either category needs a CSS change (visually-hidden-but-AT-visible pattern for the radios) or touching JS/markup structure the color-picker and toggle widgets depend on — both out of this issue's stated "markup-only, no CSS/JS" scope. Left for a follow-up once someone can review the visual/structural implications; noted on
formidable-pro#6690with the underlying cause named so the next pass doesn't have to re-diagnose it.Verification
Real red/green Cypress run against a local wp-env site (not inferred):
label_ref_validon the styles page went from 15 → 9 instances after the fix, with the exact 6 fixed headings disappearing and no other page's violation count changing (checked all 11 admin pages + form-preview). PHPCS clean (./vendor/bin/phpcson the changed files, no--standardoverride).php -lclean.Closes Strategy11/formidable-pro#6690