Table Of Contents
Here at OnPoint Plugins we embrace the AI revolution as a way to increase our abilities and productivity. We were early adopters. After a couple of years of daily use, we are ready to share some experience and expertise of using AI to develop WordPress plugins.
We do not use AI to write any of our website content or plugins. Everything, including this article, is still written by a human.
Model Overload
The AI world feels like a sea of endless AI model options which are always changing. Trying to keep up with the latest trends and benchmarks is time consuming and exhausting. Each model excels at something specific but only under particular conditions.
Since we are talking about WordPress development, lets cut through the noise and focus on consistency over trends. After massive testing of the different models:
- The most consistently helpful and accurate model for writing code is Claude.
- The latest version of Claude Sonnet works best.
- The quickest and reasonably accurate model for pulling information from the web is GPT 4.
- GPT 5 can sometimes be more accurate but can take longer.
The rest of the models may be ignored for now.
True Value
The true value in AI comes from having super smart autocomplete which fills in code as you type. You know what you are about to write, at least in a fuzzy way. Having AI finish your nice lines of code based on what you are writing is a nice efficiency increase.
Another area where AI really shines is pulling in information into your IDE. Instead of searching on Stack Overflow or reading developer blogs, AI can retrieve information from the web and condense it into summaries containing the information you need. Using IDE based AI chat is great for quickly getting information about a function or how to achieve some specified logic.
Autocomplete Flow
Getting into a flow with AI can increase productivity like 10X. It is important to understand that flow is something wonderful when it happens but it won’t always happen. Trying to force AI into a flow with you will almost always reduce productivity. If AI is hallucinating, keep going with writing your own code. AI may catch up, but sometimes it won’t. Pausing or changing what you are writing to help AI will slow you down.
The Prompt Trap
A lot of the AI world is buzzing about this new idea of “Prompt Engineering.” The goal being to write the perfect prompt to get AI to do exactly what you want it to do. It is easy to fall into the idea that if AI is not giving you what you need, your prompt is the problem.
The truth is AI is more like a junior developer. It does not know what it does not know. It is going to give you an answer whether the answer is correct or not. If it fails, it is not your fault. Don’t get me wrong, there are certainly good and bad ways to write prompts but continually editing a prompt to try to fix the result will frustrate you and eat up your time.
A simple way to approach this is a question, “Will it take longer to write the perfect prompt then to simply write the code myself?” Keep in mind, you can still use AI autocomplete while you are writing the code yourself. If the answer is, “Yes, it will take longer” or “It has already taken longer,” it is a trap. Ditch the prompt and get back to work.
And AI agents – oh man, don’t get me started. Have you actually used AI agents to write something in a system you fully understand? If so, you know the finished result is far from finished. The code will have bugs. The implementation will be missing important elements. If you want to spend your time doing code reviews and fixes, AI agents are right for you. If you want to spend time coding, use AI autocomplete and chat.
We expect that sometime in the next several years, AI agents will become good enough to be useful replacements of expert developers. As of now, they are only useful for working on code for prototyping or one offs which don’t need to scale or meet coding standards.
IDE Tools
Modern IDEs have plugins for integrating AI into your workflows. Staying within your IDE context is a huge efficiency boost as you don’t loose track of what you are working on while you retrieve information.
- Autocomplete coding assistance happens as you write code.
- Chat is right in the sidebar.
PHPStorm is by far the best all around IDE for writing WordPress code. JetBrains have their own AI integration plugin which has become quite stable over the past 6 months. The JetBrains autocomplete is spooky sometimes about how accurate it is.
If you are using VSCode, you still have access to GitHub Copilot. Copilot has been around a long time already and is stable and reliable. The best part about GitHub Copilot is it can be universally used in the browser, terminal and cross IDE.
We use both JetBrains AI and GitHub Copilot. JetBrains does the heavy lifting while Copilot fills in the gaps with things like PHP docs and retrieving fast information from the web.
Speaking Your Language
Both JetBrains AI and GitHub Copilot have support for writing custom instructions the AI should follow when generating code in responses. You’ll want to have one setup in your project to guide the AI result to be closer to how your specific project is written.
It is easy to become obsessed with perfecting the custom instructions, which ultimately turns into long, verbose instructions which result in more hallucinations and exceeding of token limits. Here are a few tips when writing custom instructions:
- Be specific and clear about what you are requiring.
- Only add to your instructions after you are seeing a consistent pattern you want to correct.
- Do not add a correction for every mistake AI makes.
- Organize the rules into sections to separate coding languages or testing instructions.
- Understand AI will sometimes ignore your rules entirely.
- If chatting, you can prompt the AI to try again with something like, “You did not follow the instructions.”
Getting Started
- Install an AI plugin in your IDE.
- GitHub Copilot is a great place to start.
- Enable multiline autocomplete in settings.
- Anytime you are about to search the web for answers:
- Open the AI chat in your IDE.
- Add the same search in the chat.
Conclusion
AI won’t replace your job. Your job will be replaced by someone who knows how to work with AI.”
We believe that AI should be incorporated in your workflows today. Not as a replacement for developers but as an enhancement of developers. Turn it on and organically discover where it helps you improve.