Simple WordPress Plugin Development - Start to Finish

58,250
0
Published 2022-10-12
This video aims to demonstrate how to create a simple WordPress plugin.
In this specific tutorial, we will be focusing on building a contact form plugin, it will allow you save submissions into the database using a Custom Post Type, as well as send the submission via email. You'll also have a plugin options page to add any special options you'd like to customise how your plugin works. I've tried to address security issues like Sanitisation, Nonces and ways to protect your plugin and WordPress installation in general.

There's obviously a lot more stuff we can do with it, but to keep this tutorial simple as possible, I've addressed the most common needs for a plugin. In future, I will add to this specific plugin extra features. So stay tuned!

Github Repo: github.com/mrdigitalau/mrdigital-contact-plugin-tu…
Really Simple WP Theme used in this video: bit.ly/3ViQBEN

00:00 Start
00:20 Basic Introduction
02:40 Plugin Folder setup
03:20 Securing your plugin
08:17 Create your Plugin Class
09:28 Installing Carbon Fields into Plugin via Composer
13:19 Set up Composer Autoload & Constant for Plugin Path
15:28 Instantiate our Class
16:05 Breaking our Plugin into Separate Files for Simplicity
18:20 Setting up Carbon Fields for our Custom Plugin Options
34:45 Creating a Shortcode for our Contact Form
38:16 Create Form Template for Front End Display
41:43 Set up REST Endpoint to Receive Post Requests
44:34 Set up AJAX to Point to our REST Endpoint
51:13 Handle Form Data (Nonce check, Send Email)
1:12:58 Displaying Submissions in the WordPress Admin (Custom Post Type)
1:27:53 Set Up Meta Box to Display Submission Data
1:45:10 Creating Custom Columns on Submission Post Type
1:54:07 Enable Searching Custom Meta Data in Submission Table
1:58:55 Enqueue CSS for Contact Form
2:05:15 Sanitising Form Data
2:15:20 Make Plugin Options Work in Our Plugin
2:24:24 Sort Plugin Menu Order
2:26:03 Make Submissions Only Accessible By Admins
2:27:01 Summary & Ending

All Comments (21)
  • Thanks man. There are different things to learn from this video. You have helped a soul. Composer usage in the plugin/ folder architecture and understanding how to use a library. 👏 I love it.
  • Easy to understand, explain every case. You're the best. Hope you doing well. Keep it up, my man
  • @paulthornton1302
    This is an excellent and very informative tutorial. It has provided me with a much better understanding of how to create a plugin. Thank you for your time and effort!
  • @Shon3GEES
    Thank you thank you. Good to see a complete tutorial. Simple but yet functional. :) Good job!
  • Waiting for your tutorials. Finally, you uploaded.. Thanks
  • @mpgilbertusa
    Thanks for covering the Carbon Fields inclusion. I have been looking for a way to do something like that recently. Great stuff.
  • Amazing tutorial, you covered so much ground and I like the fact that you worked through the bugs too. Hope you got some sleep after that all nighter!
  • You're a legend...have been following you from long time... Good to see new content...hope we'll see more of this type.
  • @johnpdev
    Absolute gem mate! I appreciate your effort to make this awesome video!
  • @olgademina6414
    Thank you so much for this tutorial. I learned a lot about wordpress plugin creation fallowing you! You did such an important job.
  • @srdjan02
    I don't know why there are so little likes... you are the MASTER... tnx so much
  • @WPCookie
    Thank you for the tutorial, but I wish you would follow the first rule of creating tutorial videos, which is to use a large font in your editor! 🔍
  • @josephs.8474
    Thanks Mr Digital for the content! This is really helpful. Hope you'll make much more :))
  • @genie7941
    Thank you. Great lecture. That was super super helpful to me.