Reading time: minutes ( words)
I’ve been using WordPress as my go-to CMS for roughly the last 5 years now, having experience with other platforms like craft and perch It’s been client demand that has kept me using WordPress so consistently.
A WordPress plugin is a powerful thing, it can extend the functionality or add new features to a WordPress website. Although anyone can build a plugin, the idea of building my own has both appealed yet scared me.
So when the project I’ve been working on for the last few months presented itself with an opportunity to get my hands dirty and to take my WordPress skills to the next level. Next level being plugin development I was a little apprehensive.
What did my plugin need to do?
After spending a good few hours googling I was pretty clear on what my plugin needed to do. My plugin needed to use wp_remote_get() to parse JSON from a remote API and then programmatically create a post as a custom post type with additional values stored via advanced custom fields. Sounds so clear now when I say it like that, but I assure you for hours it didn’t.
There are so many resources out there with all manner of approaches to the same problem. As is often the case its hard to know which one to follow. You either uncover the worlds most technical approach or the simplest, but the least detailed at the same time. But why is it so many tutorials assume that you know how to put it into practice? You follow along effortlessly then when it comes to the output they just give up. The curse of knowledge must surely be a tutorial writers worst enemy!
I should probably point out this isn’t a tutorial on how to build your first plugin. But more a gentle kick up the ass to encourage you to build your own a darn sight sooner than I did, and a few good links (which I’ll drop in at the end) but certainly not a tutorial I’m afraid.
As a developer, I feel there is a constant pressure to master new technologies and follow the trends of the web, with the case often that if I had just kept mastering the skills I knew they wouldn’t of in fact gone extinct. What I mean is that if I had followed through on my WordPress learning and not jumped on the next wave I would have most likely built far more plugins by now and be a much better WordPress developer. But who really knows!
Following the waves has no doubt given me a broader skill set, and most likely helped me navigate Google far quicker than I might have done if I’d been more linear in my learning. Googling you see is a skillset in itself you must master. But whether its the reason for certain that I lacked the confidence to dig deeper into WordPress sooner I don’t know, but I feel it had some impact.
I’ve built my first plugin now for sure. It was by no means as hard to build as I thought and it’s not as perfect as it could be, but it works and I’m ready to try again on the next one.
So get on with it and try building your own plugin, it took me around six hours to build mine and I feel like a better WordPress developer already, and less reluctant to go searching for the next wave.
The resources I used to build my plugin.
General plugin advice:
Pass JSON from a remote API
Programatically create a post