fbpx

Not A Subscriber?

Join my newsletter to receive insights, findings and tips that I've been discovering. All from creating a set of digital products and building an online business.

How To Build A WordPress Plugin In Only 8 Hours

So. I figured out how and where to host the WordPress plugin that I wanted to build.

As well as get the structure and the initial version coded, and working. And be able to activate it on my test website.

All that was left was to code up the MVP.

Sounds straight forward right?

When you’re coding something. Even something brand new. It will take you longer than you think.

Using an AI tool. Could I get a version of my plugin built and out in my spare time?

In less than 8 hours?

Narrow The Focus of Your WordPress Plugin

The key to getting software out to the world. In this case, a WordPress plugin. Is to narrow your focus.

This means you have to be strict with yourself. It’s important to come up with a good MVP for your plugin.

That’s a balancing act between providing enough value to someone. And not spending weeks, or months building something. Only for no one to use it.

I’ve detailed how I thought about the MVP for the WordPress plugin here.

No More Copy and Pasting ‘AI’ Code

I’m active on Twitter/X, whatever you want to call it.

And a lot of people who are on that platform, are like myself. They are building software products for themselves. Hoping to turn them into businesses and escape their 9-5? Many have been banging on about an AI coding tool called GitHub Copilot.

I’ve used a few AI tools to help me write code before. With mixed results.

The main problem with these AI tools. They don’t always understand the goal, or what your solution is trying to do.

This is one of the reasons I was excited to give GitHub Copilot a go.

You add Copilot as an extension to VS code. This means that when you ask it to write code for you. It knows the structure of your solution. And if you leave your code files open. It will inspect these and use them to help it write the new code.

This gives Copilot a huge advantage over the other AI tools. As it has context and an understanding of your code.

Start by creating a new code file. Then, either write a comment at the top of the file. But what I found best, was to press CTRL + I, and in the prompt chat that appeared. I asked it to write the entire code for the file in a single question.

It shocked me at what it produced.

Chatting Inside Your IDE

Another cool thing about GitHub Copilot is that it has a chat window too.

So you can still ask questions to Copilot as you would other AI tools.

Again, Copilot has the advantage of running inside your IDE. Therefore, it has access to your solution and the entire code base.

You can even ask it questions about your solution by using the @wordspace prompt.

That means if you are struggling with something. Or are not sure how to make a start with a new feature. Copilot will use your workspace as a guide to try and come up with the best and most relevant solution.

It was strange though.

When it was writing code. Or answering these sorts of questions. It was like it was in my head. It knew exactly what I was trying to do.

That’s because it kind of is. It has an understanding of your code, and what your end goal may be. That’s because it’s executing alongside your workspace.

Bug Fixing And Fault Finding

Another huge plus for me about Copilot. Was how you could ask it to help you fix a bug or find where an error occurred.

I was getting a few PHP errors on an admin screen I was coding inside the WordPress dashboard.

And this is where Copilot makes you a lazy coder.

Instead of reading and figuring out what was going on.

I copied the error. Made sure all the relevant code files were open inside VS Code. Went to the Copilot chat windows. Said, “I’m getting this error”. And pasted the error message and stack trace into the chat.

Within seconds I had a solution.

Either Copilot pinpointed what was wrong with the code. Or gave an explanation of why it was happening and the steps to take. Inside your solution to fix the bug.

Insane

No More ‘Burnout’

The interesting thing I’ve found from using GitHub Copilot. Was how much of the ‘thinking’ it takes off your shoulders.

Sometimes, when you’re coding something from scratch. You can drain your mental energy.

You spend a lot of time coding up things that aren’t difficult. But takes some brain power to get them done. And remember to make sure you have everything covered. That you’ve not missed something.

So when it comes time to do the new, value-packed code. Building key features. You may be a bit tired, mentally from getting to that point.

This is where Copilot could be a game changer for me.

My mental energy isn’t used to up. And I have to think about writing code in a different way.

Instead of having to think about every line of code. both writing it, constructing it, and making sure it can compile and run.

You spend a bit of thinking time upfront to make sure you’re prompting Copilot the right way to get the best output.

What I found was the code that was written was about 60%-70% correct for what I was building. Even over 80% for some things.

You’re mental effort is then used to review and improve the code that Copilot has written.

It 5X’ed my output, no word of a lie.

Zero To Done In Less Than 20 Minutes

I’ve called my plugin SuperSub. The goal of it is to help me get more newsletter subscribers from my WordPress blog.

My idea was to have a small non-intrusive popup/widget that appears on my site after 5 seconds. That says “Press S to subscribe” on desktop devices. Or “Tap to subscribe” on mobile devices.

This is the main feature. The key component to my MVP.

So how could I get this up and running?

I live-streamed the coding on YouTube. You can watch a recording of the live stream here.

By using Github Copilot. I was able to get both the desktop and mobile popups working in less than 20 minutes.

I’d set aside the whole afternoon for the live stream but ended it after 30 minutes.

I said it made me 5 times quicker. More like 10 times quicker.

Functioning WordPress Plugin In 8 Hours

So, how long did it take me before the plugin was live?

Well, it took me about 14 days to get version 1 uploaded to my Freemius account.

Some of those days were spent focusing on building a marketing site and landing pages to promote the plugin.

In total. I reckon I spent 8 hours coding the entire WordPress plugin.

And that was part-time.

Sat in front of the TV with my wife, with my laptop on my knee.

Or recording a few live streams to get key parts of the product coded.

It didn’t take me long at all.

If you’re interested you can watch all the live streams back. As well as the other walkthroughs I recorded showing how I’ve built the WordPress plugin. Check them out on my YouTube channel.

Conclusion: Code A WordPress Plugin In 8 Hours

Using a combination of AI tools, along with 20+ of coding and software engineering experience.

I was able to publish a WordPress plugin in less than 14 days, part-time. The coding part of the build took me around 8 hours. Again over a few days.

The key though is that you have to have defined a well-thought-out MVP.

As well as narrow your focus to make sure you don’t start adding features that aren’t needed.

But using tools like Github Copilot. You can get code written in no time.

It also saves your “mental battery”. So you use up energy thinking about what to code. And if the code AI produces is correct. As well as refining the code to a higher quality.

I’ve been reluctant to use AI tools to help me code. Previous attempts at using it to write code haven’t been great.

But that’s changed since using Copilot. It feels like you’ve gone from jogging, hoping for the finish to appear. To sprinting to the finish line in world record time.

Wild!

Wait, want more tips & tricks? Yes, please!

Who Is Phil Hughes

I am a coder, content creator & software consultant for start-ups and FTSE 100 companies. I am obsessed with productivity, self-improvement, and building a lifestyle business.
You can work with me to transform your business! Setup a recurring revenue model designed for growth.

When You’re Ready, Here’s How I Can Help You:

10x your productivity with this one simple hack
10X Your Productivity
Discover this simple, yet effective technique. which helps you be ultra-productive and get shit done!
Notion Habit Tracker
Habit Tracker
A personal tracking system that helps you create better habits.
GTD Framework Template using Notion
GTD Notion Template
A timeless framework that helps you get clear, organized, get more done and free up your time.
Online Business Systemization
Online Business Systemization

Learn how to systemise and automate your online business. Free up your time so you can focus your energy on growing your business.

Productivity Bootcamp Course
Productivity Bootcamp
Productivity Bootcamp is a 4 part course, that helps you to get more done. Spend less time on the mundane. And more time doing what you love.

Press S to subscribe

Tap to subscribe

Join my email list for insights, tips and more