claude-plugin-wordpress-manager 1.5.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +2 -2
- package/CHANGELOG.md +97 -0
- package/README.md +27 -13
- package/agents/wp-accessibility-auditor.md +206 -0
- package/agents/wp-content-strategist.md +18 -0
- package/agents/wp-deployment-engineer.md +34 -2
- package/agents/wp-performance-optimizer.md +12 -0
- package/agents/wp-security-auditor.md +20 -0
- package/agents/wp-security-hardener.md +266 -0
- package/agents/wp-site-manager.md +14 -0
- package/agents/wp-test-engineer.md +207 -0
- package/docs/guides/INDEX.md +46 -0
- package/docs/guides/wp-blog.md +590 -0
- package/docs/guides/wp-design-system.md +976 -0
- package/docs/guides/wp-ecommerce.md +786 -0
- package/docs/guides/wp-landing-page.md +762 -0
- package/docs/guides/wp-portfolio.md +713 -0
- package/docs/plans/2026-02-27-design-system-guide-design.md +30 -0
- package/docs/plans/2026-02-27-site-type-guides-design.md +44 -0
- package/package.json +2 -2
- package/skills/wordpress-router/references/decision-tree.md +12 -2
- package/skills/wp-accessibility/SKILL.md +170 -0
- package/skills/wp-accessibility/references/a11y-audit-tools.md +248 -0
- package/skills/wp-accessibility/references/a11y-testing.md +222 -0
- package/skills/wp-accessibility/references/block-a11y.md +247 -0
- package/skills/wp-accessibility/references/interactive-a11y.md +272 -0
- package/skills/wp-accessibility/references/media-a11y.md +254 -0
- package/skills/wp-accessibility/references/theme-a11y.md +309 -0
- package/skills/wp-audit/SKILL.md +4 -0
- package/skills/wp-block-development/SKILL.md +5 -0
- package/skills/wp-block-themes/SKILL.md +4 -0
- package/skills/wp-e2e-testing/SKILL.md +186 -0
- package/skills/wp-e2e-testing/references/ci-integration.md +174 -0
- package/skills/wp-e2e-testing/references/jest-wordpress.md +114 -0
- package/skills/wp-e2e-testing/references/phpunit-wordpress.md +141 -0
- package/skills/wp-e2e-testing/references/playwright-wordpress.md +108 -0
- package/skills/wp-e2e-testing/references/test-data-generation.md +127 -0
- package/skills/wp-e2e-testing/references/visual-regression.md +107 -0
- package/skills/wp-e2e-testing/references/wp-env-setup.md +97 -0
- package/skills/wp-e2e-testing/scripts/test_inspect.mjs +375 -0
- package/skills/wp-headless/SKILL.md +168 -0
- package/skills/wp-headless/references/api-layer-choice.md +160 -0
- package/skills/wp-headless/references/cors-config.md +245 -0
- package/skills/wp-headless/references/frontend-integration.md +331 -0
- package/skills/wp-headless/references/headless-auth.md +286 -0
- package/skills/wp-headless/references/webhooks.md +277 -0
- package/skills/wp-headless/references/wpgraphql.md +331 -0
- package/skills/wp-headless/scripts/headless_inspect.mjs +321 -0
- package/skills/wp-i18n/SKILL.md +170 -0
- package/skills/wp-i18n/references/js-i18n.md +201 -0
- package/skills/wp-i18n/references/multilingual-setup.md +219 -0
- package/skills/wp-i18n/references/php-i18n.md +196 -0
- package/skills/wp-i18n/references/rtl-support.md +206 -0
- package/skills/wp-i18n/references/translation-workflow.md +178 -0
- package/skills/wp-i18n/references/wpcli-i18n.md +177 -0
- package/skills/wp-i18n/scripts/i18n_inspect.mjs +330 -0
- package/skills/wp-interactivity-api/SKILL.md +4 -0
- package/skills/wp-plugin-development/SKILL.md +6 -0
- package/skills/wp-rest-api/SKILL.md +4 -0
- package/skills/wp-security/SKILL.md +179 -0
- package/skills/wp-security/references/api-restriction.md +147 -0
- package/skills/wp-security/references/authentication-hardening.md +105 -0
- package/skills/wp-security/references/filesystem-hardening.md +105 -0
- package/skills/wp-security/references/http-headers.md +105 -0
- package/skills/wp-security/references/incident-response.md +144 -0
- package/skills/wp-security/references/user-capabilities.md +115 -0
- package/skills/wp-security/references/wp-config-security.md +129 -0
- package/skills/wp-security/scripts/security_inspect.mjs +393 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Design: Guida WordPress Design System — Da Token a Pixel
|
|
2
|
+
|
|
3
|
+
**Data:** 2026-02-27
|
|
4
|
+
**Stato:** Approvato
|
|
5
|
+
|
|
6
|
+
## Obiettivo
|
|
7
|
+
|
|
8
|
+
Guida concettuale + pratica che unifica le 4 skill UI del plugin (wpds, wp-block-themes, wp-block-development, wp-interactivity-api) sotto il paradigma design-as-data. Colma il gap tra skill operative mostrando la catena completa da design token a pixel renderizzato.
|
|
9
|
+
|
|
10
|
+
## Posizione
|
|
11
|
+
|
|
12
|
+
`docs/guides/wp-design-system.md`
|
|
13
|
+
|
|
14
|
+
## Struttura (8 sezioni)
|
|
15
|
+
|
|
16
|
+
1. Paradigma Design-as-Data
|
|
17
|
+
2. Strato 1: Design Tokens
|
|
18
|
+
3. Strato 2: theme.json come compilatore
|
|
19
|
+
4. Strato 3: Blocchi Core come componenti UI
|
|
20
|
+
5. Strato 4: Patterns come pagine prefabbricate
|
|
21
|
+
6. Strato 5: Blocchi Custom con WPDS (@wordpress/components)
|
|
22
|
+
7. Strato 6: Interattivita (Interactivity API)
|
|
23
|
+
8. Mappa Skill del Plugin
|
|
24
|
+
|
|
25
|
+
## Decisioni
|
|
26
|
+
|
|
27
|
+
- Approccio A (guida unificata) scelto
|
|
28
|
+
- Ogni sezione: concetto + schema ASCII + esempio dal blog Developer Journal
|
|
29
|
+
- Audience: sia utente Claude Code sia sviluppatore WordPress
|
|
30
|
+
- ~700-800 righe stimate
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Design: Guide WordPress per Tipologia di Sito
|
|
2
|
+
|
|
3
|
+
**Data:** 2026-02-27
|
|
4
|
+
**Stato:** Approvato
|
|
5
|
+
|
|
6
|
+
## Obiettivo
|
|
7
|
+
|
|
8
|
+
Creare una serie di guide `.md` per ogni tipologia di sito WordPress (blog, landing page, ecommerce, portfolio). Ogni guida serve due audience: utente Claude Code (operativo) e sviluppatore WordPress (tecnico).
|
|
9
|
+
|
|
10
|
+
## Posizione
|
|
11
|
+
|
|
12
|
+
`docs/guides/` nel plugin wordpress-manager:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
docs/guides/
|
|
16
|
+
├── INDEX.md # Indice e matrice tipologie
|
|
17
|
+
├── wp-blog.md # Prima guida
|
|
18
|
+
├── wp-landing-page.md # Futuro
|
|
19
|
+
├── wp-ecommerce.md # Futuro
|
|
20
|
+
├── wp-portfolio.md # Futuro
|
|
21
|
+
└── ...
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Struttura Standard (ogni guida)
|
|
25
|
+
|
|
26
|
+
1. **Panoramica** — cos'e, quando usarlo, varianti
|
|
27
|
+
2. **Per l'Utente** — concept, setup, contenuti, gestione, SEO, manutenzione
|
|
28
|
+
3. **Per lo Sviluppatore** — architettura, theme.json, templates, patterns, plugin, workflow
|
|
29
|
+
4. **Checklist di Lancio** — items raggruppati per area
|
|
30
|
+
5. **Riferimenti** — skill plugin, risorse WP.org
|
|
31
|
+
|
|
32
|
+
## Decisioni
|
|
33
|
+
|
|
34
|
+
- Approccio A (file separati) scelto per modularita
|
|
35
|
+
- Ogni guida e autocontenuta (~400-500 righe)
|
|
36
|
+
- Le skill del plugin possono linkare alla guida rilevante
|
|
37
|
+
- Lingua: italiano
|
|
38
|
+
|
|
39
|
+
## Roadmap
|
|
40
|
+
|
|
41
|
+
1. wp-blog.md (ora)
|
|
42
|
+
2. wp-landing-page.md
|
|
43
|
+
3. wp-ecommerce.md
|
|
44
|
+
4. wp-portfolio.md
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-plugin-wordpress-manager",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Unified WordPress management and development plugin for Claude Code. Orchestrates Hostinger MCP, WP REST API bridge, and WordPress.com MCP with
|
|
3
|
+
"version": "1.7.1",
|
|
4
|
+
"description": "Unified WordPress management and development plugin for Claude Code. Orchestrates Hostinger MCP, WP REST API bridge, and WordPress.com MCP with 24 skills, 8 agents, and security hooks. Includes local dev environment support for WordPress Studio, LocalWP, and wp-env. v1.7.0 adds 3 new agents (testing, security hardening, accessibility) and upgrades 5 existing agents.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "vinmor",
|
|
7
7
|
"email": "morreale.v@gmail.com"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Router decision tree (
|
|
1
|
+
# Router decision tree (v4 — development + local environment + operations)
|
|
2
2
|
|
|
3
3
|
This routing guide covers WordPress **development**, **local environment**, and **operations** workflows.
|
|
4
4
|
|
|
@@ -17,7 +17,7 @@ Keywords that indicate **operations**:
|
|
|
17
17
|
deploy, push to production, audit, security check, backup, restore, migrate, move site, create post, manage content, site status, check plugins, performance check, SEO audit
|
|
18
18
|
|
|
19
19
|
Keywords that indicate **development**:
|
|
20
|
-
create block, block.json, theme.json, register_rest_route, plugin development, hooks, PHPStan, build, test, scaffold
|
|
20
|
+
create block, block.json, theme.json, register_rest_route, plugin development, hooks, PHPStan, build, test, scaffold, i18n, translation, accessibility, a11y, headless, decoupled, WPGraphQL
|
|
21
21
|
|
|
22
22
|
## Step 1: classify repo kind (from triage — development only)
|
|
23
23
|
|
|
@@ -57,6 +57,14 @@ Priority: `gutenberg` > `wp-core` > `wp-site` > `wp-block-theme` > `wp-block-plu
|
|
|
57
57
|
→ `wpds` (WordPress Design System)
|
|
58
58
|
- **Playground / disposable WP / blueprint / sandbox / test environment / version switching**
|
|
59
59
|
→ `wp-playground`
|
|
60
|
+
- **Test / E2E / Playwright / Jest / PHPUnit / wp-env testing / coverage / visual regression**
|
|
61
|
+
→ `wp-e2e-testing` skill + `wp-test-engineer` agent
|
|
62
|
+
- **i18n / translation / .pot / gettext / text domain / RTL / Polylang / WPML / multilingual**
|
|
63
|
+
→ `wp-i18n`
|
|
64
|
+
- **Accessibility / a11y / WCAG / ARIA / screen reader / keyboard navigation / focus management**
|
|
65
|
+
→ `wp-accessibility` skill + `wp-accessibility-auditor` agent
|
|
66
|
+
- **Headless / decoupled / WPGraphQL / Next.js / Nuxt / Astro / Gatsby / CORS / ISR / SSG / frontend integration**
|
|
67
|
+
→ `wp-headless`
|
|
60
68
|
|
|
61
69
|
## Step 2b: route by operational intent (keywords)
|
|
62
70
|
|
|
@@ -64,6 +72,8 @@ Priority: `gutenberg` > `wp-core` > `wp-site` > `wp-block-theme` > `wp-block-plu
|
|
|
64
72
|
→ `wp-deploy` skill + `wp-deployment-engineer` agent
|
|
65
73
|
- **Audit / security check / vulnerability / hacked / health check**
|
|
66
74
|
→ `wp-audit` skill + `wp-security-auditor` agent
|
|
75
|
+
- **Harden / permissions / headers / WAF / malware / compromised / incident response / security hardening**
|
|
76
|
+
→ `wp-security` skill + `wp-security-hardener` agent
|
|
67
77
|
- **Backup / snapshot / disaster recovery / restore**
|
|
68
78
|
→ `wp-backup` skill
|
|
69
79
|
- **Migrate / move / transfer / clone site / change hosting**
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-accessibility
|
|
3
|
+
description: "Use when improving WordPress accessibility: block accessibility (ARIA, keyboard navigation), theme accessibility (landmarks, skip links, color contrast), interactive component accessibility, media accessibility (alt text, captions, transcripts), and automated/manual a11y testing with WCAG 2.2 compliance."
|
|
4
|
+
compatibility: "Targets WordPress 6.9+ (PHP 7.2.24+). Filesystem-based agent with bash + node."
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
source: "vinmor/wordpress-manager"
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# WP Accessibility
|
|
10
|
+
|
|
11
|
+
## When to use
|
|
12
|
+
|
|
13
|
+
Use this skill for accessibility work such as:
|
|
14
|
+
|
|
15
|
+
- Making custom blocks accessible (ARIA roles, keyboard navigation, screen reader support)
|
|
16
|
+
- Ensuring a theme meets WCAG 2.2 AA requirements
|
|
17
|
+
- Fixing accessibility audit findings (axe-core violations, Lighthouse issues)
|
|
18
|
+
- Adding keyboard navigation to interactive components (modals, tabs, dropdowns, accordions)
|
|
19
|
+
- Implementing ARIA patterns from the APG (ARIA Authoring Practices Guide)
|
|
20
|
+
- Making media accessible (alt text, captions, transcripts, audio descriptions)
|
|
21
|
+
- Preparing a theme for WordPress.org `accessibility-ready` tag
|
|
22
|
+
- Setting up automated a11y testing in CI pipelines
|
|
23
|
+
|
|
24
|
+
## Inputs required
|
|
25
|
+
|
|
26
|
+
- Repo root and target (plugin, theme, or block).
|
|
27
|
+
- Project kind: plugin, theme, block, or full site.
|
|
28
|
+
- Target WCAG level: AA (default) or AAA.
|
|
29
|
+
- Specific a11y issues reported (audit results, user feedback, review team comments).
|
|
30
|
+
|
|
31
|
+
## Procedure
|
|
32
|
+
|
|
33
|
+
### 0) Understand WordPress a11y standards
|
|
34
|
+
|
|
35
|
+
WordPress core has a dedicated Accessibility Team. Key principles:
|
|
36
|
+
|
|
37
|
+
1. **WordPress.org theme review** requires `accessibility-ready` themes to pass tests covering skip links, keyboard navigation, contrast, heading hierarchy, landmarks, and form labels.
|
|
38
|
+
2. **Block editor** blocks must meet core a11y standards: `useBlockProps()` provides baseline ARIA attributes; interactive blocks must handle keyboard events.
|
|
39
|
+
3. **WCAG 2.2** is the target standard. WordPress aims for Level AA at minimum.
|
|
40
|
+
|
|
41
|
+
For automated a11y testing setup, reference the `wp-e2e-testing` skill.
|
|
42
|
+
|
|
43
|
+
Run project triage:
|
|
44
|
+
```bash
|
|
45
|
+
node skills/wp-project-triage/scripts/detect_wp_project.mjs
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 1) Block accessibility
|
|
49
|
+
|
|
50
|
+
Ensure custom blocks are accessible to keyboard and screen reader users.
|
|
51
|
+
|
|
52
|
+
Key areas:
|
|
53
|
+
- ARIA roles and properties for custom block markup
|
|
54
|
+
- Keyboard interaction patterns for block controls
|
|
55
|
+
- Focus management when blocks are inserted, removed, or transformed
|
|
56
|
+
- Screen reader announcements via `wp.a11y.speak()`
|
|
57
|
+
- Block supports: `anchor`, `ariaLabel`
|
|
58
|
+
|
|
59
|
+
Read: `references/block-a11y.md`
|
|
60
|
+
|
|
61
|
+
### 2) Theme accessibility
|
|
62
|
+
|
|
63
|
+
Ensure the theme meets WCAG 2.2 and `accessibility-ready` requirements.
|
|
64
|
+
|
|
65
|
+
Key areas:
|
|
66
|
+
- Landmark roles: `<header>`, `<nav>`, `<main>`, `<footer>`, `<aside>`
|
|
67
|
+
- Skip links to main content
|
|
68
|
+
- Heading hierarchy (single H1, logical nesting)
|
|
69
|
+
- Color contrast (4.5:1 normal text, 3:1 large text at AA)
|
|
70
|
+
- Visible focus indicators (`:focus-visible`)
|
|
71
|
+
- `prefers-reduced-motion` and `prefers-contrast` media queries
|
|
72
|
+
- `theme.json` color palette contrast compliance
|
|
73
|
+
|
|
74
|
+
Read: `references/theme-a11y.md`
|
|
75
|
+
|
|
76
|
+
### 3) Interactive component accessibility
|
|
77
|
+
|
|
78
|
+
Implement ARIA design patterns from the APG for interactive UI components.
|
|
79
|
+
|
|
80
|
+
Key areas:
|
|
81
|
+
- Modal/dialog: focus trap, Escape to close, return focus to trigger
|
|
82
|
+
- Dropdown/menu: arrow key navigation, typeahead
|
|
83
|
+
- Tabs: arrow keys to switch, Home/End support
|
|
84
|
+
- Accordion: `aria-expanded`, Enter/Space to toggle
|
|
85
|
+
- Carousel: pause on hover/focus, slide announcements
|
|
86
|
+
- Live regions for dynamic content updates
|
|
87
|
+
- WordPress Interactivity API + a11y: pair `data-wp-on--click` with `data-wp-on--keydown`
|
|
88
|
+
|
|
89
|
+
Read: `references/interactive-a11y.md`
|
|
90
|
+
|
|
91
|
+
### 4) Media accessibility
|
|
92
|
+
|
|
93
|
+
Ensure all media content has appropriate text alternatives.
|
|
94
|
+
|
|
95
|
+
Key areas:
|
|
96
|
+
- Alt text for images (meaningful vs decorative `alt=""`)
|
|
97
|
+
- Video captions (`<track kind="captions">`) and audio descriptions
|
|
98
|
+
- Audio transcripts as text alternatives
|
|
99
|
+
- SVG accessibility: `role="img"` + `aria-label` or `<title>`
|
|
100
|
+
- WordPress media library alt text handling
|
|
101
|
+
|
|
102
|
+
Read: `references/media-a11y.md`
|
|
103
|
+
|
|
104
|
+
### 5) Automated a11y testing
|
|
105
|
+
|
|
106
|
+
Set up automated accessibility testing to catch regressions early.
|
|
107
|
+
|
|
108
|
+
Key areas:
|
|
109
|
+
- axe-core integration with Playwright (`@axe-core/playwright`)
|
|
110
|
+
- pa11y for quick page-level checks
|
|
111
|
+
- Lighthouse accessibility audits
|
|
112
|
+
- CI pipeline integration
|
|
113
|
+
- Interpreting and prioritizing violations
|
|
114
|
+
|
|
115
|
+
Read: `references/a11y-audit-tools.md`
|
|
116
|
+
|
|
117
|
+
### 6) Manual a11y testing
|
|
118
|
+
|
|
119
|
+
Automated tools catch only ~30-40% of a11y issues. Manual testing is essential.
|
|
120
|
+
|
|
121
|
+
Key areas:
|
|
122
|
+
- Keyboard-only navigation testing
|
|
123
|
+
- Screen reader testing (NVDA, VoiceOver, TalkBack)
|
|
124
|
+
- Zoom testing (200% and 400%)
|
|
125
|
+
- Color contrast verification
|
|
126
|
+
- Reduced motion preference testing
|
|
127
|
+
- Systematic per-page testing checklist
|
|
128
|
+
|
|
129
|
+
Read: `references/a11y-testing.md`
|
|
130
|
+
|
|
131
|
+
## Verification
|
|
132
|
+
|
|
133
|
+
- **axe-core** returns 0 violations at the target WCAG level
|
|
134
|
+
- **Keyboard** works for all interactive elements: focusable, operable, visible focus
|
|
135
|
+
- **Screen reader** announces correctly: landmarks, headings, form labels, updates
|
|
136
|
+
- **Color contrast** passes: 4.5:1 normal text, 3:1 large text (AA)
|
|
137
|
+
- **Heading hierarchy** is logical: single H1, no skipped levels
|
|
138
|
+
- **Skip link** is present and functional
|
|
139
|
+
- **Zoom to 400%** causes no content loss or horizontal scroll
|
|
140
|
+
- **Reduced motion** is respected: animations disabled when preference set
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx pa11y http://localhost:8888
|
|
144
|
+
npx lighthouse http://localhost:8888 --only-categories=accessibility --output=json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Failure modes / debugging
|
|
148
|
+
|
|
149
|
+
| Symptom | Cause | Fix |
|
|
150
|
+
|---------|-------|-----|
|
|
151
|
+
| "Insufficient color contrast" | Ratio below 4.5:1 | Adjust in `theme.json` or CSS |
|
|
152
|
+
| "Images must have alt text" | Missing `alt` | Add via media library or `wp_get_attachment_image()` |
|
|
153
|
+
| "No main landmark" | Missing `<main>` | Add `<main id="main-content">` |
|
|
154
|
+
| "No level-one heading" | Missing/multiple H1 | Single `<h1>` per page |
|
|
155
|
+
| Can't reach element via keyboard | Non-interactive element | Use `<button>` or `<a>` instead of `<div>` |
|
|
156
|
+
| Focus trapped | Bad focus trap | Only trap in modals; release on close |
|
|
157
|
+
| No announcement on update | Missing live region | `aria-live="polite"` or `wp.a11y.speak()` |
|
|
158
|
+
| Wrong reading order | DOM/visual mismatch | Align DOM with visual order |
|
|
159
|
+
| Focus not visible | Outline removed | Use `:focus-visible` with visible style |
|
|
160
|
+
|
|
161
|
+
## Escalation
|
|
162
|
+
|
|
163
|
+
- WordPress Accessibility Handbook: https://make.wordpress.org/accessibility/handbook/
|
|
164
|
+
- WCAG 2.2: https://www.w3.org/TR/WCAG22/
|
|
165
|
+
- ARIA Authoring Practices Guide: https://www.w3.org/WAI/ARIA/apg/
|
|
166
|
+
- WordPress Accessibility Coding Standards: https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/
|
|
167
|
+
|
|
168
|
+
## Recommended Agent
|
|
169
|
+
|
|
170
|
+
For automated accessibility scanning and WCAG compliance reports, use the **`wp-accessibility-auditor`** agent.
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Accessibility Audit Tools
|
|
2
|
+
|
|
3
|
+
Use this file when selecting and configuring tools for accessibility testing.
|
|
4
|
+
|
|
5
|
+
## Automated testing tools
|
|
6
|
+
|
|
7
|
+
### axe-core (Deque)
|
|
8
|
+
|
|
9
|
+
Industry standard engine. Used by Google Lighthouse, Microsoft Accessibility Insights.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# CLI testing
|
|
13
|
+
npx @axe-core/cli https://localhost:8888/
|
|
14
|
+
|
|
15
|
+
# With specific tags
|
|
16
|
+
npx @axe-core/cli https://localhost:8888/ --tags wcag2a,wcag2aa
|
|
17
|
+
|
|
18
|
+
# Save results
|
|
19
|
+
npx @axe-core/cli https://localhost:8888/ --save results.json
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Browser extensions:
|
|
23
|
+
- **axe DevTools** (Chrome/Firefox) — free version covers most WCAG checks
|
|
24
|
+
- **Accessibility Insights** (Microsoft, Chrome) — guided assessments
|
|
25
|
+
|
|
26
|
+
### Playwright integration
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
import { test, expect } from '@playwright/test';
|
|
30
|
+
import AxeBuilder from '@axe-core/playwright';
|
|
31
|
+
|
|
32
|
+
test('homepage has no a11y violations', async ({ page }) => {
|
|
33
|
+
await page.goto('/');
|
|
34
|
+
|
|
35
|
+
const results = await new AxeBuilder({ page })
|
|
36
|
+
.withTags(['wcag2a', 'wcag2aa'])
|
|
37
|
+
.exclude('.third-party-widget') // exclude elements you don't control
|
|
38
|
+
.analyze();
|
|
39
|
+
|
|
40
|
+
expect(results.violations).toEqual([]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test('editor page is accessible', async ({ page }) => {
|
|
44
|
+
await page.goto('/wp-admin/post-new.php');
|
|
45
|
+
|
|
46
|
+
const results = await new AxeBuilder({ page })
|
|
47
|
+
.include('.editor-styles-wrapper') // focus on specific area
|
|
48
|
+
.withTags(['wcag2a', 'wcag2aa'])
|
|
49
|
+
.analyze();
|
|
50
|
+
|
|
51
|
+
expect(results.violations).toEqual([]);
|
|
52
|
+
});
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### pa11y
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Single page
|
|
59
|
+
npx pa11y https://localhost:8888/
|
|
60
|
+
|
|
61
|
+
# With specific standard
|
|
62
|
+
npx pa11y --standard WCAG2AA https://localhost:8888/
|
|
63
|
+
|
|
64
|
+
# Multiple pages
|
|
65
|
+
npx pa11y-ci --config .pa11yci.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`.pa11yci.json`:
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"defaults": {
|
|
72
|
+
"standard": "WCAG2AA",
|
|
73
|
+
"timeout": 30000,
|
|
74
|
+
"wait": 1000
|
|
75
|
+
},
|
|
76
|
+
"urls": [
|
|
77
|
+
"http://localhost:8888/",
|
|
78
|
+
"http://localhost:8888/sample-page/",
|
|
79
|
+
"http://localhost:8888/blog/",
|
|
80
|
+
"http://localhost:8888/contact/"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Lighthouse
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Accessibility audit via CLI
|
|
89
|
+
npx lighthouse https://localhost:8888/ --only-categories=accessibility --output=json --output-path=a11y-report.json
|
|
90
|
+
|
|
91
|
+
# Chrome DevTools: Lighthouse tab → Accessibility checkbox → Generate report
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## WordPress-specific tools
|
|
95
|
+
|
|
96
|
+
### WordPress Accessibility Checker plugin
|
|
97
|
+
|
|
98
|
+
Dashboard widget showing issues per page/post.
|
|
99
|
+
|
|
100
|
+
### FLAVOR (by WordPress a11y team)
|
|
101
|
+
|
|
102
|
+
Browser extension specifically for WordPress theme review. Tests `accessibility-ready` requirements.
|
|
103
|
+
|
|
104
|
+
### WP-CLI health check
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Check theme support for accessibility features
|
|
108
|
+
wp theme mod list
|
|
109
|
+
wp eval "var_dump(current_theme_supports('html5'));"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Color contrast tools
|
|
113
|
+
|
|
114
|
+
### WebAIM Contrast Checker
|
|
115
|
+
|
|
116
|
+
https://webaim.org/resources/contrastchecker/
|
|
117
|
+
|
|
118
|
+
| Ratio | WCAG Level | Applies to |
|
|
119
|
+
|-------|-----------|-----------|
|
|
120
|
+
| 4.5:1 | AA | Normal text (< 24px / 18.66px bold) |
|
|
121
|
+
| 3:1 | AA | Large text (≥ 24px / 18.66px bold) |
|
|
122
|
+
| 7:1 | AAA | Normal text |
|
|
123
|
+
| 4.5:1 | AAA | Large text |
|
|
124
|
+
| 3:1 | AA | UI components and graphical objects |
|
|
125
|
+
|
|
126
|
+
### Programmatic contrast checking
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
// Calculate relative luminance
|
|
130
|
+
function luminance(r, g, b) {
|
|
131
|
+
const [rs, gs, bs] = [r, g, b].map((c) => {
|
|
132
|
+
c = c / 255;
|
|
133
|
+
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
134
|
+
});
|
|
135
|
+
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function contrastRatio(rgb1, rgb2) {
|
|
139
|
+
const l1 = luminance(...rgb1);
|
|
140
|
+
const l2 = luminance(...rgb2);
|
|
141
|
+
const lighter = Math.max(l1, l2);
|
|
142
|
+
const darker = Math.min(l1, l2);
|
|
143
|
+
return (lighter + 0.05) / (darker + 0.05);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Browser DevTools
|
|
148
|
+
|
|
149
|
+
Chrome DevTools: Inspect element → Color picker → Shows contrast ratio and WCAG compliance.
|
|
150
|
+
|
|
151
|
+
Firefox: Accessibility tab in DevTools → Check for Issues → Contrast.
|
|
152
|
+
|
|
153
|
+
## Screen readers
|
|
154
|
+
|
|
155
|
+
### Testing matrix
|
|
156
|
+
|
|
157
|
+
| OS | Screen Reader | Browser |
|
|
158
|
+
|----|--------------|---------|
|
|
159
|
+
| Windows | NVDA (free) | Firefox or Chrome |
|
|
160
|
+
| Windows | JAWS | Chrome or Edge |
|
|
161
|
+
| macOS | VoiceOver (built-in) | Safari |
|
|
162
|
+
| iOS | VoiceOver (built-in) | Safari |
|
|
163
|
+
| Android | TalkBack (built-in) | Chrome |
|
|
164
|
+
|
|
165
|
+
### NVDA quick reference
|
|
166
|
+
|
|
167
|
+
| Key | Action |
|
|
168
|
+
|-----|--------|
|
|
169
|
+
| Insert+Space | Toggle focus/browse mode |
|
|
170
|
+
| H | Next heading |
|
|
171
|
+
| Shift+H | Previous heading |
|
|
172
|
+
| D | Next landmark |
|
|
173
|
+
| Tab | Next focusable element |
|
|
174
|
+
| Insert+F7 | Elements list (links, headings, landmarks) |
|
|
175
|
+
|
|
176
|
+
### VoiceOver quick reference (macOS)
|
|
177
|
+
|
|
178
|
+
| Key | Action |
|
|
179
|
+
|-----|--------|
|
|
180
|
+
| Cmd+F5 | Toggle VoiceOver |
|
|
181
|
+
| VO+Right | Next element |
|
|
182
|
+
| VO+Left | Previous element |
|
|
183
|
+
| VO+U | Rotor (navigate by headings, links, etc.) |
|
|
184
|
+
| Tab | Next focusable element |
|
|
185
|
+
|
|
186
|
+
(VO = Control+Option)
|
|
187
|
+
|
|
188
|
+
## CI/CD integration
|
|
189
|
+
|
|
190
|
+
### GitHub Actions
|
|
191
|
+
|
|
192
|
+
```yaml
|
|
193
|
+
name: Accessibility Tests
|
|
194
|
+
on: [push, pull_request]
|
|
195
|
+
|
|
196
|
+
jobs:
|
|
197
|
+
a11y:
|
|
198
|
+
runs-on: ubuntu-latest
|
|
199
|
+
steps:
|
|
200
|
+
- uses: actions/checkout@v4
|
|
201
|
+
|
|
202
|
+
- name: Start WordPress
|
|
203
|
+
run: npx wp-env start
|
|
204
|
+
|
|
205
|
+
- name: Run axe tests
|
|
206
|
+
run: npx @axe-core/cli http://localhost:8888/ --tags wcag2a,wcag2aa --exit
|
|
207
|
+
|
|
208
|
+
- name: Run pa11y
|
|
209
|
+
run: npx pa11y-ci --config .pa11yci.json
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Audit report template
|
|
213
|
+
|
|
214
|
+
```markdown
|
|
215
|
+
## Accessibility Audit Report
|
|
216
|
+
|
|
217
|
+
**Date:** YYYY-MM-DD
|
|
218
|
+
**Standard:** WCAG 2.2 Level AA
|
|
219
|
+
**Tool:** axe-core 4.x + manual testing
|
|
220
|
+
|
|
221
|
+
### Summary
|
|
222
|
+
- Critical: X issues
|
|
223
|
+
- Serious: X issues
|
|
224
|
+
- Moderate: X issues
|
|
225
|
+
- Minor: X issues
|
|
226
|
+
|
|
227
|
+
### Critical Issues
|
|
228
|
+
1. **[Rule ID]** — Description
|
|
229
|
+
- Location: page/element
|
|
230
|
+
- Impact: who is affected
|
|
231
|
+
- Fix: recommended remediation
|
|
232
|
+
|
|
233
|
+
### Manual Testing Results
|
|
234
|
+
- [ ] Keyboard navigation: Pass/Fail
|
|
235
|
+
- [ ] Screen reader: Pass/Fail
|
|
236
|
+
- [ ] Color contrast: Pass/Fail
|
|
237
|
+
- [ ] Zoom 200%: Pass/Fail
|
|
238
|
+
- [ ] Reduced motion: Pass/Fail
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Verification
|
|
242
|
+
|
|
243
|
+
Automated tools catch ~30-40% of accessibility issues. Always supplement with:
|
|
244
|
+
1. Keyboard-only navigation test
|
|
245
|
+
2. Screen reader walk-through
|
|
246
|
+
3. Color contrast verification
|
|
247
|
+
4. Content zoom to 200%
|
|
248
|
+
5. Reduced motion preference test
|