Skip to content

Wordpress OOP plugin boilerplate with composer and grumphp

License

Notifications You must be signed in to change notification settings

nullwriter/grumpo-wp-bp

Repository files navigation

grumpo-wp-bp

Boilerplate wp plugin following modern php best practices, includes Composer, GrumPHP, PHPCS with PSR-2 standard.

Based on the Wordpress-Plugin-Boilerplate plugin.

Installation

  1. Create folder inside /wp-content/plugins/ with desired plugin name (e.g. /grump-wp-bg)
  2. Open downloaded zip file or git clone this repo inside folder
  3. Rename all "plugin name" to desired name
  4. cd into plugin directory and run composer install
  5. Activate the plugin through the 'Plugins' menu in WordPress

Information

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 reside
  • plugin-name/admin is for all admin-specific functionality
  • plugin-name/public is for all public-facing functionality

You can check some example plugins here using the base boilerplate (same file structure).

Credits

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.