My nephew said that it is possible to generate a WordPress Plugin completely with CoPilot. So I took on that challenge and came up with the BSO Random Image Plugin. This plugin, is designed to display random images from a folder. It offers a customizable experience for displaying random images with overlay text in WordPress.
The admin options are applied to the displayed images. You can set the number of images, overlay text position, image size, and space between images.
The plugin displays random images with overlay text from corresponding text files based on the settings. The folder structure looks like:
Finally, a shortcode creates a form and displays random images when the form is submitted. Example of page definition with shortcode.
All in all it took me less then a few hours to generate this plugin. If you know what you want, and can define it in clear requirements to CoPilot – CoPilot is able to cut down development time immensely. I can see that the future for a developer changing dramatically when using this tool. In that the developer needs to be able to quickly review the answer/generated code; correct code by hand (because there are more ways to solve problems in code); last but not the least know the functionality even more then before – to be able to determine whether a suggested solutions heads the right way or not. Anywayz, this might be a discussion for another time.
Steps to define the WordPress Plugin with CoPilot
Open a new browser tab page with CoPilot and chat the following:
- Create a WordPress plugin and name it “BSO Random Image Plugin”
- Add Basic Functionality:
- Display random images from a folder.
- Use a form tag to show the image on a page.
- Add overlay Text:
- Overlay text on the image, with the text provided in a text file with the same name as the image.
- Display the overlay text below the image with a small font size.
- Add Admin Dashboard Options:
- Define the number of random images to show.
- Define the position of the overlay text (Top, Bottom, Left, Right).
- Define the image size (Small: 200×200, Medium: 400×400, Big: 600×600).
- Define the space between the images in pixels.
- Define the padding around the images in pixels.
- Add shortcode:
- Create a shortcode to display the form and random images on a page or post.