=== Accessibility Companion for Bricks ===
Tags: accessibility, bricks, keyboard, forms, navigation
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Native accessibility review, element location, conservative fixes and undo, plus keyboard-focus, form-feedback and menu assistance for Bricks.

== Description ==

A standalone companion for any website using Bricks Builder, not only BricksTemplates kits. A separately licensed installation of Bricks is required. Your layouts remain native Bricks elements.

Automatic enhancements:
* Visible keyboard-focus fallback when a native control has neither an outline nor a box-shadow indicator.
* Invalid-state assistance for native form fields without an existing aria-invalid attribute.
* Polite announcements for native form messages that do not already have a live region.
* Native nested-menu corrections: focus visibility, normal Tab behavior after closing, and resize recovery using the toggle tracked by Bricks.
* Support for content added by native Bricks AJAX events and duplicate-helper protection for existing BricksTemplates code.

On-demand editor review covers images, interactive names, form labels, heading order, main landmarks, duplicate IDs, ARIA references, tables, tabs, disclosures, dialogs, carousels, media, zoom restrictions and measurable solid-background text contrast. It reports content and configuration issues instead of inventing alt text or labels. Carousels, media, keyboard behavior and complex backgrounds still need manual review. Open Accessibility beneath Structure to review the current view in Bricks. The optional WordPress admin report lives under Bricks > Accessibility.

Each resolvable finding offers Open element in Bricks, selecting the real source element and opening its native controls. Conservative fixes also offer Preview fix: inspect exact before/after settings, choose Apply fix, check the live editor canvas, and use Bricks' native Save to publish. Undo fix reverses only the affected settings in that same editor session and refuses to overwrite later edits to those settings. Unrelated edits remain. After reopening the editor, use Bricks' native revisions for saved changes.

Choose Page or post or Bricks template in Bricks > Accessibility. Search by title and choose a named result; no page ID is needed. Page reviews cover the complete rendered page and identify each finding's saved source. Template reviews show native include/exclude conditions and suggested real page, archive, search and 404 contexts. Suggestions are not guarantees of assignment: Bricks still evaluates conditions and competing templates normally. The report confirms whether the selected template was detected and focuses its findings on that template's native elements. A missing template or missing native markup is never shown as a passed review. Use a page review for full integration and manually check interactive states. No display conditions or Populate Content settings are changed.

Search uses a keyboard-native select, title-only queries capped at20 matches, live name filtering and a standard Search button fallback when JavaScript is unavailable. Page/template list rows and the native Bricks Accessibility entry preselect the correct content. Reports distinguish Appears on from Saved source; a template source warns that saving affects every use. Archive and other non-singular reviews require template editing permission and WordPress edit_theme_options. No arbitrary URL fetching or whole-site scan runs in the background.

The first supported plans normalize explicitly authored positive tabindex values to zero, set at least 24px minimum dimensions on native Button elements with simple numeric settings, and show existing static form labels through Bricks' Show labels setting. Dynamic values, conflicting maximum dimensions, ambiguous sources and shared component definitions do not receive automatic plans. Review context, target-size spacing/exceptions, responsive states and keyboard order before accepting a change. The UI identifies these as review prompts, not automatic WCAG failures.

No accessibility overlay is shown to visitors. The plugin adds no database tables, tracking or third-party requests, and does not enable code execution. Apply stages native element settings in the open Bricks editor; only the editor's native Save publishes them. A small local script and stylesheet load only when Bricks renders native elements. Review and editor-action code load only in authorized sessions. Source markers appear only during authorized reviews. See the data FAQ for how optional review records are stored.

This is a targeted assistance and review tool, not automatic WCAG certification or a replacement for content, keyboard and screen-reader testing. The first release supports Bricks; other page builders and themes are outside its integration scope. It is an independent BricksTemplates project, not an official Bricks Builder product.

The optional WordPress admin review workspace uses four clear steps: Choose content, Review, Fix in Bricks, and Save and verify. Results appear first after a scan. Each issue card explains its next step and whether a guided fix is offered or a manual check is needed. Technical selectors and WCAG references are expandable. Unsupported findings show native element controls and guidance instead of inactive fix buttons. Saved-content rechecks and unavailable-content recovery remain explicit. Old Tools links and signed report POSTs are supported for compatibility.

Editor links pass through a signed, capability-checked handoff that confirms the current source and post status, then opens a native explicit post-ID route. Deleted or unavailable content returns to the review with a recovery notice. This does not enable unsupported post types or change editing permissions. The Structure footer uses native builder tokens in an isolated, feature-detected editor extension, tested on Bricks2.4.5; the native Page Settings entry remains available if a future editor DOM changes.

