Since the inception of WordPress plugins about 10 years ago not a lot has changed in the way we write them. There’s a main plugin file with a header followed by the Wild West basically. Apart from using hooks, there is no standardized way of making plugins. This isn’t necessarily a problem. There are many simple plugins that don’t need a governing framework, and there are some people who can write perfectly coherent procedural code. That said, the quality of code in plugins is generally not the best, a framework or methodology would go a long way in raising it. In this article, I’ll look at one possible solution – WordPress Plugin Boilerplate. It is meant to be a starting point for plugin development, an object oriented way of creating a standardized plugin. Since it is coded with OOP principles, it is mainly intended for intermediate coders, but you can easily use it even as a beginner if you know what goes where. By the end of this article, you should know what’s what and how you can get started with it – regardless of your coding experience. General File Structure The boilerplate is meant to be used as a Github repository, so the main directory contains files commonly found in Github
Share This