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.

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.

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

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

How well did each of the six AI models perform?

No Revisions Required For ChatGPT, Bard, Bing, And Claude

ChatGPT, Bard, Bing, and Claude generated PHP code that created no issues during the new word count plugin’s installation, activation, or deactivation.

Creating A Simple WordPress Plugin With 6 AI ChatbotsScreenshot 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.

Creating A Simple WordPress Plugin With 6 AI ChatbotsScreenshot from ChatGPT, September 2023

Llama Requires Assistance From Other AI Chatbots

While codellama-34b-instruct in Perplexity Labs generated the PHP code for a WordPress plugin, it offered a few additional challenges.

After installation, the plugin offered a series of warning errors instead of word counts.

Creating A Simple WordPress Plugin With 6 AI ChatbotsScreenshot from WordPress, September 2023

When I asked it to fix the problem, it offered suggestions.

Creating A Simple WordPress Plugin With 6 AI ChatbotsScreenshot from Perplexity Labs, September 2023

ChatGPT, on the other hand, identified the issue and revised the code.

Creating A Simple WordPress Plugin With 6 AI ChatbotsScreenshot from ChatGPT, September 2023

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.

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.

However, a fatal error appeared when returning to the installed plugins page.

Creating A Simple WordPress Plugin With 6 AI ChatbotsScreenshot 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.

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

Generative AI holds immense promise for various development tasks, including creating a simple WordPress plugin.

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.

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.


Featured image: Koshiro K/Shutterstock

 



Source link

Avatar photo

By Rose Milev

I always want to learn something new. SEO is my passion.

Leave a Reply

Your email address will not be published. Required fields are marked *