


ChatGPT wrote the plug-in in five minutes. It has perfect functions and can also add requirements to correct bugs.
ChatGPT, what is your level of writing code?
In less than 5 minutes, I made a WordPress (a content management system software) plug-in, and the code is very clean.
The tester’s name is David Gewirtz, a veteran who entered the IT industry in 1982. Companies he has worked for include: Symantec , Apple, Pyramid Technology.
Even with 40 years of experience in the industry, he couldn’t help but sigh after seeing the capabilities of ChatGPT:
I thought there wouldn’t be too many surprises, but I was surprised. One jump.
In the review article, he also said that it was all fascinating, surprising, and scary at the same time.
So, how exactly did he do the test?
Let’s take a look together.
Not enough energy, ChatGPT comes to help
The reason David wants to use ChatGPT to write code this time is because his wife is running an e-commerce website. Every month, she needs to according to customer groups Randomly select a part of the names from the list to generate a carousel animation.
In the past, Brother David’s wife used a website to generate random lists. However, this service required a fee and was not cheap. So, my brother decided to use his "technical skills" and write a WordPress plug-in to help his wife "reduce costs and increase efficiency."
Then here comes the problem - even a small WordPress plug-in takes several days to complete, which requires adding user interface elements and writing logic code. Since I am too busy, David Thinking of it——
Isn’t ChatGPT very popular recently? How about giving it a try?
Just do it, he first wrote the first prompt, describing what the desired text (code) is.
The details are as follows:
Write a PHP 8-compatible WordPress plug-in, which provides a text input area for pasting the list into, and a button that can be pressed to The input entries are randomly arranged and displayed.
In less than a minute, the code was generated:
△ Picture source: David Gewirtz/ZDNET
The tester copied the above code into a .php file, compressed it and uploaded it to the server.
Well, it works in personal testing.
When he showed the plug-in to his wife, she was surprised, but she immediately added a new requirement: duplicate names cannot be next to each other.
So, the coder ChatGPT has a new task.
Need to ensure that identical entries are not next to each other (unless there is no other option)... In addition, the number of input entries and the number of result entries must be the same.
30s later, the results came.
Same as usual, upload to server and test - it works, but the output contains blank lines.
Then give it a hint.
...There can be no blank lines...
A Few Moments Later...
The results are here again, and the test results are OK.
Continue to increase efforts, the tester hopes that the plug-in can count how many rows of data have been processed.
As a result, ChatGPT can still be completed.
Let us take a look at the final form of this plug-in, which has quite complete functions:
One of the flaws is that the code does not contain all the best/most standard implementation methods of WordPress. If the user input is not sanitized, this process means that hackers cannot fill in the fields or destroy the data. The WordPress community also has strict requirements.
For this reason, the author tried to adjust ChatGPT. As a result, it was adjusted, but not completely adjusted... The code only cleaned the input of the PHP function, but did not clean the input when calling PHP with HTML, which would still allow hackers to exploit loopholes.
Another problem is that the author asked AI programming to also name the plug-in, but it generated a completely different plug-in.
And subsequent testers tried to add more functions, but they were unable to achieve it, which shows that ChatGPT is not very good at code maintenance.
Finally, the test brother talked about his feelings.
Currently, there is no problem in writing a simple plug-in for ChatGPT, and the whole process still makes his eyes shine.
However, this is still a simple task, equivalent to a college student's homework. In comparison, maintaining an open source plug-in for 50,000 users is definitely more complicated.
Netizen: Malicious code may be inserted
It is worth mentioning that this old man also asked netizens what they were worried about using ChatGPT to generate code, and gave his own opinion.
Some people worry that AI will add malicious code or promotional information to the program at random. In this regard, the tester added that at least in the above programming, the ChatGPT generated code is clean.
Some people also think that it cannot give the best code. For this problem, testers think that the functional performance is sufficient, and good enough is enough.
Some people are worried that it will replace the work of human programmers, and David who tested this time also feels the same way.
Finally, have you asked ChatGPT to type the code? How's the effect?
Reference link:
[1]https://www.php.cn/link/a98a009d68cad18ae7b1d3576bb01924
[2]https://www.php.cn/link/f7b6bc883be91f56eb248d72de4d2847
[3]https://www.php.cn/link/acef5cc0bd5a0c190494e34ea4b04811
The above is the detailed content of ChatGPT wrote the plug-in in five minutes. It has perfect functions and can also add requirements to correct bugs.. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

DALL-E 3 was officially introduced in September of 2023 as a vastly improved model than its predecessor. It is considered one of the best AI image generators to date, capable of creating images with intricate detail. However, at launch, it was exclus

PHP and Flutter are popular technologies for mobile development. Flutter excels in cross-platform capabilities, performance and user interface, and is suitable for applications that require high performance, cross-platform and customized UI. PHP is suitable for server-side applications with lower performance and not cross-platform.

WordPress posts are stored in the /wp-content/uploads folder. This folder uses subfolders to categorize different types of uploads, including articles organized by year, month, and article ID. Article files are stored in plain text format (.txt), and the filename usually includes its ID and title.

WordPress template files are located in the /wp-content/themes/[theme name]/ directory. They are used to determine the appearance and functionality of the website, including header (header.php), footer (footer.php), main template (index.php), single article (single.php), page (page.php), Archive (archive.php), category (category.php), tag (tag.php), search (search.php) and 404 error page (404.php). By editing and modifying these files, you can customize the appearance of your WordPress website

The most stable WordPress version is the latest version because it contains the latest security patches, performance enhancements, and introduces new features and improvements. In order to update to the latest version, log into your WordPress dashboard, go to the Updates page and click Update Now.

Open AI’s ChatGPT Mac application is now available to everyone, having been limited to only those with a ChatGPT Plus subscription for the last few months. The app installs just like any other native Mac app, as long as you have an up to date Apple S

Open AI is finally making its foray into search. The San Francisco company has recently announced a new AI tool with search capabilities. First reported by The Information in February this year, the new tool is aptly called SearchGPT and features a c

WordPress requires registration. According to my country's "Internet Security Management Measures", websites that provide Internet information services within the country must register with the local provincial Internet Information Office, including WordPress. The registration process includes steps such as selecting a service provider, preparing information, submitting an application, reviewing and publishing, and obtaining a registration number. The benefits of filing include legal compliance, improving credibility, meeting access requirements, ensuring normal access, etc. The filing information must be true and valid, and must be updated regularly after filing.
