This generator (based on PHP) parse the WordPress Plugin Boilerplate Powered and remove the stuff that you don't need.
Let's have a look on what you need and how to install it:
sudo apt install php php-zip php-mbstring php-yaml
sudo dnf install php php-zip php-mbstring php-yaml
brew install pkg-config zlib
pecl install zip mbstring yaml
(source: https://grrr.tech/posts/installing-homebrew-php-extensions-with-pecl)
From here you can download the phar version or you can chose to install it with composer:
composer global require wpbp/generator:dev-master
Add this directory to your PATH in your ~/.bash_profile (or ~/.bashrc) like this:
export PATH=~/.composer/vendor/bin:$PATH
wpbp-generator --help
to get a list of commands
--dark
Use a dark theme for console output.
--dev
Download from the master branch (the development version).
--help
Show the help page for this command.
--json
Generate a wpbp.json file in the current folder. Suggested to use the WordPress plugin folder.
--no-download
Do you want to execute composer and npm manually? This is your flag!
--verbose
Verbose output. Because this can be helpful for debugging!
This file contains all the default variables that will be used to scaffold the boilerplate.
- plugin/author section includes Plugin names for the WordPress plugin standard but also the Comments section in every file
- public-assets section includes code for frontend that enqueue CSS and JS file
- act-deact section includes the code on activation/deactivation of the plugin itself and the uninstall.php file
- admin-assets section includes code for backend that enqueue CSS and JS file,
settings
values are for the Plugin setting page and admin for the rest of backend,admin-page
add a new setting plugin page - ajax section add code for WordPress Ajax system for logged/non-logged users
- git-repo execute automatically
git init
in the folder created - block adds the support for a custom block, grumphp adds the support for GrumPHP and phpstan for PHPStan
- phpcs/phpstan enable predefined settings and rulesets for this tools
- unit-test adds the
tests
folder andcodeception.dist.yml
file with the various packages for composer about Codeception - wpcli adds the support in the plugin code for the WP-CLI tool
- language-files adds the po/mo files and the code to load custom languages files
- libraries includes all the composer packages that will be downloaded with the related example code in the boilerplate itself, removing them will not add it
- snippet in the various subsections add specific code snippet integrated for the various needs in WordPress, removing them will not add it