juvo / wordpress-plugin-boilerplate
A boilerplate for WordPress plugin development. Supercharged with Autoloading, @wordpress/scripts, PHPStan and PHPCS.
Package info
github.com/JUVOJustin/wordpress-plugin-boilerplate
pkg:composer/juvo/wordpress-plugin-boilerplate
Requires
- php: >=8.0
Requires (Dev)
- composer/installers: ^v2
- php-stubs/wp-cli-stubs: ^v2.5.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^2.1.2
- phpunit/phpunit: ^9.6
- szepeviktor/phpstan-wordpress: ^v2.0.1
- wp-cli/wp-cli: ^2
- wp-coding-standards/wpcs: ^3.1.0
- yoast/phpunit-polyfills: ^3.1.1
- dev-main
- v2.1.0
- v2.0.0
- 1.1.0
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.19
- 1.0.18
- 1.0.17
- 1.0.16
- 1.0.15
- 1.0.14
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-chore/ignore-installed-agent-skills
- dev-fix/wp-env-deploy-packaging
- dev-fix/wp-env-composer-bootstrap
- dev-docs/readme-improvements
- dev-fix/deploy-source-branch-version-commit
- dev-fix/distignore-root-anchored-patterns
- dev-copilot/exclude-resource-folder-only
- dev-fix/cleanup-wp-cli-after-setup
- dev-prepare-block-interactivity
- dev-copilot/make-php-version-configurable
- dev-feature/test-plugin-build
- dev-feature/phpcs
- dev-dependabot/npm_and_yarn/follow-redirects-1.15.6
- dev-feature/wp-browser-tests
- dev-renovate/configure
This package is auto-updated.
Last update: 2026-06-11 15:45:20 UTC
README
This repository is a modern, object-oriented WordPress plugin boilerplate. It is intended as a source repo, starter template, and reference implementation for developers and AI coding agents building production-ready plugins.
If you want the user-facing documentation site entry point, start with docs/index.mdx.
What This Repository Includes
- Composer-based PHP structure with namespacing
- Centralized WordPress hook registration through the loader
@wordpress/scriptsfor bundling, linting, and formatting@wordpress/envfor reproducible local WordPress development- PHPUnit application testing in the dedicated
tests-clicontainer - GitHub Actions for analysis, testing, and release automation
- AI-oriented project instructions in
AGENTS.md,.agents/skills/wp-plugin-bp/, and official WordPress skills in.agents/skills/wp-*/
Typical Use
Use this repo when you want to:
- create a new plugin with sane defaults
- inspect the preferred project structure before extending a plugin
- sync an existing plugin with upstream boilerplate changes
- give an AI agent enough repo context to make safe edits
Repository Map
.
|- demo-plugin.php Main bootstrap file only
|- src/ Plugin logic grouped by feature/domain
|- resources/ Admin and frontend assets
|- docs/ Source documentation site content; emptied after plugin setup
|- tests/php/ PHPUnit application tests
|- .agents/skills/wp-plugin-bp/ Unified plugin AI skill with task references
|- .agents/skills/wp-*/ Official WordPress agent skills for focused workflows
|- .github/workflows/ CI/CD workflows
`- README.txt WordPress.org plugin readme template
Local Development
Create a Plugin From the Boilerplate
composer create-project juvo/wordpress-plugin-boilerplate
The setup script asks for the plugin name, namespace, and slug, runs the packaged wp-plugin-bp replacement script, and removes .agents/ from the initialized plugin.
After replacement, setup asks whether to install agent skills for ongoing AI-assisted work.
Common Commands
| Command | Purpose |
|---|---|
npm run env:start |
Start the local WordPress environment |
npm run env:stop |
Stop the environment |
npm run build |
Build production assets |
npm run start |
Watch and rebuild assets during development |
npm run test:php |
Run PHPUnit application tests in wp-env |
npm run lint:js |
Lint JavaScript |
npm run lint:style |
Lint styles |
composer run phpstan |
Run PHP static analysis |
composer run phpcs |
Run WordPress coding standards checks |
composer run i18n:extract |
Extract translatable strings |
composer run i18n:compile |
Compile translation files |
Architecture Notes
- Keep business logic in
src/; do not place it indemo-plugin.php - Register hooks, filters, shortcodes, CLI commands, and abilities through the loader
- Put assets in
resources/admin/andresources/frontend/ - Add PHPUnit application tests in
tests/php/ - Treat
docs/as user-facing documentation and keep it in sync with repo behavior
Where To Look Next
| Goal | Start here |
|---|---|
| Understand the docs site structure | docs/index.mdx |
| Learn local environment workflows | docs/wp-env.mdx |
| Write application tests | docs/testing.mdx |
| Work on bundling or block assets | docs/bundeling.mdx, docs/create-blocks.mdx |
| Configure translations | docs/i18n.mdx |
| Review AI-specific repo rules | AGENTS.md, docs/work-with-ai.mdx, .agents/skills/wp-plugin-bp/SKILL.md |
AI And Maintenance Notes
AGENTS.mdcontains the high-level repository rules and doc map.agents/skills/wp-plugin-bp/contains the unified skill, task references, doc snapshots, and scripts.agents/skills/wp-*/contains official WordPress skills for block development, Interactivity API, PHPStan, project triage, and REST API work- natural requests such as "sync with upstream project conventions" should route through the
wp-plugin-bpskill and infer the upgrade workflow - when repo structure or workflows change, update
README.md, the relevant files indocs/, and.agents/skills/wp-plugin-bp/
Upstream Reference
This plugin was created using the wordpress-plugin-boilerplate. Keep that upstream reference so future updates and comparisons stay straightforward.