Conflicts: ChangeLog.md README.md plugin-name/admin/class-plugin-name-admin.php plugin-name/plugin-name.php plugin-name/public/class-plugin-name.php plugin-name/trunk/README.txt plugin-name/uninstall.php
|7 years ago|
|plugin-name||7 years ago|
|.gitignore||10 years ago|
|ChangeLog.md||7 years ago|
|README.md||7 years ago|
WordPress Plugin Boilerplate
A standardized, organized, object-oriented foundation for building high-quality WordPress Plugins.
The WordPress Plugin Boilerplate includes the following files:
.gitignore. Used to exclude certain files from the repository.
ChangeLog.md. The list of changes to the core project.
README.md. The file that you’re currently reading.
plugin-namesubdirectory that contains the source code - a fully executable WordPress plugin.
- The Boilerplate is based on the Plugin API, Coding Standards, and Documentation Standards.
- All classes, functions, and variables are documented so that you know what you need to be changed.
- The Boilerplate uses a strict file organization scheme that correspond both to the WordPress Plugin Repository structure, and that make it easy to organize the files that compose the plugin.
- The project includes a
.potfile as a starting point for internationalization.
- Copy the
plugin-namedirectory into your
- In the WordPress dashboard, navigation to the Plugins page Locate the menu item that reads “The WordPress Plugin Boilerplate.”
- Click on Activate.
Note that this will activate the source code of the Boilerplate, but because the Boilerplate has no real functionality so no menu items, meta boxes, or custom post types will be added.
Examples are slated to be added to the Boilerplate’s website as the site continues to grow.
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 internationalize the plugin.
The WordPress Plugin Boilerplate is licensed under the GPL v2 or later.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
A copy of the license is included in the root of the plugin’s directory. The file is named
The WordPress Plugin Boilerplate 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.
Note that if you include your own classes, or third-party libraries, there are three locations in which said files may go:
plugin-name/includesis where functionality shared between the dashboard and the public-facing parts of the side reside
plugin-name/adminis for all dashboard-specific functionality
plugin-name/publicis for all public-facing functionality
Note that previous versions of the Boilerplate did not include
Plugin_Name_Loader but this class is used to register all filters and actions with WordPress.
The example code provided shows how to register your hooks with the Loader class. More information will be provided in the upcoming documentation on the website.
assets directory contains three files.
banner-772x250.pngis used to represent the plugin’s header image.
icon-256x256.pngis a used to represent the plugin’s icon image (which is new as of WordPress 4.0).
screenshot-1.pngis used to represent a single screenshot of the plugin that corresponds to the “Screenshots” heading in your plugin
The WordPress Plugin Repository directory structure contains three directories:
The Boilerplate offers support for
branches is something that isn’t often used and, when it is, is done so under advanced circumstances.
When committing code to the WordPress Plugin Repository, all of the banner, icon, and screenshot should be placed in the
assets directory of the Repository, and the core code should be placed in the
What About Other Features?
The previous version of the WordPress Plugin Boilerplate included support for a number of different projects such as the GitHub Updater.
These tools are not part of the core of this Boilerplate, as I see them as being additions, forks, or other contributions to the Boilerplate.
The same is true of using tools like Grunt, Composer, etc. These are all fantastic tools, but not everyone uses them. In order to keep the core Boilerplate as light as possible, this feature have been removed and will be introduced in other editions, and will be listed and maintained on the project homepage
The WordPress Plugin Boilerplate was started in 2011 by Tom McFarlin and his since included a number of great contributions.
Documentation, FAQs, and More
Because this version is a major rewrite of the core plugin, we’re working to create an entire site around the Boilerplate. If you’re interested, please let me know and we’ll see what we can do.