=== Axeazy: ADA Accessibility Auto-Fixer ===
Contributors:      accessshield
Tags:              accessibility, ada, wcag, alt text, screen reader
Requires at least: 6.0
Tested up to:      6.6
Requires PHP:      8.0
Stable tag:        2.2.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Auto-fixes the WCAG violations cited in 96% of ADA demand letters: alt text, skip nav, lang attribute, and form labels. Optional weekly monitoring.

== Description ==

Axeazy closes the WCAG gaps plaintiff law firms scan for, at the code level, with zero visual change to your site.

What the plugin does out of the box (no account required):

* **Skip-to-main-content link**: invisible to mouse users, appears on first Tab press (WCAG 2.4.1).
* **Lang attribute injection**: adds the `lang` attribute to `<html>` when your theme omits it (WCAG 3.1.1).
* **Alt text fallback**: when an image has no native alt, falls back to an Axeazy-stored alt so screen readers aren't left silent (WCAG 1.1.1).

What it does when you connect an Axeazy API key (generated free from your Axeazy dashboard, Starter plan or above):

* **Weekly automated scans** of your live site, plus an on-demand "Scan now" button.
* **AI alt-text writer**: after a scan, Axeazy's AI writes missing alt text back into your media library automatically.
* **Auto-captioning**: Axeazy transcribes uncaptioned `<video>`/`<audio>` elements and the plugin serves the resulting captions as a `<track>` on your existing media, with no theme changes.
* **Color contrast fixes**: your Axeazy dashboard computes the smallest color change that clears WCAG contrast requirements and shows you a before/after preview. Approve it once, and this plugin applies that exact color, and only that one element, on your live site automatically. No theme editing.
* **Focus companion** and **dyslexia-friendly mode**: optional, one-click toggles under Settings → Axeazy that add a visible keyboard-focus indicator and a dyslexia-friendly reading mode for visitors who want it.
* **Dashboard widget** showing your latest risk indicator and how many violations have been auto-fixed.

This connection only works while your Axeazy subscription is active, if a subscription lapses or is downgraded, the plugin's account-connected features pause automatically until it's active again. The render-time fixes above (skip nav, lang attribute, alt-text fallback) always keep working, with or without an account.

What this plugin is NOT:

* Not an "ADA-compliant in 48 hours" overlay. Overlay widgets are the pattern the FTC fined a vendor $1M for in January 2025.
* Not legal advice. Automated tools detect roughly 30 to 40% of WCAG criteria. Full conformance assessment requires an IAAP-certified accessibility professional.

== External services ==

This plugin's render-time fixes (skip nav, lang attribute, alt-text fallback) run entirely on your own server and never contact any external service.

The optional account-connected features (weekly scans, AI alt text, auto-captioning) communicate with the Axeazy SaaS at **axeazy.com**, operated by Axeazy. This only happens if you paste an API key under Settings → Axeazy, until you do, the plugin makes no outbound requests at all.

When it does run, here is exactly what is sent and when:

* **Weekly cron scan / "Scan now" button**: sends your site's public home URL and your Axeazy API key (as a Bearer token, over HTTPS) to `https://axeazy.com/api/scan`, so Axeazy can run an accessibility scan against your public pages.
* **Scan results callback**: after a scan, Axeazy sends your risk score and fix count back to your site.
* **AI alt-text write-back**: Axeazy sends an image URL and the AI-generated alt text back to your site, which this plugin writes into the matching WordPress media library item.
* **Caption write-back**: Axeazy sends a link to a generated `.vtt` caption file for videos/audio it found uncaptioned, which the plugin then serves as a `<track>` on that media.
* **Contrast fix push**: only after you personally approve a specific replacement color in your Axeazy dashboard, Axeazy sends the page path, the CSS selector for that one element, and the approved color to your site, which this plugin uses to apply a scoped style override, nothing else on the page changes.

No visitor personal data, form submissions, or content beyond your public page URLs is ever sent. Axeazy's Terms of Service: https://axeazy.com/terms. Privacy Policy: https://axeazy.com/privacy

== Installation ==

1. Upload the `accessshield` folder to `/wp-content/plugins/`, or install via the WordPress plugin directory.
2. Activate the plugin through the **Plugins** menu.
3. (Optional) Go to **Settings → Axeazy** and paste your Axeazy API key to enable weekly scans and the dashboard widget.

The render-time fixes (skip nav, lang attribute, alt text fallback) work without an API key.

== Frequently Asked Questions ==

= Do I need an Axeazy account? =

No. The three render-time fixes work standalone. An account enables weekly monitoring and the AI alt-text writer.

= Will this change how my site looks? =

No. Every fix this plugin applies is invisible to sighted users. The skip-nav link is hidden off-screen until focused; lang and alt attributes never render visibly.

= Is the Axeazy API call secure? =

Yes. The plugin only POSTs your public site URL to the Axeazy API over HTTPS, with a bearer token you control. The REST endpoint that accepts callbacks uses a constant-time comparison on the shared API key.

= Does this work on multisite? =

Yes. On activation we pin the subsite URL into options so the network-root cron event still scans the correct site.

== Changelog ==

= 2.2.0 =
* New: color contrast fixes. Approve a replacement shade in your Axeazy dashboard and this plugin applies it live via a scoped style override, no theme editing, nothing else on the page changes. New `/update-contrast` REST endpoint; see class-fixer-contrast.php.

= 2.1.0 =
* Auto-captioning, focus companion, and dyslexia-friendly mode are now fully live (previously listed as upcoming): enable focus companion and dyslexia mode under Settings → Axeazy.
* Alt-text write-back now also accepts a direct image URL, not just an internal attachment ID.
* Account-connected features now check your Axeazy subscription status on every single scan, if a subscription lapses, those features pause automatically and resume the moment it's active again, with no plugin update needed.
* Uninstall now cleans up all plugin-created settings, including the new focus companion, dyslexia mode, and caption options.

= 2.0.0 =
* Internal class structure split: the single `Axeazy_Fixer` class is now a thin facade that delegates to one file per WCAG criterion (`class-fixer-alt-text.php`, `class-fixer-lang.php`, `class-fixer-skip-nav.php`). No behavior change for sighted users or existing API integrations, same hooks, same settings keys, same REST endpoint. See `UPGRADING.md` for off-WP.org install notes.

= 1.0.0 =
* Initial release. Skip-nav, lang attribute, and alt-text fallback fixes. Settings page, dashboard widget, weekly scan cron, REST endpoint for alt-text backfill.

== Upgrade Notice ==

= 2.2.0 =
Adds color contrast auto-fixing (account-connected, approval required). Safe automatic upgrade, no settings migration needed.

= 2.1.0 =
Adds auto-captioning, focus companion, and dyslexia mode. Safe automatic upgrade, no settings migration needed.

= 2.0.0 =
Internal refactor only, same fixes, no behavior change, no settings migration. Safe automatic upgrade for every existing install.

= 1.0.0 =
First release.
