Class based WordPress starter plugin. Accumulate best practices in developing WordPress plugin.
- 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.
- 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.