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
- 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
- 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.phpfor 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
- 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
- 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
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:
npm run lint:php
npm run lint:js
npm run test:php
npm run test:jestThere are autofixers available for both PHP and JavaScript linting. Use the following commands to fix linting issues:
npm run lint:php:fix
npm run lint:js:fixnpm run test:jest- Run JavaScript testsnpm run test:php- Setup and run PHP tests with Dockernpm run test:php:run- Run PHP tests in existing containernpm run test:php:coverage- PHP unit tests with coverage reportcomposer test- Run PHP tests directlydocker-compose exec phpunit ./vendor/bin/phpunit ./tests/phpunit/path/to/TestFile.php- Run a single PHPUnit test file (container must be running first)
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 issuesnpm run lint:js:fix- Fix JavaScript linting issuescomposer lint- Run PHP parallel lintcomposer check-cs- Check PHP code standardscomposer fix-cs- Fix PHP code standards
npm run build- Build production assets with webpacknpm run dev- Build development assets with watch mode
PHP tests use Docker containers:
- MySQL 5.7 (
db-phpunit) - Database for WordPress testing - WordPress Testing Environment (
phpunit) - Custom container with WordPress + PHPUnit
- 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
- PHP CodeSniffer: Configuration in
phpcs.xml - PHPStan: Configuration in
phpstan.neon - PHPUnit: Test configuration in
phpunit.xml.dist - ESLint: JavaScript linting with
.eslintrc
- Webpack: Frontend asset compilation via
webpack.config.js - Composer: PHP dependency management
- NPM: JavaScript dependency management
- PHPUnit tests located in
/tests/phpunitdirectory - Jest tests for JavaScript in
/tests/jest/directory. - Use
npm run test:jestfor JavaScript tests - Use
npm run test:phpfor PHP unit tests - Use
npm run test:php:coveragefor PHP unit tests with coverage report - Use WordPress testing framework where applicable
This plugin is specifically designed for accessibility auditing, so when contributing:
- 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
- Implement proper focus management
- Provide alternative text for images
- Use proper heading hierarchy
- Ensure screen reader compatibility
- Automated accessibility rule checking
- WCAG guideline implementation
- Issue detection and reporting
- Powered by axe-core library with custom rules
- Settings pages with accessibility considerations
- Meta boxes for post-level scanning
- Dashboard widgets and statistics
- Welcome pages and upgrade promotions
- Highlight accessibility issues on frontend
- User-facing accessibility fixes
- Statement generation capabilities
- WordPress coding standards
- PHPStan for static analysis
- Custom forked textstatistics library
- Webpack for bundling
- ESLint for code quality
- Various build tools and utilities
- Classes:
ClassName.php - Legacy Classes:
class-class-name.php - Functions:
functions-purpose.php - Includes:
purpose.php
- Components:
ComponentName.js - Utilities:
utilityName.js - Bundles:
bundleName.bundle.js
- Stylesheets:
style-name.css - Admin styles:
admin-purpose.css
- Use WordPress database API exclusively
- Implement proper caching strategies
- Consider performance impact at all times
- Use WordPress transients for temporary data storage where appropriate
- All user-facing text must be translatable
- Use
accessibility-checkertext domain - Follow WordPress i18n best practices
- Support RTL languages where applicable
- Strings in javascript also need translation support using
wp.i18nfunctions
- Sanitize all user inputs
- Validate and escape all outputs
- Use WordPress nonces for form submissions
- Follow WordPress security guidelines
- Implement proper capability checks
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
- Always consider accessibility implications of any changes
- Test with screen readers when modifying frontend components
- Follow WordPress plugin guidelines strictly
- Maintain backward compatibility with existing installations
- Document any new features thoroughly
- Write tests for new functionality
- Consider performance impact of any changes
namespace EqualizeDigital\AccessibilityChecker;
class ExampleClass {
public function __construct() {
// never add actions right in the constructor
}
public function init() {
// Implementation
}
}// 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 );- 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.
- 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.
- Follow semantic versioning for plugin releases.
- Update changelog.txt and readme.txt for each release.
- Tag releases in GitHub and WordPress.org.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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)
- 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
- WordPress Plugin Handbook
- WCAG 2.1 Guidelines
- axe-core Documentation
- WordPress Accessibility Coding Standards
This plugin helps make the web more accessible - keep that mission in mind with every contribution!