Turns out, ChatGPT is quite good at writing WordPress plugins
ChatGPT has been used for a wide variety of projects already. From writing novels and song texts to code snippets and building websites. The AI is also used by cybercriminals, for instance to write better phishing emails or malware. There seems to be nothing that the language model can't do, at least if it does not require data that is from 2022 or later.
Turns out, ChatGPT has another ace up its sleeve: the creation of WordPress plugins. WordPress is the most popular content management system on the Internet. Part of WordPress' popularity comes from its extensibility. Users may create custom themes and plugins, or install hundreds of thousands of themes and plugins that are already available.
WordPress site owners who do not know anything about programming had to resort to hiring programmers to create plugins for specific tasks. Now, it appears there is another possibility, at least when it comes to the creation of simpler plugins: asking ChatGPT to write them for you.
Create WordPress plugins with ChatGPT
It took ChatGPT five minutes to write a complete WordPress plugin according to David Gewirtz, who wrote about the experiment on ZDnet. ChatGPT created the user interface, the logic and all the necessary elements to install the plugin in WordPress.
Gewirtz instructed ChatGPT to write the plugin using a single sentence. The AI wrote the code within a minute and when Gewirtz tested it in WordPress, he noticed that it was working exactly as instructed.
Adding more capabilities to the plugin was not difficult either. When Gewirtz noted that the plugin would sometimes output duplicates, he added instructions to avoid that.
The quality of the output depends largely on the instructions. If these are lacking, the code may turn out in a different way than expected. It is easy enough to react to these challenges though, by improving the instructions.
When Gewirtz analyzed the quality of the code, he noticed that the code was working, but that it did not "incorporate all the best practices of WordPress programming". Some of these, like code sanitizing, could be resolved to a degree by adding these to the instructions.
Gewirtz ran into several Cul-de-sacs during his interactions with ChatGPT. He concluded that ChatGPT in its current from worked reasonable well as a WordPress plugin developer. Caveats are that plugins need to be reasonably simple, that the output is not always adhering to best practices, and that code maintenance is not the AI's strongest talents.
With these caveats in mind, Gewirtz believes that ChatGPT and other AIs of its kind will, "almost undoubtedly", reduce the number of human programming gigs in the future. Experienced developers and writers, on the other hand, are less likely to be impacted by the rise of AI, at least for the foreseeable future.Advertisement