sightpress / plugin-template
The starting point for a new SightPress plugin.
Package info
github.com/sightpress/sightpress-plugin-template
Type:project
pkg:composer/sightpress/plugin-template
Requires
- php: ^8.4
- sightpress/plugin-core: ^1.0
Requires (Dev)
- deptrac/deptrac: ^4.0
- friendsofphp/php-cs-fixer: ^3.64
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^13.0
- rector/rector: ^2.0
- sightpress/core: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-06 09:41:26 UTC
README
sightpress/plugin-template: the starting point for a new SightPress plugin.
Licensed GPL-2.0-or-later.
Status: M0 scaffolding complete.
bin/setupgenerates a plugin that passes the full quality bar with the plugin-core test kit; the tests that need the core's test kernel skip untilsightpress/coreships it.
composer create-project sightpress/plugin-template acme-events cd acme-events php bin/setup # asks for the plugin id, vendor, namespace and name
Without a terminal, give the answers as options:
php bin/setup --id=acme.events --name=Events --vendor=acme --namespace='Acme\Events'.
Official plugins use a bare id and the vendor sightpress. To scaffold an
existing checkout, run
php bin/setup --id=form-builder --name=FormBuilder --target=../plugin-form-builder --keep-readme.
You get a plugin that already passes the full SightPress bar:
composer.jsonwith the manifest underextra.sightpress, requiringsightpress/plugin-core(andsightpress/corefor tests only);- the bundle class extending
AbstractPlugin, andContract/,Domain/,Application/,Infrastructure/andUI/folders; migrations/,templates/(extending the core layouts),translations/(XLIFF catalogues for all 11 launch interface languages, with English (United Kingdom) as the source) andassets/(Stimulus, enhancement only). Official plugins keep all 11. A third-party plugin only needs English (United Kingdom): remove the catalogues you won't maintain and their codes fromextra.sightpress.locales, and the checks cover only what's left;- tests on
PluginTestCase, enabled and disabled checks, and Playwright + axe on every manifest route (skipped with a reason until a site is served); - Deptrac (a plugin depends only on
plugin-coreand theContract\of the plugins it requires, never on the core), PHPStan at the maximum level, PHP-CS-Fixer and Rector; - CI that runs every gate, plus the browser tests.
Development
COMPOSER=composer.dev.json composer install # sibling checkouts of plugin-core and core composer qa # tests, static analysis, style, Rector, Deptrac, translations SIGHTPRESS_TEMPLATE_FULL_CHECK=1 vendor/bin/phpunit tests/Template # generate a plugin and run every gate on it
Official plugins (plugin-articles, plugin-community-helper, plugin-form-builder,
plugin-newsletter-manager, plugin-notifications-helper, plugin-image-finder, plugin-ai-helper,
plugin-file-importer, …) are made from this template. When the plugin conventions
change, change the template in the same change set.