Josh's WordPress plugin starter
| Name |
|---|
| Getting Started |
| PHP |
| JavaScript |
| Local Development |
| CI/ CD |
This is my – Josh Pollock – opinionated boilerplate and template for WordPress plugin with PSR-4 autoloader, TypeScript, Docker, Github actions, and other fun stuff.
This plugin is a template. You can create a new Github project from this repo using the “Use This Template” button, or by downloading the plugin from Github.
There is a CLI for renaming things, or you can rename things manually.
Notes:
You can create two different versions of the plugin, using the CLI
This option includes everything: local dev, Typescript, composer autoloader, PHP tests, JavaScript tests, etc.
yarnyarn renameThis version has less things, it does not use Yarn workspace or Typescript or composer. It generates one PHP file that can load JS/CSS and a WordPress-friendly webpack that can have any number of entry points.
git clone git@github.com:Shelob9/wordpress-plugin.gityarnyarn rename:basicyarnyarn buildAfter making your own version, I recommend you follow these steps, before running composer install:
wordpress-plugin.php to match your plugin slug.tests/bootstrap.php includes main plugin file.Josh\\WordPressPlugin\\ in both autoloader to match your new root namespace.WordPressPlugin in php files with your root namespace.shelob9.gihub.io with your Github pages site URL.git clone https://github.com/Shelob9/wordpress-plugincomposer installcomposer testnpx wp-env start