Original boilerplate code was made with https://wppb.me/, but changes made to accommodate MVC design pattern and PSR4 autoloading. Some additional tools for WordPress, PHP and JS development were added.
There might be more replacements to be done to get all placeholder text changed but I've tried to list all of them below. Feel free to submit a pull request for any changes.
Run composer install
- Add relevant info to package.json
- Run
npm install
-
Replace 'my_plugin_name' with the Plugin name example
Awesome WordPress Plugin
(exact match [whole word]) -
Replace 'my_plugin_shortname' with a short lowercase version of the plugin name example
awesome_wp_plugin
. USE UNDERSCORES for the sparation (exact match [whole word]) -
Replace 'text-domain' with plugin text domain (exact match [whole word])
-
Replace 'PREFIX' with a prefix for constants (loose match, case sensitive)
-
Replace 'prefix_' with a lowercase version of the plugin name example
myplugin_
etc. USE UNDERSCORES for the sparation examplemy_plugin_
(loose match, case sensitive) -
Replace '_prefix' with lowercase version of plugin name example
_my_plugin
(loose match, case sensitive) -
Replace 'prefix-' with a lowercase version of the plugin name example
myplugin-
etc. USE DASHES for the sparation examplemy-plugin-
(exact match [whole word], case sensitive) -
Replace 'root' in file name for activator and deactivator classes located in
/includes
with a lowercase version of the plugin name, examplemyplugin
. USE DASHES for the sparation examplemy-plugin-
-
Replace
RootActivator
andRootDeactivator
class names with the preferred class names for the activator and deactivator files. (exact match [whole word], case sensitive) -
Replace 'prefix' in file name for your asset files located in
/assets
with a lowercase version of the plugin name, examplemyplugin
. USE DASHES for the sparation examplemy-plugin-
-
Open
dist.sh
in thebin
folder and replace prefix.zip with the name for your dist file that will be created when you runcomposer dist
examplemyplugin.zip
-
Replace 'Root' with a shortname for plugin example
Myplugin
. This is used as your namespace prefix. (exact match, whole word)
You need to run composer dumpautoload
after making this change to refresh autoload file with correct details.
-
Replace 'plugin_author_name' with your name, (exact match [whole word])
-
Replace 'plugin_author_url' with your website, (exact match [whole word])
-
Replace 'plugin_author_email' with your email address (exact match [whole word])
-
Replace
SL_DEV_DEBUGGING
with a constant of your choice. This constant should be defined as true in your local wp install'swp-config.php
file where you work on the plugin. It is used to set the plugin's main debug constant as true and loads the unminified JS of the plugin while working in your local environment.
If deploying plugin from github then remove the following lines from the .gitignore
file:
assets/admin/js/build/ assets/public/js/build/
These are the build files for your JS and should be committed if you're deploying the plugin from github using a plugin like Git Updater.