Build path · Intermediate
Your First WordPress Plugin
Go from "there's a plugin for that" to writing your own small, secure, properly packaged WordPress plugin, from the first file to a versioned zip you can install on a client site.
Go from "there's a plugin for that" to writing your own small, secure, properly packaged WordPress plugin, from the first file to a versioned zip you can install on a client site.
Who this course is for
This course is for you if you already build sites with WordPress and Elementor, and you keep hitting the moment where the answer is "you need a plugin for that". Maybe you are changing career or starting out as a freelancer, and your client sites are filling up with third-party plugins for small jobs: a reviews slider here, an opening hours box there. Each one adds weight, cost and risk. You want to write small, focused plugins for your clients instead, and you want to do it properly, with the security habits real developers use, rather than stopping at "hello world".
What you should know first
You should be comfortable in the WordPress dashboard (adding pages, installing and activating plugins, changing settings) and able to build a page with Elementor. If you are not there yet, start with the Begin2Code Elementor Beginner course, then come back. You do not need to be a PHP developer. Every piece of PHP is explained line by line as we write it, but it helps if you have looked at a little HTML and CSS before and are happy opening and editing files in a code editor. We set up the local site and the editor together in lesson 1.2, so you do not need anything installed before you start.
By the end of the course you will be able to
- Create a correctly structured plugin with a proper header, consistent prefixing, and activation and deactivation routines.
- Use actions and filters to change how WordPress behaves without editing core or theme files, and find the right hook for the job.
- Build shortcodes that output dynamic content safely.
- Register a custom post type with its own custom fields, and build a settings page using the WordPress Settings API.
- Load CSS and JavaScript the WordPress way, only on the pages that need them.
- Apply the core security habits on every form and every output: capability checks, nonces, sanitising input and escaping output.
- Build a simple Elementor widget with editable controls that displays your plugin's content.
- Make a plugin translation-ready, clean up after it with uninstall.php, package and version it, and explain how updates reach a live site.
Your course project
Across the course you build "Simple Testimonials" for a fictional client, Muddy Paws Dog Grooming, a small independent grooming salon at 14 Station Parade, Harrogate, HG1 2AB, run by owner Jess Hartley. Her Elementor site currently loads a heavy third-party slider plugin to show five customer reviews. You replace it with your own lightweight plugin, built lesson by lesson on a local copy of her site (muddy-paws.local). By the end, your plugin has a Testimonials section in the dashboard (a custom post type) with secure fields for the customer's name, the dog's name and a star rating from 1 to 5; a settings page; a [simple_testimonials] shortcode Jess can drop into any page; a stylesheet that only loads where testimonials appear; a custom Elementor widget; translation-ready text; a tidy uninstall routine; and a versioned 1.0.0 zip ready to install on the live site. To finish, you put your new skills to work on your own: you build an "Opening Hours" plugin solo, check it against the published marking guide and unlock your completion certificate.
Curriculum
-
Module 1: Plugin foundations · 9 lessons
- 1.0 Course trailer and how this course works
- 1.1 What a plugin is and when to write one
- 1.2 Setting up a local development environment
- 1.3 The PHP you need for this course
- 1.4 The plugin header and file structure
- 1.5 Prefixing, activation and deactivation hooks
- 1.6 Worked example: the Mirrorwell plugin skeleton
- 1.7 Module 1 recap
- Module 1 worksheet
- Module 1 check (quiz)
-
Module 2: Hooks, post types and shortcodes · 8 lessons
- 2.1 Actions: doing something at the right moment
- 2.2 Registering a custom post type
- 2.3 Filters: changing data on its way through
- 2.4 Finding hooks
- 2.5 Your first shortcode
- 2.6 Worked example: Mirrorwell's testimonials page
- 2.7 Module 2 recap
- Module 2 worksheet
- Module 2 check (quiz)
-
Module 3: Data, settings, assets and security · 7 lessons
- 3.1 A meta box for custom fields, and the law on testimonials
- 3.2 Security essentials: capabilities, nonces, sanitising and escaping
- 3.3 A settings page with the Settings API
- 3.4 Enqueueing CSS and JavaScript properly
- 3.5 Worked example: Mirrorwell's testimonials, secured and styled
- 3.6 Module 3 recap
- Module 3 worksheet
- Module 3 check (quiz)
-
Module 4: A simple Elementor widget · 6 lessons
- 4.1 How Elementor widgets fit into a plugin
- 4.2 Building the widget class
- 4.3 Rendering safely and reusing your code
- 4.4 Worked example: the Mirrorwell widget on the home page
- 4.5 Module 4 recap
- Module 4 worksheet
- Module 4 check (quiz)
-
Module 5: Packaging, releasing and updating · 8 lessons
- 5.1 Making it translatable and tidy
- 5.2 uninstall.php and cleaning up after yourself
- 5.3 Checking and packaging
- 5.4 How updates reach a site
- 5.5 The practical task: what to submit and how it is marked
- 5.6 Worked example: Mirrorwell Driving School's practical task submission
- 5.7 Module 5 recap and what comes next
- Module 5 worksheet
- Module 5 check (quiz)