# Prime Accessibility

WordPress accessibility plugin by [Oyorox](https://oyorox.com) that helps sites meet WCAG, ADA, and related standards with a customizable front-end widget, conditional presets, user profiles, and an accessibility checker.

## Overview

Prime Accessibility adds an on-site accessibility panel visitors can open from a floating launcher. Site owners configure that panel through the WordPress admin: create presets, choose which profiles and features appear, style the launcher and panel, and assign presets by context (entire site, singular content, or archives).

The plugin ships with:

- A React-based admin for presets, profiles, settings, and system tools
- A front-end accessibility widget (profiles, text/contrast/motion tools, translations, preferences)
- An Accessibility Checker for scanning and tracking fixes (premium package)
- A default Accessibility Policy (statement) page template and branding controls

It is theme- and page-builder agnostic and works with the WordPress block editor, classic themes, and common builders.

## Features

### Front-end widget
- Floating launcher with brand logo mark styles and custom colors
- Accessibility profiles (e.g. motor, color blind, low vision, cognitive, seizure, ADHD, blind, dyslexia)
- Feature controls (text size/spacing, contrast, animations, cursor, dictionary, and more)
- Preference save/restore for logged-in users
- Screen reader, keyboard navigation, smart contrast, grayscale, brightness, mute
  sounds and the Google Translate integration ship in the premium package only
- Footer branding and Accessibility Policy link
- Click-outside closes the drawer without dimming or blurring the page

### Presets & profiles
- Multiple presets with conditional targeting (site-wide, singular, archives)
- Live preview while editing presets and profiles
- Panel sections: header, panel layout, profiles, features, styling, button, footer
- Create and manage named accessibility profiles used by the widget

### Admin & tools
- Dashboard overview and usage insights
- Settings (statement page, translations consent, keyboard shortcuts, and related options)
- Accessibility Checker with resolved fixes tracking (premium package)
- Backup / export–import helpers (premium package)
- System information for support

### Branding & compliance helpers
- Brand palette and logo across admin, launcher, and checker
- Default Accessibility Policy content with contact details for feedback
- Translation-ready (`prime-accessibility` text domain)

## Requirements

| | Version |
| --- | --- |
| WordPress | 6.1+ |
| PHP | 7.4+ |
| Node.js (development) | 18+ |
| Composer (development) | 2.x |

## Installation

1. Copy the plugin to `wp-content/plugins/prime-accessibility` (or install from a release zip).
2. Activate **Prime Accessibility** in **Plugins**.
3. Open **Prime Accessibility** in the admin menu to configure presets, profiles, and settings.
4. Visit the front end and open the accessibility launcher to verify the widget.

On first activation the plugin can seed a default preset and Accessibility Policy page when those do not already exist.

## Development

```bash
composer install
npm install
npm run start    # watch / rebuild assets
npm run build    # production build
```

| Script | Purpose |
| --- | --- |
| `npm run start` | Development build with watch |
| `npm run build` | Production assets into `build/` |
| `npm run make-pot` | Generate POT translation file |
| `npm run plugin-zip` | Create distributable zip |
| `npm run publish` | Build + POT + zip |

Prefer a full `npm run build` when shipping; partial entry builds can leave multi-entry `build/` incomplete.

Ignore rules live in `.git/info/exclude` rather than a tracked `.gitignore`, because
Plugin Check reports any dotfile in the plugin root as a hidden file. Clone-time setup
therefore needs those rules copied in manually — see the block at the bottom of that file.

### Plugin Check (PCP)

Run Plugin Check against the **release zip**, not the working directory. The working
directory contains development files (`src/`, `node_modules/`, `phpcs.xml`,
lockfiles) that `npm run zip` already excludes via the `files` array in
`package.json`, so checking it produces findings that never reach WordPress.org.

```bash
npm run zip                                    # produces prime-accessibility.zip
unzip -q prime-accessibility.zip -d /tmp/pcp   # extract; keep the folder name
                                               # prime-accessibility, or the i18n
                                               # sniff will report a text-domain
                                               # mismatch against the folder name
wp plugin check prime-accessibility
```

Expected output on a clean release:

- **The plugin's own PHP is expected to report zero errors and zero warnings.**
  Anything appearing under `includes/` or `prime-accessibility.php` is a real
  regression and should be fixed.
- **`freemius/` reports ~525 errors and ~1238 warnings.** These come from the
  vendored Freemius SDK (currently 2.13.4, the latest release) — mostly
  `WordPress.Security.EscapeOutput`, plus `plugin_updater_detected` from
  `class-fs-plugin-updater.php`. Plugin Check flags all vendored third-party
  code by design; the WordPress.org review team accepts the Freemius SDK. Do not
  patch the SDK to silence these, as the changes are lost on every SDK update.
- **`readme.txt` is expected to report zero findings.** The readme title matches
  the `Plugin Name:` header exactly; keep it that way, and keep the
  `== External services ==` section in step with any new outbound request.

## Project structure

```
prime-accessibility/
├── assets/                 # Static images, fonts
├── build/                  # Compiled JS/CSS (generated)
├── default-posts/          # Default preset & statement content
├── includes/               # PHP (Admin, Core, Routes, View)
├── languages/              # Translations
├── src/
│   ├── admin/              # Admin React app
│   ├── accessibility-checker/
│   ├── components/         # Shared widget UI
│   ├── frontend/           # Front-end app / context
│   └── helpers/
├── vendor/                 # Composer autoload
├── composer.json
├── package.json
└── prime-accessibility.php
```

### Free / premium separation

Prime Accessibility is distributed as two packages, and the split is by *file
presence*, never by a runtime license check:

- The **free package** (WordPress.org) contains only free code. Everything in it
  is fully functional and permanently available. There is no license check, no
  trial, no quota, and no timer anywhere in it — nothing in the package stops
  working, or refuses to start, for any licensing reason.
- The **premium package** additionally contains the files listed under
  `@fs_premium_only` in `prime-accessibility.php`: `build/helpers/`,
  `build/accessibility-checker/`, `build/fonts/`, and the premium REST
  controllers. Freemius strips these when generating the free zip.

`Core\Pro` is the single place that answers "are those files installed?"
(`Pro::is_available()`, `Pro::has_checker_bundle()`). Every gate in PHP and JS
asks that question and nothing else. On the JS side `src/utils/pro-features.js`
lists the same slugs, and `src/accessibility/registry.js` swaps in no-op stubs
when the premium bundle is absent, so no call site needs a conditional.

When adding a feature, put it in the free package unless its implementation
genuinely lives in a `@fs_premium_only` file. Never add a check that disables
locally-present code.

### Architecture notes

- **PHP namespace:** `oyorox\primeaccessibility`
- **Patterns:** Singletons for bootstrap services; REST routes under `includes/Routes`
- **Custom post types:** Presets and profiles (see `PluginSchema`)
- **Front-end stack:** `@wordpress/scripts`, React, SCSS, Tailwind utility classes in admin
- **Assets:** Entries for admin, components, frontend, accessibility-checker, and helpers

## Accessibility Policy

Default statement content lives in `default-posts/statement.json`. Feedback contact:

- [https://oyorox.com/contact/](https://oyorox.com/contact/)
- [hello@oyorox.com](mailto:hello@oyorox.com)

## Support

- Contact: [oyorox.com/contact](https://oyorox.com/contact/)
- Email: [hello@oyorox.com](mailto:hello@oyorox.com)
- Product: [Prime Accessibility](https://oyorox.com) / [primeaccessibility.com](https://primeaccessibility.com/)

## License

GPL-2.0-or-later. See [LICENSE](https://www.gnu.org/licenses/gpl-2.0.html).

---

© Oyorox — building tools for a more accessible web.
