Wordpress Plugin Boilerplate
A WordPress plugin boilerplate inspired by WordPress Plugin Boilerplate Generator structured with MVC, PSR-4 autoloading, and PSR-1 coding style in mind.
Install / Use
npx skills add UVLabs/wordpress-plugin-boilerplateInstalls into whichever agent you are using.
README
WordPress MVC Plugin Boilerplate
A WordPress plugin boilerplate made with PS4 autoloading and MVC design pattern in mind.
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.
Steps
Replacements:
Search and replaces (ALL SEARCHES SHOULD BE CASE SENSITIVE):
-
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 separation (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 separation examplemy_plugin_(loose match, case-sensitive) -
Replace '_suffix' 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 separation examplemy-plugin-(exact match [whole word], case-sensitive) -
Rename
RootActivatorandRootDeactivatorclass files insideincludesfolder with the plugin name exampleMyAwesomePluginActivatorandMyAwesomePluginDeactivator -
Replace 'Root' with plugin example
MyAwesomePlugin. This is used as your namespace prefix. (loose match, case-sensitive) -
Replace 'prefix' in file name for your asset files located in
/assetswith a lowercase version of the plugin name, examplemyplugin. USE DASHES for the separation examplemy-plugin- -
Open
dist.shin thebinfolder and replace prefix.zip with the name for your dist file that will be created when you runcomposer distexamplemyplugin.zip -
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])
-
Rename plugin-boilerplate.php in the root folder of the plugin with your actual plugin name. Example
my-awesome-plugin.php -
Replace
SL_DEV_DEBUGGINGwith a constant of your choice. This constant should be defined as true in your local wp install'swp-config.phpfile 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.
Composer
Run composer install
NPM
- Add relevant info to package.json
- Run
npm install
Note
If deploying plugin from github then remove the following lines from the .gitignore file:
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.
Related Skills
node-connect
385.5kDiagnose OpenClaw Android, iOS, or macOS node pairing, QR/setup code, route, auth, and connection failures.
blender-python-addon
40.5kBlender Python add-on rules for operators, panels, properties, registration, testing, and API-safe scripting
flutter-development-guidelines-cursorrules-prompt-file
40.5kCursor rules for Flutter development with MVVM architecture, Riverpod state management, Material widgets, and Dart style guidelines.
commit-push-pr
140.7kCommit, push, and open a PR
