However, not all AI models are created equal. Some stood out for their ability to create effective code with minimal prompting and troubleshoot code generated by other models.
ChatGPT, Bard, Bing, and Claude generated PHP code that created no issues during the new word count plugin’s installation, activation, or deactivation.
Screenshot from WordPress, September 2023
Of the four, ChatGPT provided the cleanest set of directions on installing the newly generated plugin, followed by Bing and Bard.
Screenshot from ChatGPT, September 2023
Llama Requires Assistance From Other AI Chatbots
Artificial intelligence (AI) chatbots have opened up a world of possibilities for people to dabble in projects they might not have tackled due to lack of experience.
While not unique to WordPress’ repository of plugins, I submitted the following prompt to describe the desired functionality.
Can you write the PHP code for a WordPress plugin that will add a column to the WordPress admin dashboard All Posts page showing each post’s word count?
The Results
Like codellama-34b-instruct, llama-2-13b-chat was unable to solve its problem. Yet again, ChatGPT came to the rescue and fixed the code, which resolved the errors caused by the original code from llama-2-13b-chat.
Generative AI And The Future Of Coding
For this little test, I used the following six AI chatbots:
GPT-4 for ChatGPT Plus subscribers.
GPT-4 via Microsoft Bing AI.
PaLM 2 via 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) via Perplexity Labs with a free account.
The Prompt
With ChatGPT’s intervention, the plugin originally generated by codellama-34b-instruct worked as intended, highlighting ChatGPT’s versatility and proficiency in debugging and refining code.
As someone who uses WordPress but doesn’t have coding experience, I thought it would be interesting to see which AI could help create a simple plugin.
How well did each of the six AI models perform?
No Revisions Required For ChatGPT, Bard, Bing, And Claude
With the rapid development of AI technology, it shouldn’t be long before other AI models become more reliable and accurate in accomplishing coding tasks.
Llama-2-13b-chat also generated PHP code for the described WordPress plugin. At first, the plugin worked properly and displayed the word count on the all posts page.
Generative AI holds immense promise for various development tasks, including creating a simple WordPress plugin.
After installation, the plugin offered a series of warning errors instead of word counts.
Screenshot from WordPress, September 2023
While codellama-34b-instruct in Perplexity Labs generated the PHP code for a WordPress plugin, it offered a few additional challenges.
When I asked it to fix the problem, it offered suggestions.
Screenshot from Perplexity Labs, September 2023
Featured image: Koshiro K/Shutterstock
However, a fatal error appeared when returning to the installed plugins page.
Screenshot from WordPress, September 2023
To remedy the situation, I had to access the FTP site and manually delete the plugin files – not the kind of experience a typical WordPress user would appreciate.
ChatGPT, on the other hand, identified the issue and revised the code.