Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
202 commits
Select commit Hold shift + click to select a range
a1f35c5
Add properties for some items previously declared dynamically
pattonwebz Jul 14, 2025
e063e2d
Update ordinal test to handle locales with trailing periods
pattonwebz Jul 14, 2025
d3bd777
Add Docker configuration for PHPUnit testing environment
pattonwebz Jul 14, 2025
ec03728
Add a setup script to get phpunit ready to run the tests
pattonwebz Jul 14, 2025
0643d62
Update test:php script to use dockerized test env and some helpers
pattonwebz Jul 14, 2025
5917fdf
Add a few additional new tests
pattonwebz Jul 14, 2025
a6a277b
Add Site Health status checks
SteveJonesDev Jul 24, 2025
3e5ccbf
:rotating_light: lint: Fix tabs vs spaces and other spacingg issues
pattonwebz Jul 24, 2025
ca4b8f1
Rename badge method for clarity and consistency
pattonwebz Jul 24, 2025
0ff8773
Add translation support for scanned posts count in accessibility checker
pattonwebz Jul 24, 2025
eeddef8
Fix more lint spacing issues
pattonwebz Jul 24, 2025
c43ac34
Store the scan_stats summary in a cached property
pattonwebz Jul 24, 2025
f32beb7
Add Clear Issues button to frontend highlighter
SteveJonesDev Jul 25, 2025
33e90d9
Fix missing wp_unslash for settings tab input
SteveJonesDev Jul 26, 2025
e69c7ff
Remove some no longer needed or used npm run commands
pattonwebz Jul 28, 2025
9063688
Update the readme with notes about local dev and running the tests
pattonwebz Jul 28, 2025
c5c73a5
Merge branch 'develop' into william/try/make-docker-phpunit-runner
pattonwebz Jul 28, 2025
7d96de6
Remove update-composer-config.php as no longer needed or called from …
pattonwebz Jul 28, 2025
54f2fe1
Make setup-phpunit.sh file executable
pattonwebz Jul 28, 2025
0badfe5
Update some grammar and clarity things in README.md
pattonwebz Jul 28, 2025
1dfcfe1
Use asterix instead of dash for list delimiter
pattonwebz Jul 28, 2025
83c6f43
Update README for clarity on test requirements
pattonwebz Jul 28, 2025
1955433
Update README for clarity on dev environment and PHP unit tests
pattonwebz Jul 28, 2025
2b5ee35
Initial plan
Copilot Jul 28, 2025
8627627
Add comprehensive unit tests for helper functions and admin utilities
Copilot Jul 28, 2025
2838777
Add final comprehensive unit tests for landmark links, date calculati…
Copilot Jul 28, 2025
a12ec31
Initial plan
Copilot Jul 28, 2025
a11517c
Initial exploration and understanding of the icon stacking issue
Copilot Jul 28, 2025
3582287
Fix WordPress coding standards violations - remove trailing whitespac…
Copilot Jul 28, 2025
040feb3
Fix multiple accessibility icons stacking by implementing inline posi…
Copilot Jul 28, 2025
d335151
Simplify CheckPluginInstalledTest - remove problematic mocking and ad…
Copilot Jul 28, 2025
aac9041
Replace magic number with named constant for tooltip gap
Copilot Jul 28, 2025
c442a55
Use a hash rather than storing the outerHTML on the element
pattonwebz Jul 28, 2025
e3b5722
Use a hash rather than storing the outerHTML on the element
pattonwebz Jul 28, 2025
5dd3c1f
Implement hashString function for generating unique hashes
pattonwebz Jul 28, 2025
4a126ed
Fix WordPress coding standards violations and test environment compat…
Copilot Jul 28, 2025
6237431
Improve tooltip positioning logic to account for creation order
pattonwebz Jul 28, 2025
4913af8
Update to a pre-built phpunit image for faster local test running
pattonwebz Jul 29, 2025
7bec6b6
Merge pull request #1135 from equalizedigital/release/1.29.0
pattonwebz Jul 29, 2025
e6f8775
Merge pull request #1084 from equalizedigital/william/try/make-docker…
pattonwebz Jul 29, 2025
bc1f19c
Initial plan
Copilot Jul 30, 2025
b91b6ef
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
e5ef2c9
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
5cbc632
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
5a87d34
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
a7a8b39
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
3260471
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
f9e6aaf
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
970314a
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
1419ba9
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
b4f986f
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
9ec3e33
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
e94a35c
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
1c35aff
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
b13e52c
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
fb43f45
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
997222d
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
b281d68
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
6d64714
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
f52a81c
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
026b11d
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
5af5b9b
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
69fccfd
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
657eefe
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
abe7d33
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
3050f3b
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
2033ecb
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
2b6b997
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
81ca47e
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
c8df1a7
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
89af776
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
3bcb405
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
0ebcfda
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
9e82919
PTC accessibility-checker (1985): Automatic Translations July 30, 202…
SteveJonesDev Jul 30, 2025
ccd68e7
Update translation files (POT/JSON)
SteveJonesDev Jul 30, 2025
6cec92f
Initial exploration and planning for Copilot agent setup
Copilot Jul 30, 2025
eeaf832
Add Copilot Agent GitHub Actions workflow with caching and Docker sup…
Copilot Jul 30, 2025
0eb0416
Complete Copilot Agent setup with improved error handling and documen…
Copilot Jul 30, 2025
64359dc
Merge pull request #1143 from equalizedigital/update-translations/aut…
pattonwebz Jul 30, 2025
915369b
Merge pull request #1142 from equalizedigital/automatic_translations_…
pattonwebz Jul 30, 2025
3f61a45
Don't suppress composer install errors in workflow
pattonwebz Jul 30, 2025
b859a49
ignore pull failures for containers
pattonwebz Jul 30, 2025
e9f6682
Merge pull request #1141 from equalizedigital/copilot/fix-4f6f8c87-a6…
pattonwebz Jul 30, 2025
d7a3a97
Initial plan
Copilot Jul 30, 2025
9e9fbce
Initial plan
Copilot Jul 30, 2025
ec33ae6
Convert copilot-agent.yml to copilot-setup-steps.yml workflow
Copilot Jul 30, 2025
3694e36
Add comprehensive unit tests for Lazyload_Filter class
Copilot Jul 30, 2025
aef890b
Update copilot-setup-steps.yml
pattonwebz Jul 30, 2025
f4fd117
Merge pull request #1145 from equalizedigital/copilot/fix-c5bd5dfc-6b…
pattonwebz Jul 30, 2025
123ffd0
Initial plan
Copilot Jul 30, 2025
bd7f260
Add comprehensive unit tests for CleanupOrphanedIssues WP-CLI command
Copilot Jul 30, 2025
bd82c6c
Fix test assertions for CleanupOrphanedIssues command output formatting
Copilot Jul 30, 2025
3a2e5c8
Add test case for mixed valid and orphaned issues cleanup scenario
Copilot Jul 30, 2025
f842677
Fix PHP coding standards violations in CleanupOrphanedIssuesTest
Copilot Jul 30, 2025
ea675af
Merge pull request #1146 from equalizedigital/copilot/fix-98ba2468-05…
pattonwebz Jul 30, 2025
f3692a1
Fix code style issues in LazyloadFilterTest
Copilot Jul 30, 2025
ebaf12a
Move tearDown method after setUp method in LazyloadFilterTest.php
Copilot Jul 30, 2025
6568454
Merge pull request #1144 from equalizedigital/copilot/fix-1d636cb8-df…
pattonwebz Jul 30, 2025
015c978
Add test case for YouTube iframe with nearby transcript link
pattonwebz Jul 30, 2025
3c26869
Skip noscript elements when including surrounding text
pattonwebz Jul 30, 2025
43b8c23
Add support for detecting transcript links in sibling elements
pattonwebz Jul 30, 2025
d3c041a
Enhance transcript detection by checking sibling elements
pattonwebz Jul 30, 2025
572c03d
Refactor sibling text collection into a helper function
pattonwebz Jul 30, 2025
0977d37
Refactor sibling text collection limits for transcript detection
pattonwebz Jul 30, 2025
bd445b2
Add copilot instructions file for Accessibility Checker plugin
pattonwebz Jul 31, 2025
5f5d858
Update .github/copilot-instructions.md
pattonwebz Jul 31, 2025
ca3664f
Update .github/copilot-instructions.md
pattonwebz Jul 31, 2025
888f33d
Update .github/copilot-instructions.md
pattonwebz Jul 31, 2025
e073408
Merge pull request #1149 from equalizedigital/william/add-copilot-ins…
pattonwebz Jul 31, 2025
c4852ea
Fix WordPress coding standards violations across all test files
Copilot Jul 31, 2025
6a17791
Merge branch 'develop' into copilot/fix-219ec840-3d80-41f8-a89e-8134b…
pattonwebz Jul 31, 2025
1961251
Fix all test failures and code style violations in utility function t…
Copilot Jul 31, 2025
4f83d68
Initial plan
Copilot Aug 2, 2025
678c49c
Remove obsolete welcome_page_post_count_change_notice function and re…
Copilot Aug 2, 2025
d2d07f2
Revert function modifications and update tests to match original beha…
Copilot Aug 4, 2025
51981ac
Merge pull request #1159 from equalizedigital/copilot/fix-5cc9d4ba-55…
pattonwebz Aug 4, 2025
c28d73a
Merge pull request #1120 from equalizedigital/copilot/fix-219ec840-3d…
pattonwebz Aug 4, 2025
0eda827
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
bfd6631
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
3bcae4f
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
88e953c
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
92791ca
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
24d8ad2
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
0574468
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
6842fc9
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
9eab2e0
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
b74f263
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
45391aa
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
22a5e68
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
98cc3fd
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
c7f76a9
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
ece873c
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
5a89e17
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
2e98c6f
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
77bb5d8
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
1a0434b
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
eb514f9
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
291c1be
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
4fcd15f
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
ba19bbf
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
de46e37
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
4222c5b
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
1fbafe3
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
449b78c
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
b80e11f
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
a1a6e36
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
c3e82d9
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
b697a53
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
9ec68c7
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
1ac9e9d
PTC accessibility-checker (1985): Automatic Translations August 04, 2…
SteveJonesDev Aug 4, 2025
e3833fa
Update translation files (POT/JSON)
SteveJonesDev Aug 4, 2025
371da60
Merge pull request #1115 from equalizedigital/codex/fix-missing-unsla…
SteveJonesDev Aug 4, 2025
35e32ef
Merge pull request #1164 from equalizedigital/update-translations/aut…
pattonwebz Aug 4, 2025
99d6a3c
Merge pull request #1163 from equalizedigital/automatic_translations_…
pattonwebz Aug 4, 2025
c66eba1
Display clear issues results in panel summary
SteveJonesDev Aug 4, 2025
9195849
Initial plan
Copilot Aug 4, 2025
84da595
added: validate required parameters before clearing issues and displa…
SteveJonesDev Aug 4, 2025
7056d75
Hide rescan button for logged-out users
SteveJonesDev Aug 4, 2025
a9b813c
Add comprehensive unit tests for WCAG data structure validation
Copilot Aug 4, 2025
b5f16ba
Merge pull request #1113 from equalizedigital/codex/add-clear-issues-…
SteveJonesDev Aug 4, 2025
66844d6
Add optional chaining for widgetPosition and loggedIn properties
SteveJonesDev Aug 4, 2025
86edbf2
updated: rescan button visibility logic for logged-in users
SteveJonesDev Aug 4, 2025
7ad158c
Merge branch 'develop' into codex/add-logged-in-check-for-rescan-button
SteveJonesDev Aug 4, 2025
a36359b
updated: clear button visibility logic for logged-in users
SteveJonesDev Aug 4, 2025
ead4e56
Exclude wcag.php from the coverage calculations
pattonwebz Aug 4, 2025
b63e59b
added: method to retrieve issues link and improve stats formatting in…
SteveJonesDev Aug 5, 2025
347dae9
added: post types configuration test to site health checks
SteveJonesDev Aug 5, 2025
bd0a9d0
added: unit tests for Site Health Checks functionality
SteveJonesDev Aug 5, 2025
3df2487
Refactor tests for Site Health Checks: improve filter assertion and h…
SteveJonesDev Aug 5, 2025
f50d865
Merge pull request #1106 from equalizedigital/codex/add-wordpress-sit…
SteveJonesDev Aug 5, 2025
c5d6786
Refactor WCAG data tests to use helper methods and reduce assertion c…
Copilot Aug 5, 2025
cb5f430
Merge pull request #1165 from equalizedigital/copilot/fix-ebf044d7-ec…
pattonwebz Aug 5, 2025
5175f88
Merge pull request #1148 from equalizedigital/william/pro-218-missing…
pattonwebz Aug 6, 2025
ce438d6
Merge remote-tracking branch 'origin/develop' into copilot/fix-951
pattonwebz Aug 6, 2025
0769ffa
Merge pull request #1123 from equalizedigital/copilot/fix-951
pattonwebz Aug 6, 2025
95975e9
When logged out there is only a single button, which needs grid layout
pattonwebz Aug 6, 2025
949e01f
Create a single simplified logged in check condition
pattonwebz Aug 6, 2025
ba933c7
If we are outputting a single button on 2nd row add the class
pattonwebz Aug 6, 2025
17afb68
Merge pull request #1167 from equalizedigital/codex/add-logged-in-che…
SteveJonesDev Aug 6, 2025
e97bff8
Update the POT file with latest string changes
pattonwebz Aug 6, 2025
8b54602
Bump version * Version: 1.29.0 -> 1.30.0
pattonwebz Aug 6, 2025
7320f5d
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
13a693b
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
0b24e56
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
f795742
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
5cd0dcf
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
7e85be9
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
e2dd0af
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
d0c2d90
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
eded89e
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
4ba70a1
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
12e172b
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
8f79d68
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
73f83e3
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
8a01c9a
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
14d303c
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
6282537
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
a6e1f96
PTC accessibility-checker (1985): Automatic Translations August 06, 2…
SteveJonesDev Aug 6, 2025
e38677d
Update changelog for version 1.30.0
pattonwebz Aug 6, 2025
81124b0
updated: readme to only have the last two version. Moved the rest to …
SteveJonesDev Aug 6, 2025
ba1df18
Updated: readme and changelog to include details for versions 1.27.0,…
SteveJonesDev Aug 6, 2025
b1e7cc4
Merge pull request #1175 from equalizedigital/automatic_translations_…
pattonwebz Aug 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
356 changes: 356 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,356 @@
# Copilot Instructions for Accessibility Checker

