Boilerplate wp plugin following modern php best practices, includes Composer, GrumPHP, PHPCS with PSR-2 standard.
Based on the Wordpress-Plugin-Boilerplate plugin.
- Create folder inside
/wp-content/plugins/
with desired plugin name (e.g. /grump-wp-bg) - Open downloaded zip file or git clone this repo inside folder
- Rename all "plugin name" to desired name
cd
into plugin directory and runcomposer install
- Activate the plugin through the 'Plugins' menu in WordPress
Note that if you include your own classes, or third-party libraries, there are three locations in which said files may go:
plugin-name/includes
is where functionality shared between the admin area and the public-facing parts of the site resideplugin-name/admin
is for all admin-specific functionalityplugin-name/public
is for all public-facing functionality
You can check some example plugins here using the base boilerplate (same file structure).
The Wordpress-Plugin-Boilerplate was started in 2011 by Tom McFarlin and has since included a number of great contributions. In March of 2015 the project was handed over by Tom to Devin Vinson.