A WordPress plugin to help you optimize your image alternative texts and make your site more accessible.
- Media library filters for images with/without alt text
- Help tab in the media library about alt texts
- Quick-edit alt texts directly in the media library list view
- Frontend inspector module to highlight images missing alt text on your site
- Settings page to enable/disable features and configure modules
- Extensible via WordPress hooks and filters
- Upload the plugin files to the
/wp-content/plugins/altinatordirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the 'Plugins' screen in WordPress.
- (Optional) Configure the plugin via the "Altinator" settings under Settings > Altinator.
- altinator/boot: Fires after the plugin and all its services are booted. Use this to boot your own service providers/services after Altinator is ready.
- altinator/init_container: Fires after the DI container is initialized. Allows adding/changing services or providers.
- altinator/migration: Fires after plugin migrations are run. Params: new version, old version.
- altinator/activation: Fires after plugin activation code. Param: main plugin instance.
- altinator/deactivation: Fires after plugin deactivation code. Param: main plugin instance.
- altinator/media_library/enable: Filter whether the Media Library module (filter, quick edit, help tab) is enabled.
- altinator/frontend_inspector/enable: Filter whether the Frontend Inspector module is enabled.
- altinator/frontend_inspector/capability: Filter the capability required to activate the Frontend Inspector module. Defaults to 'upload_files'.
- altinator/frontend_inspector/active: Filter whether the Frontend Inspector module is active on this request (base value is set via frontend inspector URL param).
- altinator/frontend_inspector/tooltip: Filter the HTML for the frontend inspector tooltip.
- altinator/alt_fallback/enable: Filter whether the Alt Fallback module is enabled.
- altinator/alt_fallback/blocks: Filter the blocks that should have the alt fallback applied.
- altinator/ai_alt_generation/enable: Filter whether the AI Alt Generation module is enabled.
- altinator/ai_alt_generation/capability: Filter the capability required to generate alt text. Default: upload_files.
- altinator/ai_alt_generation/api_key: Filter the API key used for AI alt generation.
- altinator/ai_alt_generation/api_base: Filter the API base URL for AI alt generation.
- altinator/ai_alt_generation/context: Filter the context array used for AI generation (attachment id, language, image src, etc).
The local development environment is based on DDEV.
After the first setup, remove the ##ddev-generated header from the wp-config.php file and change the ddev-include code
to
$ddev_settings = __DIR__ . '/wp-config-ddev.php';
if ( getenv( 'IS_DDEV_PROJECT' ) == 'true' && is_readable( $ddev_settings ) ) {
require_once( $ddev_settings );
}It is recommended to run all tasks inside the ddev container.
- PHP code style:
composer run phpcs/composer run phpcs:fix - PHPStan:
composer run phpstan - Code quality:
composer run code-quality - Tests: WP-Browser and Codeception
- JS/CSS formatting:
npm run format - JS/CSS build:
npm run build - Translations:
composer run i18n - Build plugin zip:
composer run build
- Run linting, phpcs, phpcs:fix + phpstan
- Update version
- in main plugin file headers (
/altinator.php) - in
src/Plugin.php - in
package.json - in
composer.json+ runddev composer update -- --lock - stable tag in
readme.txt
- in main plugin file headers (
- Add changelog entry in
readme.txtandCHANGELOG.md - Update "Tested up to" as needed
- Run translation updates
- Create PR/merge into main (triggers CI jobs)
- Create a new release with a new tag in main
vX.Y.Zwith changelog
GPL-3.0-or-later
If you believe you have found a security vulnerability, please do not create a public issue or post it publicly anywhere else. You can responsibly disclose the problem directly via GitHubs security reporting feature via email to mail at fabiantodt.at