I requested a ChatGPT WordPress plugin. It took around 5 minutes.

I provided ChatGPT with a brief description of what I required, and it created the entire application, including the user interface and logic.

Not to put too fine a point on it, but I am more than a little scared. As an experiment, I requested that ChatGPT create a plugin that would assist my wife in administering her website. ChatGPT wrote the entire thing, including the user interface and logic, based on a brief description I provided.

In fewer than five minutes.

 

ALSO READ:125+ Top-Rated ChatGPT Prompts for Every Type of Workflow

 

This has consequences. In a few moments, we'll discuss this topic. Let me begin by describing the event and what transpired.

 

The need

 

My wife is the proprietor of a WordPress-based e-commerce website devoted to a popular pastime. Additionally, she administers a very active Facebook group for her website's consumers. She generates a random list of names every month and then creates a virtual wheel spin animation for the Facebook group using this list. She has been utilizing an online site that does a passable job of randomizing lines but charges more than necessary for exporting the list.

As I observed her struggle to re-display the arbitrary names, I thought it might be useful to create a WordPress plugin that could be installed on her website. This would be a useful aid for her, as she uses the dashboard daily.

But even a straightforward plugin would take me several days to write, what with the user interface elements and logic code, and I'm currently quite busy with other projects.

Then ChatGPT came to mind. I decided to give ChatGPT as a programming tool a try after reading about it in the media.

 

The prompt

 

A meticulously crafted prompt is required for ChatGPT to generate anything. Consider it to be a manager or client in the context of programming. To obtain what you want, you must describe your requirements in detail. Just to see if it would work, I began with a very basic prompt. I used the following prompt:

Write a PHP 8-compatible WordPress plugin that provides a text field into which a list of lines can be inserted, as well as a button that, when pressed, randomizes the lines in the list and displays the results in a second text field.

The code on the right was generated within a minute. I pasted the generated code into a.php file, placed it in a folder with the same name as the.php file, compressed it, and then uploaded it to her server. This worked.

My wife was appropriately impressed and astonished when I showed it to her. Then, her wheels began to revolve, and she requested a new feature: ensuring that duplicate names are not displayed next to one another.

Occasionally, she will need to include a person's name multiple times on a list for her application. She did not want duplicates to congregate, however.

I altered my initial prompt by incorporating the following additional conditions:

...ensures that no two identical entries are adjacent (unless there is no other choice)...with the number of lines submitted and the number of lines returned being the same.

 

ALSO READ:GPT 4: How to Use It? Chatgpt-4 Register, Login, GPT-4 Install App

 

I included the phrase "unless there's no other option" and the identical count requirement because I wanted to ensure that all the names were included and was concerned that it would prioritize the requirement that no two names be side-by-side over retaining all the names.

I had a new plugin in roughly 30 seconds. I uploaded and tested it after uploading it to the server. It was successful, but the output contained some vacant lines. So I added this stipulation to my previous prompt:

Without any white space...

I had become acclimated to the turnaround time, which was consistently less than a minute. One more upload and test, and it once more functioned.

I desired one last feature to validate how many lines were processed. I desired that the plugin display a line count for the input and output elements. Here is the timely addition:

...under the first field, display the text "Line to randomize:" followed by the number of non-empty lines in the source field. Display under the second field the text "Lines that have been randomized:" followed by the number of non-empty lines in the destination field.

Generally, this worked. The output field contains one line prior to execution. However, once the randomization procedure is complete, it displays the correct number of lines in both fields.

 

Quality of the code

In general, the code was of high quality. Because the original response does not fit in the article, I am only presenting it. The program generated the WordPress header block, created the dashboard user interface for the plugin, and coded the plugin's processing logic.

Even though I specified below, it did place my summary lines above the fields, which is not a major issue. It is the same type of error a client might receive from a human contractor, which would necessitate some revision.

Although the coding was functional, it did not adhere to all of the best practices for WordPress programming. The user input was not, for example, sanitized. The WordPress community is strict about sanitizing input to prevent hackers from stuffing fields with data that can compromise a website, but this code lacked any such safeguards.

As a later test, I did instruct the A.I. to sanitize input, which it did... to a degree. It sanitized the input within the PHP function, but it did not sanitize the input when invoking PHP from HTML. That would have unquestionably opened the door to intruders.

