25 Feb How to Go About Writing Your First WordPress Plugin
Table of Contents
What’s the Right Way to Start?
Beginning Plugin Development does sound like something completely in its own world. There are the rockstar PHP developers who contribute to WordPress to power 30% of the Internet!
I admit that at first it can be daunting to be in the world of reading documentation and understanding how your code works, but like all things having you start out to write a plugin is in itself an amazing feat! Congratulations and welcome to writing your first plugin!
Evolving Your Process
You have to be prepared to make mistakes (but never be afraid or let down) as you would likely have experienced in starting out with anything new. This is a reminder that you are in Learning mode and it’s completely normal for you to not follow best practice in the beginning. But if you do happen to stumble upon a best practice that you could implement on your WordPress plugin, then by all means immediately make a note and completion date to complete it.
Once you’ve found that you could improve your plugin’s code:
- Immediately make a note of the improvement
- Plan out a space of time within your day/week to add this. Likely spend 25 minutes to 1 hour on this (that’d be 1-2 pomodoros)
- That way you will have retained your newly found knowledge of improvement, which will push you further up the ladder in your skills
This has helped me tremendously in becoming better at something I was totally a stranger of back then. But it’s all about best practice, isn’t it?
Even WordPress core contributors started out like us:
One of the contributors, Lloyd Budd, was kind enough to take the time to explain to me that I could fix the bug myself and submit the fix to the WordPress project. He pointed me to resources for learning Subversion and creating patches. That small act of help lead to me becoming a regular WordPress contributor, and ultimately one of the core developers.
Keep It as High Quality as Possible
At whatever thing you do, you’ve got to make sure that you aren’t cutting any efforts off. If you'll be building plugins they will reflect on your commits and how you are able to correct them as they arise.
You might not have much feedback from the first few weeks or days that your plugin is released into the WordPress Plugins Directory, so you’ve got to be doubly sure that you work as high quality as possible.
The way plugin development feels like is that you’ve got to keep notes if ever a thought comes in about a possible feature (especially if you’re creating a plugin on your own). Ideas don’t come up every so often. But once it does, it’s best to keep a brief note of it and think about it later.
The reason you think about that idea you just got is so that you can focus on the task at hand whilst you’re on your pomodoro time (that’s 25 minutes per pomodoro).
Watch Your Language
It’s not required but translating your plugin to your native tongue is a big help for your end-users.
But like all aspects of creating a plugin, it’s up to how you feel like it.
If your instincts tell you that it would be a great idea to translate your plugin, then the best idea would be to go for it without hesitation. This is for anti-regret reasons…
Having to learn new concepts like Subversion (which is used to store the WordPress plugin publicly), and having to keep evolving your code so that you retain that newly found knowledge, is what it’s all about in everything new that you’d learn. Plugin development is a glory of its own! It does have trenches but you can always get out of your computer and get a bite of chocolate or a sweet you like — as a reward for combatting something new for your brain.
Remember, your mind is what controls you. In almost all cases, you shouldn’t trust your brain and it’s need to be comfortable, but instead you should trust your mind and carry on to grow yourself.
I’ll plug in one of Tony Robbins’ relevant quotes here:
In fact, I can tell you the secret to happiness in one word: progress.
— Tony Robbins, link to the source
Growth is never comfortable. Like all first times, Plugin development is one of those growth moments. You’re growing, not maintaining. It’s difficult to remind ourselves that progress equals happiness, but that is the boiled down truth.
I am reminding that you once had this experience in other areas, even in travelling.
If you have other areas that seems similar to you in new experiences please write it down in the comments below. It would be great to share how you combatted that new software development experience and turned it into a fresh new memory for yourself!
Thank you for reading! If you liked this article, you might also like to check Why Every Software Developer Needs a Blog. That article seems most relevant since this current article has been discussing that it helps to quickly take note of your own experience.
Journal — it’s okay…
But a Blog for any Software Developer… good way to get your posts on the internet + your own thought space that you can share to others (+ a fancy email address)! Cheers, and have a good week!