Inside Bricks, Accessibility beneath Structure opens the review panel. Use Check to review the current page and breakpoint. Each mapped finding shows its Bricks page or template, element, and supported native field. Review options contains guided keyboard checks, a review record, and JSON exports. You can save a record in this browser to resume it later. The coverage report distinguishes findings, manual work and unchecked criteria. It does not certify WCAG conformance. The builder and optional admin report share one document scanner. Its accessible-name engine is bundled locally, includes its MIT license, and loads only for authorized reviews.

== Installation ==

1. Open WordPress > Plugins > Add New Plugin > Upload Plugin.
2. Select the downloaded accessibility-companion-for-bricks ZIP, then Install Now and Activate Plugin. When updating an existing copy, use WordPress' replacement confirmation after reviewing the package details.
3. View a page built with Bricks. Compatible enhancements load automatically; no code pasting or Bricks PHP/code execution setting is required.
4. Choose Accessibility beneath the Structure panel in Bricks. It opens the in-builder workspace: check the current canvas, select a finding, follow the native setting and preview reliable changes. Use native Save, then Check saved page to verify one real frontend context without leaving the editor. Undo last fix remains available in that session, including after a finding disappears from a recheck. Page Settings > Accessibility remains a secondary entry. In Bricks > Accessibility, choose Page or post or Bricks template, search by name, select the result and Continue. For templates choose a real preview context, then Review template in context. For a page choose Review page. Editable private/draft content is supported. Native page/template row shortcuts and the page's WordPress admin bar are also available.
5. Use Open element in Bricks on a resolved finding, or Preview fix in Bricks when a reliable plan is offered. Preview changes nothing. Apply fix stages the native settings; inspect the canvas and use native Save to publish. Undo fix is available in that editor session; use native Save again to publish a reversal. Re-run only the affected review and manual checks after saving.

BricksTemplates kit users: while this plugin is active you can skip the menu-accessibility.html pasting step. An existing manual helper can remain; duplicate initialization of its existing menus is avoided. Preserve unrelated custom code.

== Frequently Asked Questions ==

= Does a template import silently install the plugin? =

No. The site owner installs and activates it once. WordPress permission and installation steps remain in place. After activation, no code pasting is needed.

= Does it support all Bricks elements? =

Focus assistance applies across native interactive elements, and the review checks shared semantic/content requirements across Bricks markup. Forms and native nested menus have dedicated enhancements. Native tabs, accordions, dialogs, sliders, media and other components retain their Bricks behavior; relevant configuration issues are reported. Not every issue can be automatically detected or repaired.

= Does it work with my own Bricks design? =

Yes. No BricksTemplates class names, starter kits, account or subscription are required. Custom third-party elements and custom JavaScript require their own review. The plugin avoids changing authored labels, alt text, colors or document structure.

= What if I disable it? =

Your layouts, content and settings remain. The plugin's assets and improvements stop on the next uncached page load. Clear a page cache if necessary. If you relied on its menu corrections, use the kit's manual helper instead. There is no plugin-owned database data to remove.

= Does it store data? =

Findings are created in the authorized reviewer's browser. The optional admin report sends findings only to the same site's admin screen for display. Saving a review record keeps its findings, notes and coverage context in local storage in that browser until you remove it in the review record or clear the site's browser data. Records are not synced between devices, stored in the WordPress database or sent to a third party. JSON exports download to your device. The menu module can read an existing BricksTemplates motion preference from local storage; it does not create that preference or tracking data.

== In-builder workspace ==

Accessibility beneath Structure opens a movable nonmodal panel, preserving native controls and the canvas. Editor checks include unsaved content. A saved-page check can load one authorized frontend view on demand. Selecting a finding reveals the element and the corresponding native control when its exact field can be identified; other findings retain clear manual instructions. Preview is read-only, Apply stages native settings, and native Save publishes. Scoped Undo remains available for applied changes in that editor session. Source switches require saving current work first.

== Changelog ==

= 0.1.0 =
* Professional audit workspace: exact source and field where supported, guided keyboard review, and contextual JSON exports with recheck evidence.
* Development workspace: in-builder checks, setting highlights, saved-context verification and persistent session Undo.
* Editor UX update: persistent Structure shortcut, Bricks submenu, guided issue cards, clear manual states and validated editor handoffs.
* Selection workflow: searchable page/template names, native condition summaries, real preview contexts, template-presence warnings and saved-source labels. No page ID entry required.
* Workflow update: Locate in Bricks, exact setting previews, native editor Apply fix and scoped Undo fix.
* Related WCAG 2.2 AA guidance and manual-review areas; no automated conformance score.
* First standalone Bricks release with modular menu, keyboard-focus and form-feedback enhancements, and an owner-only element review.
