Software Engineering in WordPress and Musings on the Deep Life

WordPress Plugin Boilerplate: Aiming For 1.0

WordPress Plugin Boilerplate

Since I’ve been working on the WordPress Plugin Boilerplate, I’ve never really done a good job of handling versioning for it. Instead, I’ve closed tickets as they’ve shown up and I’ve resolved issues as I – or others – have encountered them.

Next month, I’m hoping to officially tag it and the WordPress Widget Boilerplate as version 1.0, but I’m hoping to get a few more eyes on the code prior to doing so.

This weekend, I spent some time closing tickets, refactoring some code, and improving a few aspects of the code to improve its overall standard.

Here’s a run down of everything that’s been updated since the I initially launched the boilerplate:

Updates To The WordPress Plugin Boilerplate

  • Removed an unneeded closing brace
  • Cleaned up the code to comply with the WordPress Coding Standard
  • Added default README requirements
  • Resolved issues with JavaScript and Stylesheet paths being incorrectly imported
  • Changed from plugins_dir_path to plugin_dir_path
  • Added activation and deactivation hooks in the constructor
  • Resolved typos in plugin-specific JavaScript and stylesheet issues
  • Removed the closing PHP tag
  • Removed ampersands on $this for changes in pass-by-reference changes in PHP 5.4.4
  • Updated JavaScript to conform to JSLint standards

Of course, many of these couldn’t have been done without pull requests and contributions for others on GitHub. I’m certainly not taking credit for all of the work that’s been done!

What’s Needed For 1.0?

Generally speaking, I think that the WordPress Plugin Boilerplate is almost ready for 1.0, but I’d like to have as many of you code review it as possible.

Ultimately, I’d love to have this become the de-facto boilerplate for creating WordPress plugins so if you have five minutes and feel like opening a ticket, contributing a pull request, contributing some other change (even if it’s a feature request), please do.

6 Comments

  1. Mario Peshev

    Anyone who would like to join forces for https://github.com/mpeshev/DX-Plugin-Base ? It has about 400 downloads on WPORG and I’d be happy to work out a better version with other developers.

    • tommcfarlin

      Straight up – thanks for sharing this! I’ll try to get the word out via Twitter next week, too.

      • Mario Peshev

        That would be highly appreciated – a unified resource for teaching best practices in a working way (as a working plugin) would be extremely useful for the community IMO.

  2. Dustin

    Thanks for this great starting point for plugin development, it is a great resource! I am using it to start writing a couple of plugins for myself. I had a question about when to register settings. Should I register settings and options pages during the activation hook or is there a better way to do that? Thanks again for the work you do for the WordPress community!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2023 Tom McFarlin

Theme by Anders NorenUp ↑