/generator-wpdtrt-plugin-boilerplate

Scaffold a best-practice boilerplate for WordPress plugin development.

Primary LanguagePHP

DTRT WordPress Plugin Boilerplate Generator

GitHub release Build Status GitHub issues GitHub wiki

Generate a best-practice boilerplate for WordPress plugin development.

The generated plugin utilises the functionality packaged in the DTRT WordPress Plugin Boilerplate dependency.


Installation

  1. Create a Git repo to store the code
  2. Install the generator dependencies
  3. Install the generator
  4. Set up the required environmental variables
  5. Start your MySQL Server
  6. Use the generator to scaffold a custom plugin
  7. Set up Github Actions CI
  8. Use the features of the DTRT WordPress Plugin Boilerplate

Re-installation

This is useful if your node_modules or vendor folders have been deleted or become corrupted.

  1. Reinstall plugin dependencies manually

Migrate an existing generated plugin to the latest boilerplate

  1. Migrate a legacy generated plugin to the latest boilerplate

Maintenance

This generator will need to be periodically updated as technologies change:

  1. Update a previously generated plugin as necessary, see Appendix: Generated plugins
  2. Copy relevant changes over to the DTRT WordPress Plugin Boilerplate
  3. Build, test, version & release the updated DTRT WordPress Plugin Boilerplate, see Release an update
  4. Copy relevant changes over to the DTRT WordPress Plugin Boilerplate Generator
  5. Update the version of the DTRT WordPress Plugin Boilerplate required by the DTRT WordPress Plugin Boilerplate Generator in ./generators/app/templates/composer.json:
"require": {
  "dotherightthing/wpdtrt-plugin-boilerplate": "^1.7.12"
},  
  1. Build, test, version & release the updated DTRT WordPress Plugin Boilerplate Generator
  2. Update previously generated plugins to reference the updated DTRT WordPress Plugin Boilerplate and DTRT WordPress Plugin Boilerplate Generator, see Release an update

Appendix


Respect is due

This plugin is the result of countless hours of research, including these great resources: