Intro Introduction
Assalamu Alaikum. Welcome to Procoder. In this article, we explore an interesting experiment using deepseek to build a WordPress plugin. I previously showed you how to create a plugin with ChatGPT—which worked very nicely—but today we test whether deepseek can do the same job. With many saying that deepseek’s capabilities surpass those of ChatGPT, let’s dive into the process.
Overview Experiment Overview
The goal is simple: create a WordPress plugin that, after five seconds, displays a popup with the text “Welcome OK” and lets the user close it. We provided deepseek with a detailed prompt to generate the necessary PHP, JavaScript, and CSS code. Let’s review the step-by-step process.
Steps Step-by-Step Process
Local Environment Setup
I installed a basic WordPress locally so we could immediately test the plugin.
Prompting deepseek
I instructed deepseek: “I want to create a WordPress plugin where''''''' after five seconds it should show a popup with the text ‘Welcome OK’ that the user can close. Write the complete code for me so I can copy and paste it.” A minor spelling mistake was corrected in the prompt.
Creating Plugin Files
In the WordPress plugins folder, I created a directory named
Welcome Popup
and
opened it in VS Code. I then created the following files:
WelcomePopup.
, WelcomePopup.js
, and
WelcomePopup.css
, and pasted the deepseek-generated code
into each.
Activation & Testing
After pasting the code, I activated the plugin via the WordPress admin panel. Initially, an update warning appeared (set to version 110), so I changed it to version 2. Reloading the website confirmed that the popup appears after five seconds.
Review Code Review & Observations
deepseek generated a neatly structured PHP file complete with a plugin header (including the plugin name, author, and version) and integrated JavaScript and CSS for the popup functionality. This approach was cleaner and required fewer modifications than the code produced by ChatGPT in my earlier work.
Code Plugin Code Details
Below is a sample code snippet for the WordPress plugin generated by deepseek. This example includes the plugin header, a simple function to create a popup after five seconds, and the code to close the popup.
<?
/-**
* Plugin Name: Welcome Popup
* Plugin URI: https://example.com/welcome-popup
* Description: A simple popup plugin generated by deepseek.
* Version: 1.0
* Author: Your Name
* Author URI: https://example.com
*/
function wp_welcome_popup() {
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
setTimeout(function(){
var popup = document.createElement('div');
popup.innerHTML = 'Welcome OK
';
document.body.appendChild(popup);
}, 5000);
});
</script>
Final
Final Thoughts
This experiment demonstrates that deepseek can indeed generate a
WordPress plugin with similar functionality to what ChatGPT offers.
The code generated by deepseek was cleaner and more efficient in its
first impression, showing its potential for developers—even those
who have not enrolled in my course.
How excited are you about deepseek? Would you like more articles or
videos on this topic? Let me know your thoughts in the comments.