Thursday 25 June 2015

Understanding the Basics of WordPress Plugin Boilerplate

WordPress comes loaded with a rich set of plugins that contribute in making it one of the most widely-used content management systems. You can access most of the plugins from the WordPress plugins repository. But, what if you would like to build one on your own? Perhaps, you may look around several resources available online to understand the process of plugin development. 


The Problem With Plugin Development

You won't face much problem when it comes to creating simple plugins, especially the ones that don't require a governing framework. In fact, you can create them simply writing understandable procedural code.  However, the quality of the code you have written to build plugins is usually not good enough. But, you can raise the code quality using some approach or a framework. In this article, we will talk about one such approach that will help you in building high-quality WordPress plugins. 

A Look at WordPress Plugin Boilerplate

WordPress Plugin Boilerplate lays down the foundation to help users get started with their plugin development project in an efficient manner. It provides an object-oriented way to build plugins that are organized in the same manner just like the WordPress Plugin Repository; there's plenty of room to keep every type of file and so you don't need to do any guesswork: as to where your files are being stored.

WORDPRESS PLUGIN BOILERPLATE
What's more? Since, the Boilerplate abides by both the coding standards, as well as, the standards of documentation, you don't need to spend time in looking at those standards for getting started with your project. All you have to do is to provide details about your work (i.e. plugin development) in the comments section of the Boilerplate foundation, write the code, and you are good to go.

WordPress Plugin Boilerplate: File Structure

The boilerplate was created to be utilized just as the Github repository, and so you will find a lot of files in the main directory that are found in the Github repos as well. The main folder where all your plugin will be stored is named as “plugin-name” in the Boilerplate. The structure of this folder is based on WordPress repository. However, it is important to register that folder to the SVN plugin repo.

The repo, by default, comes with two main folders available within the Boilerplate that you need to know about, namely: the “assets” and “trunk” folders. The assets folder help in storing the screenshots and images of your plugin, while the trunk folder is the one that contains the plugins. So, to activate your own custom plugin created using the WordPress Plugin Boilerplate, you'll need to paste the trunk folder into your WP installation.

Summing Up!


There's a lot more that goes into the process of creating a plugin with the help of “WordPress Plugin Boilerplate”. Through this article, we have tried to cover the basic purpose of the Boilerplate and its general file structure only. You can find a lot more about it over the web. So, next time when you are working on the project that requires you to create a WordPress plugin, the use of WordPress Plugin Boilerplate can help make the process a fun experience. 

Author

I am Savy Nacion, working as a technology specialist in Markupcloud - markup conversion services (PSD to Wordpress, HTML to Wordpress) providers company, based in Rochester, New York. With over 10 years of experience in the technology domain, I aim at bringing new and innovative technology solutions to the company to help it keep thriving in the industry.