## Project Overview

This is a WordPress plugin called "Accessibility Checker" developed by Equalize Digital. The plugin provides in-post accessibility scanning and guidance to help users audit their websites for accessibility compliance before and after publishing content. It focuses on WCAG (Web Content Accessibility Guidelines) compliance and does not require any API or per-page fees.

**Key Details:**
- Plugin Name: Accessibility Checker
- Minimum PHP: 7.4
- Text Domain: accessibility-checker
- Namespace: EqualizeDigital\AccessibilityChecker

## Architecture & Structure

### Core Plugin Structure
- **Main file**: `accessibility-checker.php` - Plugin bootstrap and constants
- **Admin classes**: Located in `/admin/` directory with class-based architecture
- **Core functionality**: Located in `/includes/` directory
- **Frontend assets**: Built files in `/build/`, source files in `/src/`
- **Language files**: Located in `/languages/` directory

### Coding Standards
- Follow WordPress coding standards (WPCS) in all php files
- Use PSR-4 autoloading with EqualizeDigital\AccessibilityChecker namespace
- Legacy files are autoloaded using EDAC namespace.
- Class names use `ClassNameConvention` (CamelCase)
- Legacy class names use `Class_Name_Convention` (WordPress style)
- File names use `ClassNameConvention.php` for new classes (CamelCase)
- Legacy file names use `class-class-name.php` (WordPress style)
- Use WordPress hooks and filters appropriately
- Use `edac_` prefix for custom hooks and filters

