This
Yeoman generator for PSR-4 WordPress plugins. This is based off the webdevstudios generator
Pre-requisites: You'll need node which comes with npm.
If you don't have Yeoman installed:
npm install -g yo
To install generator-plugin-scaffold from npm, run: (not published yet)
npm install -g generator-plugin-scaffold
To install generator-plugin-scaffold from git, run:
npm install -g git+https://github.com/redpandaventures/generator-plugin-scaffold
To use generator-plugin-scaffold, cd
to your WordPress plugins folder and:
yo plugin-scaffold
You'll be prompted with steps for creating your plugin.
By default the plugin generator includes some built in tests for you to add on to as you develop your plugin. Theses
To run these tests run the install-wp-tests.sh
script
in the bin folder with the proper database details for your local setup.
Once you've run the install-wp-tests.sh
script you can run just phpunit
in
the main folder of your plugin.
If you don't want tests included in your plugin when it is generated run the
main generator with the --notests
option.
By default PHP 7.2 is is the minimum version supported for this generator.