Skip to content
/ plugin-name Public template

Boilerplate for building WordPress plugins.

License

Notifications You must be signed in to change notification settings

aochoae/plugin-name

Repository files navigation

Boilerplate for building WordPress plugins.

WordPress Plugin Boilerplate

Boilerplate for building WordPress plugins.

Fundamental

Requirements

  • PHP version 7.0 or greater
  • WordPress 5.0 or greater
  • Docker 20.10 or greater (Development)
  • Grunt 1.4.0 (Development)

Features

PHP Standards Recommendations

WordPress

  • Settings page
  • About page
  • Contextual Help
  • Plugin action links

Install

Composer

composer create-project --no-install --remove-vcs arya/wordpress-plugin your-plugin dev-master
cd your-plugin

You'll need to rename

  1. The directory plugin-name to your-plugin
  2. The file plugin-name.php to your-plugin.php

Then find and replace in all the templates

  1. plugin-name to your-plugin
  2. plugin_name to your_plugin
  3. PLUGIN_NAME to YOUR_PLUGIN
  4. PluginName to YourPlugin (Namespace)

If you are a Linux or macOS user, you can use the command sed

egrep -lRZ 'plugin-name' . | xargs -0 -l sed -i -e 's/plugin-name/your-plugin/g'

Finally, edit the composer.json file to declare plugin dependencies

composer install --prefer-dist

Happy Coding!

Grunt

Install Grunt

sudo npm install --global grunt-cli
npm install --silent

Build (Minify resources)

grunt

Handle the version of the plugin

grunt version

Docker

Create and start the container

docker compose up -d

Stop and remove containers, networks, images, and volumes

docker compose down --volumes

License

This project is licensed under the GNU General Public License, Version 2.0. See LICENSE for the full license text.