### PHP Guidelines
- Minimum PHP 7.4 compatibility
- Use type hints where appropriate
- Follow WordPress security best practices (sanitization, validation, nonces)
- Use WordPress database API (wpdb) for database operations
- Prefix all functions and classes with `edac_` when in global namespace

### WordPress Integration
- Use WordPress hooks (actions/filters) for extensibility
- Follow WordPress plugin development best practices
- Implement proper activation/deactivation hooks
- Use WordPress transients for caching
- Follow WordPress internationalization (i18n) practices

## Development Workflow

Code should always be linted by phpcs and eslint before committing. Tests should be added for new functionality. Tests should also be added for any bug fixes. Use the following commands to run tests and linting:

```bash
npm run lint:php
npm run lint:js
npm run test:php
npm run test:jest
```

There are autofixers available for both PHP and JavaScript linting. Use the following commands to fix linting issues:

```bash
npm run lint:php:fix
npm run lint:js:fix
```

### Complete Command Reference

#### Testing
- `npm run test:jest` - Run JavaScript tests
- `npm run test:php` - Setup and run PHP tests with Docker
- `npm run test:php:run` - Run PHP tests in existing container
- `npm run test:php:coverage` - PHP unit tests with coverage report
- `composer test` - Run PHP tests directly
- `docker-compose exec phpunit ./vendor/bin/phpunit ./tests/phpunit/path/to/TestFile.php` - Run a single PHPUnit test file (container must be running first)

#### Linting & Code Quality
- `npm run lint` - Run all linters (PHP + JS)
- `npm run lint:php` - Run PHP linter (PHPCS)
- `npm run lint:js` - Run JavaScript linter (ESLint)
- `npm run lint:php:fix` - Fix PHP linting issues
- `npm run lint:js:fix` - Fix JavaScript linting issues
- `composer lint` - Run PHP parallel lint
- `composer check-cs` - Check PHP code standards
- `composer fix-cs` - Fix PHP code standards

#### Building
- `npm run build` - Build production assets with webpack
- `npm run dev` - Build development assets with watch mode

### Docker Environment

PHP tests use Docker containers:
- **MySQL 5.7** (`db-phpunit`) - Database for WordPress testing
- **WordPress Testing Environment** (`phpunit`) - Custom container with WordPress + PHPUnit

### Troubleshooting Development Issues

- **Cypress Issues**: If Cypress download fails, run `npm config set ignore-scripts false && npm run postinstall`
- **Composer Timeouts**: Handle network timeouts gracefully with partial installations
- **Docker Issues**: Containers may need to be restarted if they fail to initialize properly
- **PHP Tests**: WordPress installation in Docker may occasionally need retry

### Code Quality Tools
- **PHP CodeSniffer**: Configuration in `phpcs.xml`
- **PHPStan**: Configuration in `phpstan.neon`
- **PHPUnit**: Test configuration in `phpunit.xml.dist`
- **ESLint**: JavaScript linting with `.eslintrc`

