Skip to content

Bqd/WordPress-Plugin-Boilerplate-Powered

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#WordPress Plugin Boilerplate Powered

Logo

WordPress Plugin Boilerplate Powered is a complete foundation (without frameworks with many independent libaries ) for building your WordPress plugins.
Look in Recommended tools section of this readme for the Yeoman Generator and Vagrant.
You want to see which plugins have been made with this boilerplate or add them to the list? Check here!
Check the Wiki for other info.

##Features

###Library integrated

###Snippet included

  • Shortcode example code
  • Dashicon as dependence of admin stylesheet
  • Bubble notification on pending cpts
  • Import/Export settings
  • Custom capabilities with cpts and taxonomy support
  • wp_localize_script for pass PHP var to JS in the frontend
  • Class in frontend body with the slug of plugin
  • Support for your CPTs in At glance widget in dashboard
  • Support for CMBF in the options page
  • Integrated DOM-Based Routing of Roots Template

###WordPress Plugin Boilerplate Feature

  • The Plugin Boilerplate Powered is fully-based on the WordPress Plugin API.
  • Uses PHPDoc conventions to document the code.
  • Example values are given, so you can see what needs to be changed.
  • Uses a strict file organization scheme to make sure the assets are easily maintainable.
  • Note that this boilerplate includes a .pot as a starting translation file.

##Shell Script & Tools

###Included

  • wp-boilerplate-version.sh (check below)
  • phpcompatinfo.json for PHP Compat Info
  • .php_cs for PHP-CS-Fixer
  • apigen.sh script for generate a docs folder with the documentation

####wp-boilerplate-version

USE:

wp-boilerplate-version /path/my-new-plugin/ 1.1.1

Change the version in README.txt, plugin-slug.php and public/class-plugin-slug.php

Download the script, move in /usr/local/bin and set the permission

wget -O /usr/local/bin/wp-boilerplate-version https://raw.githubusercontent.com/Mte90/WordPress-Plugin-Boilerplate-Powered/master/wp-boilerplate-version.sh | chmod +x /usr/local/bin/wp-boilerplate-version

####phpcompatinfo

phpcompatinfo analyser:run . --php=">= 5.2"

Check if the plugin can work on PHP 5.2 (minimum requirement for WordPress).
There may be a false positive for JSON_PRETTY_PRINT but in the code there is a version check for this.

###Suggestion

On https://github.com/sudar/wp-plugin-in-github there is many useful snippet for the deploy.

clone-from-svn-to-git.sh - Use this script to clone your WordPress Plugins from SVN into git/github
deploy-plugin.sh - Use this script to push your WordPress Plugin updates to SVN from git/github
readme-converter.sh - Use this script to convert readme files between Github markdown and WordPress repo markdown format
create-archive.sh - Use this script to create a zip archive of the Plugin
update-version.sh - Use this script to update version string in all the files of the Plugin

###Note

##Installation

PS: Use the Yeoman generator in the Generator Tool is better and simple!

  1. Copy the plugin-name directory into your wp-content/plugins directory
  2. Navigate to the Plugins dashboard page
  3. Locate the menu item that reads TODO
  4. Click on Activate

This will activate the WordPress Plugin Boilerplate Powered.
Because the Boilerplate has no real functionality, nothing will be added to WordPress; however, this demonstrates exactly how your plugin should behave while you're working with the Boilerplate.

###Git Clone

git clone --recursive https://github.com/Mte90/WordPress-Plugin-Boilerplate-Powered
cd WordPress-Plugin-Boilerplate-Powered/plugin-name

##Git update submodule

git submodule update --recursive
git submodule foreach git pull origin master

##Recommended Tools

###Generator Tool

For WordPress Plugin Boilerplate Powered exist a Yeoman generator that allows you to choose the libraries you need with a small customization.
Link to repo: https://github.com/Mte90/generator-wp-plugin-boilerplate-powered/

###Vagrant

Exist also a VVV modded version (Vagrant configuration) called VVVWPBP that contain Compass, PHPCompatInfo, ApiGen and Yeoman for a fast development (the missing tool from the original VVV).

###Localization Tools

The WordPress Plugin Boilerplate uses a variable to store the text domain used when internationalizing strings throughout the Boilerplate. To take advantage of this method, there are tools that are recommended for providing correct, translatable files:

Any of the above tools should provide you with the proper tooling to localize the plugin.

##License

The WordPress Plugin Boilerplate Powered is licensed under the GPL v2 or later; however, if you opt to use third-party code that is not compatible with v2, then you may need to switch to using code that is GPL v3 compatible.

About

Wordpress Plugin Boilerplate with steroids (check the readme)! Yeoman generator included!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 92.4%
  • JavaScript 3.9%
  • CSS 2.2%
  • Shell 1.4%
  • HTML 0.1%