2.7 KiB
Contributing to Ally – Web Accessibility & Usability
Thank you for your interest in contributing to Ally, the WordPress accessibility plugin built by Elementor.
Prerequisites
Make sure you have the following installed before starting:
- PHP 7.4 or higher
- Composer 2
- Node.js 22 or higher with npm
- Docker (required by
@wordpress/envfor the local WordPress environment)
Setting Up the Environment
To install PHP dependencies:
composer install
To install JavaScript dependencies:
npm install
Build and Assets
The project uses @wordpress/scripts with a custom webpack configuration (webpack.config.js).
Compiled output goes to assets/build/. Source files live under assets/dev/ and within each feature module under modules/<name>/assets/.
To build assets for production:
npm run build
To activate watch mode for development, in order to rebuild assets after making changes:
npm run start
Linting and Coding Standards
The project enforces coding standards across three languages (PHP, JS, CSS). A Husky pre-commit hook (.husky/pre-commit) runs the relevant linters automatically on staged files before each commit.
PHP
Uses PHP_CodeSniffer with the WordPress coding standards, configured in ruleset.xml. The text domain is pojo-accessibility.
npm run lint:php # check for violations
npm run lint:php:fix # auto-fix violations
JavaScript
Uses ESLint with @wordpress/eslint-plugin (React, jsx-a11y strict, Prettier), configured in .eslintrc.
npm run lint:js # check for violations
npm run lint:js:fix # auto-fix violations
CSS / SCSS
Uses Stylelint with @wordpress/stylelint-config, configured in .stylelintrc.
npm run lint:css # check for violations
npm run lint:css:fix # auto-fix violations
All at once
npm run lint
Local Environment
To start the local WordPress environment (requires Docker):
npm run local:start
To install Composer in the local environment:
npm run local:composer:dev
To stop the local environment when you are done:
npm run local:stop
Running Tests
The project uses a suite of PHPUnit tests, located under tests/phpunit/. The tests run inside the local WordPress environment (requires Docker).
To start the local WordPress environment:
npm run local:start
To run the full PHPUnit test suite:
npm run local:phpunit
To run with HTML coverage report (enables Xdebug coverage):
npm run local:phpunit:cov