### Build Process
- **Webpack**: Frontend asset compilation via `webpack.config.js`
- **Composer**: PHP dependency management
- **NPM**: JavaScript dependency management

### Testing
- PHPUnit tests located in `/tests/phpunit` directory
- Jest tests for JavaScript in `/tests/jest/` directory.
- Use `npm run test:jest` for JavaScript tests
- Use `npm run test:php` for PHP unit tests
- Use `npm run test:php:coverage` for PHP unit tests with coverage report
- Use WordPress testing framework where applicable

## Accessibility Focus

This plugin is specifically designed for accessibility auditing, so when contributing:

### WCAG Compliance
- Follow WCAG 2.1 AA guidelines in all code
- Ensure proper semantic HTML structure
- Implement proper ARIA attributes
- Maintain keyboard navigation support
- Ensure proper color contrast

### Accessibility Patterns
- Implement proper focus management
- Provide alternative text for images
- Use proper heading hierarchy
- Ensure screen reader compatibility

## Key Components

### Scanner Engine
- Automated accessibility rule checking
- WCAG guideline implementation
- Issue detection and reporting
- Powered by axe-core library with custom rules

### Admin Interface
- Settings pages with accessibility considerations
- Meta boxes for post-level scanning
- Dashboard widgets and statistics
- Welcome pages and upgrade promotions

