Typical workflow
This document outlines a typical workflow for developing a WordPress plugin. It includes starting a Vagrant or Valet environment, accessing the WordPress Host plugins folder from your Client Host, creating a new repository using the WP Kirk Boilerplate template on GitHub, and cloning the WP Kirk repository. It also advises removing the .git folder if you cloned the repository instead of using the template to create your own Git repository.
Start your Vagrant / Valet environment
Before starting, you have to prepare your developing and testing environment. To do this, you can use a Vagrant WordPress or the Valet solution. We call this environment WordPress Host.
Client Host
If you are on Mac, Window or Linux, I’ll assume you have access to WordPress Host plugins folder by your Client Host.
Using the WP Kirk template
On GitHub, you can create a new repository using the WP Kirk Boilerplate by clicking on the “Use this template” button on the repository page.

Clone the WP Kirk Boilerplate repository
You may also clone the repository using either the Git command line or the Github for Mac application.
Change directory to the wp-content/plugins folder of your local WordPress installation.
cd wp-content/pluginsgit clone -b main https://github.com/wpbones/WPKirk-Boilerplate.git <your plugin folder>If you have cloned the repository instead of using the GitHub template, you should remove the .git folder before creating your own Git repository.
Therefore, run
rm -rf .gitInstall the dependencies packages to compile the assets
From inside your plugin folder, run:
npm installCheck the installation
Next, from inside your plugin folder try to run:
php bonesYou must use php bones from WordPress Host, because it needs to load WordPress environment.
Naming your plugin
From the WordPress Host execute:
php bones installNext, set the plugin name and the plugin namespace.
php bones rename <your-plugin-name> <your-plugin-namespace>Start developing
Well, now you can go to WordPress backend admin area and activate your plugin and start developing.
Also, review the readme.txt file and the {plugin-name}.php in order to complete the plugin information.
Remember to review the WordPress guide lines and check periodically any WP Bones update, by using:
php bones updateOf course, you can start to work on styles and JavaScript by using the whatcher provided by the package.json file.
npm run startAll the assets in resources/assets are compiled and copied to the public folder.
Your development source assets:
- my-styles-1.less
LESS - my-styles-2.scss
SASS
- my-script.js
JavaScript - my-hook.ts
TypeScript - my-react-component.jsx
ReactJS
Will be compiled and copied to the public folder:
- my-styles-1.css
CSS - my-styles-2.css
CSS
- my-script.js
JavaScript - my-hook.js
JavaScript - my-react-component.js
JavaScript
Plugin Version
Before creating your plugin deploy version, probably you would update the plugin version. You may use
php bones versionYou may use a specific version
php bones version --pre-patchTake a look at how plugin versioning works versioning works
or auto-increment one of major.minor.patch value
php bones version --patchRemember to follow SemVer rules. Here](https://semver.org/ ) you may found more information about SemVer
Before submitting
When your plugin is ready and you are satisfied with it, you can prepare a deploy version, by using:
php bones deploy ../deploy-versionThe deploy command will run also the build command, so the assets will be compressed and minified.
Submit to WordPress repository
Due to the WordPress repository rules, you have to prepare a deploy version of your plugin. You can use the deploy command along with the --wp option.
php bones deploy ../deploy-version --wpRead more about the Before submit to WordPress repository.
You can copy the deploy-version content in the WordPress trunk subversion folder. Add and commit your files.
