A few years ago I wrote a post about some invaluable lessons I’d learnt from developing plugins. I enjoy writing posts like this as it gives me an opportunity to share my own experiences with fellow WordPress developers and allows me to speak coder-to-coder.
In the world of programming we’re constantly learning (often the hard way). I think this is one of the key attractions for me in that the learning curve never seems to cease, so in that vein, I’d like to share with you 5 more lessons learnt from building WordPress plugins and share them with you below.
Version control
The importance of using a version control system such as Git cannot be overstated. It allows you to track changes, revert to previous states, and manage updates efficiently. This is especially important when working in teams as it allows continuous integration and deployment of your plugin.
Not only that, create a public repository and make it open source so anybody can contribute to the codebase. We’ve written in the past about how open source software is beneficial.
Performance optimisation
On your local test site where you’ve been developing your plugin you might add 10 sample records to play about with. But what about in the real-world where you’ve got tens of thousands of records, 5 users logging in at once, and thousands of visitors a day. It’s imperative that any code is optimised so as to not slow down a website, especially when page speed has an impact on SEO rankings, you don’t want to be the culprit for a site not performing at it’s best.
Some examples of optimising your plugin include:
- Minimising database queries
- Compressing any JS or CSS
- Use WordPress’s built-in functions where possible (get_option() etc comes with in-built caching)
- Store data efficiently in the database so it can be easily queried
At Property Hive we see estate agency sites with 10,000+ properties so it’s key that it can handle searches and query this amount of data with ease.
Document it well
Nobody likes writing documentation. It can seem boring, laborious, and time consuming, especially when you’ve got a to do list as long as your arm full of cool new features you could be building instead.
But good documentation has a number of benefits:
- It reduces support by allowing users to find answers to their queries themselves without having to bother you.
- It improves customer retention. Ever abandoned a project because the documentation wasn’t clear?
- It’s a sales tool. You might think documentation is only for existing users? Believe it or not, potential users will browse the documentation before they’ve even used the plugin.
Add as many hooks, actions and filters as possible
Add actions and filters everywhere, and I mean everywhere. Every bit of output, every list of options, every set of arguments passed to queries, and so forth. This gives other developers the opportunity to customise the plugin to their or their customers needs without you having to make core changes to the plugin.
Make hook naming conventions consistent, and document them somewhere with examples on how one might use the hook in question.
Listen to feedback
Lastly, actively seek out and listen to feedback from the users of your plugin. Whether it’s through support forums, user reviews, or direct emails, feedback can guide future development, define where you spend your time, highlight issues you hadn’t considered, and reveal what users truly value. Taking feedback on board, both positive and negative, is key for continuous improvement and innovation in plugin development.
If you’re thinking about developing a WordPress plugin, I hope the 5 more lessons learnt from building WordPress plugins here, as well as the ones I wrote about previously, are of some use. Stay tuned for more insightful tips in the future.