In addition, it eliminated the plugin's Settings menu item. Probably, I would have placed it under Tools or created a separate menu item for the feature. I believe ChatGPT made a reasonable decision in situating the menu item where it did, given that I did not specify where it should be accessible.

I added one last requirement to my query, asking the AI to name the plugin:

Create a WordPress plugin named "Robo Randomizer" that is compatible with PHP 8 and...

Inexplicably, the AI gave me a completely different plugin, one that generates a shortcode rather than a dashboard interface. Let me explain that to non-WordPress users because it is fascinating.

When writing something of this nature, you can make it accessible to website visitors (called the frontend) or those who enter into the site's dashboard to maintain the side (the backend). In my initial set of queries, I did not specify whether I wanted a frontend or backend interface for the tool, but the AI created a backend dashboard interface for the tool as requested.

However, this time it decided to write the plugin as a front-end utility, allowing it to be executed via a shortcode. In WordPress, you can embed a shortcode (such as [randomize lines]) in a post, and it will execute the code in a plugin. The most recent AI-generated version provided me with a shortcode that would have enabled the randomize lines feature to be displayed to site visitors.

Following this, ChatGPT lost the plot. I was not able to get additional features added to the original plugin, and ChatGPT mainly just replicated generating the shortcode version. Code maintenance is obviously not one of ChatGPT's primary competencies.

 

Implications

Clearly, this plugin is straightforward. It is roughly the magnitude of the assignments I assigned to my UC Berkeley first-year programming students. It pales in comparison to the complexity of the open source WordPress modules I maintain for over 50,000 users that are significantly larger.

When I first used ChatGPT to create the quickie plugin for my wife and tweeted about it last week, my social media contacts responded. Among their concerns were the following:

Is it evil?One individual feared that the AI would embed malicious (or at least promotional) information in the module, and a non-programmer user would be unaware. But the reality is that if you're not a coder and can't comprehend code, even if you contract with another human, you have no idea what's inside. It boils down to either relying on the code's reputation or having someone you do trust examine it. In the case of the code generated by my investigation, it was pristine.

Is it of its highest quality?Again, people held the artificial intelligence's code to a higher standard than even human programmers. I'm a proficient programmer, but my code contains flaws. At least initially, it is not the finest it can be. However, code written by humans improves over time. I am uncertain as to whether an AI is capable of enhancing, debugging, and enhancing existing code. Occasionally, however, objects must be merely functional. It is not always relevant whether or not they are the finest of the best. Typically, adequate suffices. And the code it generated was sufficient.

Will fewer jobs for human programmers be available?In all likelihood. I despise it when a machine takes a person's job, particularly if it's one I'd like to have. Whether writing or programming, AI is unquestionably a viable option for fast and simple tasks. Surely, this will have an effect on people's wages.

I have spent decades researching AI. I composed a thesis on AI. Nevertheless, despite all of this context, I've been surprised by the recent surge of high-quality generative AI. Consequently, what we're considering now is the "good enough" level of productivity. Sadly, this is a common request from customers.

The opinions, anecdotes, and years of experience reflected in these articles prevent ChatGPT and its associates from producing similarly in-depth analysis articles at this time. While they could likely write subroutines and functions for larger coding projects, they lack the ability to write significant coding projects.

In order to integrate a major API provider's service with mine, I've had to attend 20 to 30 meetings with them in the past year. Most of these meetings combined business concerns with technical requirements and licensing regulations. I defy any artificial intelligence to endure, comprehend, and satisfy the partner requirements of such a bureaucratic situation, and then produce code modules upon which all parties can concur.

 

ALSO READ:ChatGPT stores your data?

 

So, yes, I am a little creeped out by how well the plugin I "made" for my wife worked. However, AI has a long way to go before it can replace experienced developers and writers, so long as consumers desire the type of work produced by such professionals. And about this, my dear companions, I am concerned.


Ojike Stella

1727 Blog posts

Comments
Stellamaris Orode 47 w

Ok that's nice

 
 
ego glory 47 w

wow

 
 
ego glory 47 w

wow

 
 
ego glory 47 w

wow

 
 
ego glory 47 w

wow

 
 
ego glory 47 w

wow