Artificial intelligence (AI) chatbots have made it possible for people to get involved in projects they have not been exposed to due to lack of experience.
As someone who uses WordPress but has no coding experience, I thought it would be interesting to see what AI could help create simple plugins.
For this short test, I used the following six AI chatbots:
- GPT-4 for ChatGPT Plus members.
- GPT-4 by Microsoft Bing AI.
- PaLM 2 by Google Bard.
- Claude 2 via Anthropic’s website with a free account.
- Meta’s Code Llama (codellama-34b-instruct) and Llama 2 (llama-2-13b-chat) free account by Perplexity Labs.
While not unique to WordPress’s plugins repository, I submitted the following suggestion to describe the desired functionality.
Can you write PHP code for a WordPress plugin that will add a column to the All Posts page on the WordPress admin dashboard showing the word count of each post?
How well did each of the six AI models perform?
No revision required for ChatGPT, Bard, Bing and Claude
ChatGPT, Bard, Bing, and Claude generated PHP code that caused no problems during installation, activation, or deactivation of the new word count plugin.
Of the four, ChatGPT provided the cleanest directions for installing newly generated plugins, followed by Bing and Bard.
Llama needs assistance from other AI chatbots
While codelama-34b-instruct in Perplexity Labs generated the PHP code for the WordPress plugin, it provided some additional challenges.
After installation, the plugin offered a series of error warnings instead of word counts.
When I asked him to solve the problem, he gave suggestions.
On the other hand, ChatGPT recognized the problem and modified the code.
With ChatGPT’s intervention, the plugin originally generated by codellama-34b-instruct works as intended, highlighting ChatGPT’s versatility and proficiency in code debugging and refining.
Llama-2-13b-chat also generated the PHP code for the WordPress plugin described. Initially, the plugin worked properly and displayed word count on all posts page.
However, returning to the Installed Plugins page showed a fatal error.
To remedy the situation, I had to access the FTP site and manually delete the plugin files – not the type of experience a typical WordPress user would have.
Like codellama-34b-instruct, llama-2-13b-chat was unable to solve his problem. Yet again, ChatGPT came to the rescue and fixed the code, which fixed the errors caused by the original code in llama-2-13b-chat.
Generative AI and the future of coding
Generative AI holds great promise for a variety of development tasks, including creating a simple WordPress plugin.
However, not all AI models are created equal. Distinguished by some for their ability to produce effective code with minimal prompting and troubleshooting code generated by other models.
With the rapid development of AI technology, it won’t be long before other AI models become more reliable and accurate in completing coding tasks.
Featured Image: Koshiro K/Shutterstock