### Frontend Features
- Highlight accessibility issues on frontend
- User-facing accessibility fixes
- Statement generation capabilities

## Dependencies & Libraries

### PHP Dependencies (Composer)
- WordPress coding standards
- PHPStan for static analysis
- Custom forked textstatistics library

### JavaScript Dependencies (NPM)
- Webpack for bundling
- ESLint for code quality
- Various build tools and utilities

## File Naming Conventions

### PHP Files
- Classes: `ClassName.php`
- Legacy Classes: `class-class-name.php`
- Functions: `functions-purpose.php`
- Includes: `purpose.php`

### JavaScript Files
- Components: `ComponentName.js`
- Utilities: `utilityName.js`
- Bundles: `bundleName.bundle.js`

### CSS Files
- Stylesheets: `style-name.css`
- Admin styles: `admin-purpose.css`

## Database & Performance

- Use WordPress database API exclusively
- Implement proper caching strategies
- Consider performance impact at all times
- Use WordPress transients for temporary data storage where appropriate

## Internationalization

- All user-facing text must be translatable
- Use `accessibility-checker` text domain
- Follow WordPress i18n best practices
- Support RTL languages where applicable
- Strings in javascript also need translation support using `wp.i18n` functions

## Security Considerations

- Sanitize all user inputs
- Validate and escape all outputs
- Use WordPress nonces for form submissions
- Follow WordPress security guidelines
- Implement proper capability checks

## Plugin Hooks & Filters

When adding new functionality:
- Provide appropriate hooks for extensibility
- Use descriptive hook names with `edac_` prefix
- Document all custom hooks in docblocks
- Consider backward compatibility


## When Working on This Codebase

1. **Always consider accessibility implications** of any changes
2. **Test with screen readers** when modifying frontend components
3. **Follow WordPress plugin guidelines** strictly
4. **Maintain backward compatibility** with existing installations
5. **Document any new features** thoroughly
6. **Write tests** for new functionality
7. **Consider performance impact** of any changes

## Common Patterns

### Class Structure
```php
namespace EqualizeDigital\AccessibilityChecker;

class ExampleClass {
public function __construct() {
// never add actions right in the constructor
}

public function init() {
// Implementation
}
}
```

### Hook Implementation
```php
// Add filter with proper priority
add_filter( 'edac_custom_filter', [ $this, 'filter_callback' ], 10, 2 );

// Use descriptive hook names
do_action( 'edac_after_scan_complete', $post_id, $results );
```

