Base plugin with testing suite and Docker. Easy setup for VSCode users.
- Docker
- Composer
- Nodejs
- PHP 7+
- XDebug
- PHPUnit
- PHPCS & PHPCBF
If you are using VSCode, I'd suggest installing the following extensions to fully take advantage of the tools.
- PHP Debug - Step through your code by adding breakpoints, trigger on errors, and more.
- PHP Sniffer & Beautifier - Show PHPCS errors and auto fix files on save.
- Run on Save - Run PHPUnit on file save.
Tip: you can add a breakpoint and save any PHP file to trigger XDebug's stepper.
Make sure you are matching case when replacing.
- Abbreviations:
WPP, wpp
- Package:
WP_Plugin_Base
- Container names:
wpp-plugin-db, wpp-plugin-app
- File names:
wp-plugin-base
composer install
docker-compose build wpp (only need to do this once or if you change the Dockerfile)
docker-compose up -d # Start
docker-compose down # Stop
You can now access the WordPress instance at https://localhost:8080
Install scripts for PHPUnit docker-compose exec wpp install-wp-tests
docker-compose exec wpp cr test # runs PHPUnit and PHPCS
docker-compose exec wpp cr phpunit
docker-compose exec wpp cr phpcs
docker-compose exec wpp cr fix # Runs PHPCBF