My Plugin
Class based WordPress starter plugin. Accumulate best practices in developing WordPress plugin.
by SM Uddin · github.com/smuddin/wp-boilerplate-plugin · website
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/smuddin/wp-boilerplate-plugin/archive/refs/heads/main.zipWordPress boilerplate plugin
Class based WordPress starter plugin. Accumulate best practices in developing WordPress plugin.
Features
- Class based architecture.
- Uses composer PSR-4 based autoloading. Plugin functionl classes will go under
srcfolder. Class name and file name should match. - Focus on minimal code. Avoid extra comments.
Steps to follow
- Rename the main plugin file from
my-plugin.phpto your plugin's slug. - Search and replace the following texts:
my-plugin,My Plugin,MyPlugin,myPlugin - Rename
languages/my-plugin.potfile to match your plugin's slug. - Remove
"files": ["includes/template-functions.php"]linecomposer.jsonfile andincludes/template-functions.phpfile if you don't have non-class files or any file outsidesrcfolder. - Run
composer installcommand - Final check in
src/Loader.phpandsrc/Plugin.phpfile for any error. - Check required plugin list in
src/Loader.phpfile and update the array accordingly. e.g. Here woocommerce is added as an example. - Remove template folder, if you don't have WC template.
- Remove activation or deactivation code, if you don't need it.