### Error Handling, Code Review & Collaboration, and Performance Optimization
- Use WordPress error handling functions (e.g., WP_Error) for PHP errors.
- Log errors and warnings in a way that does not expose sensitive information.
- Gracefully handle JavaScript errors to avoid breaking accessibility features.
- Submit pull requests with clear descriptions and testing instructions.
- Tag accessibility-related changes for focused review.
- Use GitHub Actions workflows for automated linting and testing.
- Minimize DOM operations in JavaScript for frontend scanning.
- Avoid blocking queries in PHP, especially during scans.
- Profile and optimize accessibility scans for large posts/pages.

### Accessibility Testing Tools
- Use axe-core browser extension for manual accessibility checks.
- Test with multiple screen readers (NVDA, JAWS, VoiceOver).
- Validate color contrast with tools like Color Contrast Analyzer.

### Release Management
- Follow semantic versioning for plugin releases.
- Update changelog.txt and readme.txt for each release.
- Tag releases in GitHub and WordPress.org.

## Additional Guidance for Copilot and Contributors

### Documentation
- Use PHPDoc for all public classes, methods, and properties.
- Document custom hooks and filters with clear descriptions and parameter types.
- Update README.md and changelog.txt for any user-facing or API changes.
- Add inline comments for complex accessibility logic or non-obvious code.

### Testing Best Practices
- Write unit tests for new PHP functions and classes.
- Add integration tests for major features and accessibility rules.
- Use Jest for JavaScript unit tests and axe-core for accessibility assertions.
- Test with multiple browsers and assistive technologies.

### Accessibility-First Development
- Prioritize accessibility in UI/UX decisions and code reviews.
- Avoid introducing overlays or solutions that mask real accessibility issues.
- Prefer native HTML elements over custom widgets unless necessary.
- Ensure all interactive elements are reachable and usable by keyboard.

### Performance & Scalability
- Profile accessibility scans for large posts and optimize queries.
- Use batch processing for bulk scans to avoid timeouts.
- Cache scan results where possible, but always allow for manual refresh.

### Security & Privacy
- Never log or expose sensitive user data in error messages or debug output.
- Validate all AJAX requests and REST endpoints with nonces and capability checks.
- Escape all output, especially in admin screens and user-generated content.

### Release & Maintenance
- Use semantic versioning and tag releases in both GitHub and WordPress.org.
- Deprecate legacy code with clear docblocks and migration notes.
- Monitor for new WCAG updates and update rules as needed.

---

## Accessibility Issue Types (for reference)
- Color contrast
- Missing or incorrect alt text
- Improper heading structure
- ARIA misuse or missing attributes
- Keyboard navigation issues
- Form labeling and instructions
- Link purpose and context
- Dynamic content updates (ARIA live regions)

---

## Quick Reference: Accessibility Checklist
- Semantic HTML structure
- ARIA attributes used correctly
- Keyboard navigation supported
- Sufficient color contrast
- Focus management implemented
- Images have descriptive alt text
- Heading hierarchy logical
- Screen reader compatibility
- Forms are accessible and labeled
- No accessibility regressions introduced

---

## Resources

### Documentation & Guidelines
- [WordPress Plugin Handbook](https://developer.wordpress.org/plugins/)
- [WCAG 2.1 Guidelines](https://www.w3.org/WAI/WCAG21/quickref/)
- [axe-core Documentation](https://github.com/dequelabs/axe-core)
- [WordPress Accessibility Coding Standards](https://make.wordpress.org/core/handbook/best-practices/accessibility/)

### Testing & Development Tools
- [WAVE Web Accessibility Evaluation Tool](https://wave.webaim.org/)
- [Deque axe DevTools](https://www.deque.com/axe/devtools/)
- [Color Contrast Analyzer](https://developer.paciellogroup.com/resources/contrastanalyser/)

### Screen Readers
- [NVDA Screen Reader](https://www.nvaccess.org/)
- [JAWS Screen Reader](https://www.freedomscientific.com/products/software/jaws/)
- [VoiceOver (macOS/iOS)](https://www.apple.com/accessibility/)

This plugin helps make the web more accessible - keep that mission in mind with every contribution!
Loading
Loading