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.
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!
I don't get how having to install Carbon Fields lets you create a package that can be shipped. Doesn't it need to be installed wherever you put the plugin? When I simply installed the plugin in my wordpress, it failed because of the lack of the vendor folder/carbon fields.
Thank you, Mr. Digital. I am new at this. This tutorial is excellent and I am encouraged to learn and implement it. I followed the steps in the video very closely but I could not get past the ajax section (45 min marker) because I kept getting "Uncaught ReferenceError: jQuery is not defined"? Any idea how/where I can properly define jQuery.
@@MassinissaMouhoub-eg9pq , HI, I had to enqueue the jquery library. Also to make the javascript code work i had to wrap this into a setTimeout, like: setTimeout(() => { jQuery(document).ready(function ($) {
}); }). I am not sure if this is the best way but I didn't find any other solution.
for those having error "Uncaught ReferenceError: jQuery is not defined", just add ob_start and ob_get_clean on show_contact_form function. Code will look like this: function show_contact_form() { ob_start(); include MY_PLUGIN_PATH . '/includes/templates/contact-form.php'; return ob_get_clean(); }
Unless I'm mistaken, the purpose of the __construct is to pass initial parameter values back into the class. If that is true, why use the __construct to manage the plugin path for auto-loading classes?
This is great! More similar tutorials like this will be amazing, few ideas: Using ACF Interacting with external API Using react on FP & CSS Library (Tailwind?)
Hi! Your contents are awesome! You teach very clearly, I came from the last plugin dev series you've done, and I would say I learned a lot from that. If you're familiar with javascript frameworks, such as svelte, do you have a setup to use it to develop a Wordpress plugin? It would be a great series! Any frontend framework will doo
This is great... I do have 1 issue: register_rest_route callback is not working; I had a permission_callback error so i added __return_true. Getting a 404 in the return header. Any idea what I am doing wrong? Looking forward to continuing the lesson.
I wonder why u used Carbon Field instead ACF? You have many videos on ACF, since this is the latest video, I was wondering if you find carbon field more useful overall?
for some reason is my form not working with the script. whenever i submit form it just goes to some blank page. but it doesnt respond with the javascript with jQuery. no errors in vs and no errors in wp or in the console. i dont know why this is happening. at 45:30
for those having error "Uncaught ReferenceError: jQuery is not defined", just add ob_start and ob_get_clean on show_contact_form function. Code will look like this: function show_contact_form() { ob_start(); include MY_PLUGIN_PATH . '/includes/templates/contact-form.php'; return ob_get_clean(); }
Hi. First of all, thank you for this. I am following this tutorial, installed Laragon. Everything was going smoothly but all of the sudden wordpress is not picking up the code from the folder? The front page is all blank and when i look at the source there's nothing. But my code still intact, no changes in the folder D:
Hey, thanks for the tutorial, my plugin is working so far. But I struggle with updating an existing submission. everything I tried always created a new submission instead of updating the old one - or it does not change save anything at all because I can't seem to get the correct post ID for the existing submission. Any idea?
Nevermind, I made it work. The title of a 'submission' is a unique userID. So I grab the existing post by using get_page_by_title that returns an object. This holds the correct post ID ('$postByTitle->ID'). Here's the snippet that works for me: $postByTitle = get_page_by_title( $params['userID'], 'OBJECT', 'submission'); foreach ($params as $label => $value) { update_post_meta ( $postByTitle->ID, $label, $value); }
Hello: I created your sample plugin. When I try to install I get Unpacking the package… Installing the plugin… The package could not be installed. No valid plugins were found. Plugin installation failed. This is the code:
e.preventDefault() const form = $("#enquiry_form") $.ajax({ type: "POST", url: "", data: form.serialize(), }) }) }); }, 50) Please, let me know if it worked.
Hey, I'm having some issues with verifying the nonce - it seems that it only verifies when I'm logged off, when I'm logged in it's not getting verified - Any ideas?
@@mrdigitalau Yes, it's just gives me the error message I've added when wp_verify_nonce function fails... When I'm logged out - it submits ok, wp_verify_nonce succeeds.
How do i make the form appear any where on the page like within a div i place it in? when i add the shortcode in it always shows at the top of the page
Hi Carina, go to your contact-form.php file and edit the "show_contact_form" function, can you change it to this and let me know if it works? function show_contact_form() { ob_start(); include MY_PLUGIN_PATH . '/includes/templates/contact-form.php'; return ob_get_clean(); }
somehow in my case JQuery wasn't working as in the video. So let me share what I did to fix it. (And... quite funny that in 2023 we are still using jQuery lol) symbol $ was generating some conflict so the first thing is add a "$ = jQuery.noConflict()" in the very first line of the form script. Then, you shall set "const form = $("#enquiry_form")" and work with the variable form all the time, it's possible that "$(this)" won't grab the form itself but the document. It happened to me because I was using arrow functions in stead of anonym function as in the video. And last, since the ajax action wasn't sending any data, PHP was thouing an error "_nonce key is not in array", so it may be a good idea to check first if the key is in the $params, and if is not, send a proper error warning, and not let PHP to send a debug error message.
Unfortunately, after watching this video after your five wordpress plugin from scratch series, as a beginner trying to learn developing plugins, this definitely wasn't simple. I got a lot from the security side of protecting the plugins. What happened to Part 6 and the end of the plugin from scratch? That was far easier to follow, probably as is was broken up a little more.
Great video, given you a sub and like ! Please make a another video on converting html website to Wordpress theme. Please let your html website have Author and authors page, tags page with each tag and its own post under, signup and signin page, membership page, comment section, single page, eror 404 page, archive page and more. Precisely for a blog. Waiting for my video request. Thank you in advance🙈
This ain't simple and maintainable at all as it requires carbon fields which is a rather complicated solution. Apart from that I wonder how an add-on using Composer can easily be shipped and installed into another WordPress.
@@michaelperlbach3438I agree that CF is not the easiest to use, the docs are hit-and-miss. The whole plugin vs library thing is confusing. Even the video is wrong, only carbon-fields needs to be installed the other is just a useless wrapper for it. I thought you meant that CF needs to be installed as WP plugin using Composer and that makes migrations difficult. But migration are easy as CF comes bundled into the plugin. I have had no issues with Composer.
@@kakosnaki You might have no problems with composer because you presumably have composer on your server and you have access to a shell. For hosting environments that do not provide for that this whole solution is useless.
for those having error "Uncaught ReferenceError: jQuery is not defined", just add ob_start and ob_get_clean on show_contact_form function. Code will look like this: function show_contact_form() { ob_start(); include MY_PLUGIN_PATH . '/includes/templates/contact-form.php'; return ob_get_clean(); } and also add this on contact-form.php under includes directory add_action('wp_enqueue_scripts', 'enqueue_scripts'); function enqueue_scripts() { wp_enqueue_script('jquery'); }
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.
Awesome, glad to have helped you mate. Take care
Thanks for covering the Carbon Fields inclusion. I have been looking for a way to do something like that recently. Great stuff.
You are very welcome Michael
The man is back! Thank you for this!
You're welcome!! Cheers
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!
Waiting for your tutorials. Finally, you uploaded.. Thanks
You're welcome, hope you like it!
You're a legend...have been following you from long time... Good to see new content...hope we'll see more of this type.
Cheers mate :) Will try to be be posting content more regularly!
I don't know why there are so little likes... you are the MASTER... tnx so much
Easy to understand, explain every case. You're the best. Hope you doing well. Keep it up, my man
No way, you are back 🎉glad to see you Sean
Hey Volodymyr, it's been a while hey. Hope you're doing well and staying safe over there mate.
Great tutorial!!! One of the best i have seen so far! Thank you for sharing your knowledge with all of us...
Thank you so much for this tutorial. I learned a lot about wordpress plugin creation fallowing you! You did such an important job.
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! 🔍
Sorry about that, I only realised after my marathon video :/ It's been a while..haha
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!
Absolute gem mate! I appreciate your effort to make this awesome video!
Thank you for putting out this awesome tutorial!
Truly appreciated 🙏🙏
Learned a lot form this tutorial. Thank you so much!!!!
I don't get how having to install Carbon Fields lets you create a package that can be shipped. Doesn't it need to be installed wherever you put the plugin? When I simply installed the plugin in my wordpress, it failed because of the lack of the vendor folder/carbon fields.
Thank you, I know now how to make a custom contact plugin.
Thank you thank you. Good to see a complete tutorial. Simple but yet functional. :) Good job!
Welcome back. Missed your videos
Thank you :)
Thanks! Very good tutorial. Learned a lot!
Thank you, Mr. Digital. I am new at this. This tutorial is excellent and I am encouraged to learn and implement it. I followed the steps in the video very closely but I could not get past the ajax section (45 min marker) because I kept getting "Uncaught ReferenceError: jQuery is not defined"? Any idea how/where I can properly define jQuery.
I got the same error :(
@@MassinissaMouhoub-eg9pq , HI, I had to enqueue the jquery library. Also to make the javascript code work i had to wrap this into a setTimeout, like: setTimeout(() => {
jQuery(document).ready(function ($) {
});
}).
I am not sure if this is the best way but I didn't find any other solution.
@@bernanribeiro3329can you please tell me how to enqueue the jquery library
for those having error "Uncaught ReferenceError: jQuery is not defined", just add ob_start and ob_get_clean on show_contact_form function.
Code will look like this:
function show_contact_form()
{
ob_start();
include MY_PLUGIN_PATH . '/includes/templates/contact-form.php';
return ob_get_clean();
}
Wow, you are back, thanks for the tutorial
You're welcome 😊
Unless I'm mistaken, the purpose of the __construct is to pass initial parameter values back into the class. If that is true, why use the __construct to manage the plugin path for auto-loading classes?
This is great! More similar tutorials like this will be amazing, few ideas:
Using ACF
Interacting with external API
Using react on FP & CSS Library (Tailwind?)
Hey Rob Thanks for your suggestions
Reckon you could give me an example of an external API to work with? I will do this in my next video
Cheers
@@mrdigitalau Hi, maybe something like Pixabay (using cURL for the example would be much appreciated)?
Hi! Your contents are awesome! You teach very clearly, I came from the last plugin dev series you've done, and I would say I learned a lot from that.
If you're familiar with javascript frameworks, such as svelte, do you have a setup to use it to develop a Wordpress plugin? It would be a great series! Any frontend framework will doo
Thanks for the new video, Mr. Digital,
You're welcome Chiva! Cheers
Thanks Mr Digital for the content! This is really helpful. Hope you'll make much more :))
This is great... I do have 1 issue: register_rest_route callback is not working; I had a permission_callback error so i added __return_true. Getting a 404 in the return header. Any idea what I am doing wrong? Looking forward to continuing the lesson.
Sean, that is an amazing tutorial.
I wonder why u used Carbon Field instead ACF? You have many videos on ACF, since this is the latest video, I was wondering if you find carbon field more useful overall?
Glad you're back.
Thank you mate :)
He's back!!!!
:)
Awesome, what a great tutorial.
Thanks very much mate, really appreciate it
You're back! 👀
Glad to be back mate!!
Thank you. Great lecture. That was super super helpful to me.
Great video. I am trying to include a Dropbox authorization as well. Could it be interesting if you create a video explanation for that too!
2:12:01 why not replace the $param[] fields with sanitzed versions?
for some reason is my form not working with the script. whenever i submit form it just goes to some blank page. but it doesnt respond with the javascript with jQuery. no errors in vs and no errors in wp or in the console. i dont know why this is happening. at 45:30
Facing the same issue, any updates?
for those having error "Uncaught ReferenceError: jQuery is not defined", just add ob_start and ob_get_clean on show_contact_form function.
Code will look like this:
function show_contact_form()
{
ob_start();
include MY_PLUGIN_PATH . '/includes/templates/contact-form.php';
return ob_get_clean();
}
Why function get_params() doesn't work. It show array with length == 0. Can you give me some solutions, please ?
45:00 shoudl be using es6 modules and (fetch) Promises these days. (and ignore jquery) And what was wrong with (instead of )?
Great Tutorial. Where do i find the basic theme?
Hey, long time no see, welcome back
Gday Loc, Thanks mate!!! All the best to you
Hi. First of all, thank you for this. I am following this tutorial, installed Laragon. Everything was going smoothly but all of the sudden wordpress is not picking up the code from the folder?
The front page is all blank and when i look at the source there's nothing. But my code still intact, no changes in the folder D:
Thank you for this tutorial. If I call the shortcode with php I display its content, but from the wordpress editor I don't see anything. Some advice?
Hi, I added the form with the shortcode. but there is an error saying form not active.
hi the css file isn't working. Are there any alterations on that?
can you tell the extenstion which you are using for wordpress developement
thanks, man. this really helped full.
wow, the moment i see die(you cannot be here). i know this guy is good. thx a lot for the video
Plugin could not be activated because it triggered a fatal error.
@ 14:00
Should I watch this newer video or the "Let's Build a WordPress Plugin From Scratch" series from 2021?
everything is good, but my jquery is not loading. Due to which I am not able to do learn further.
Can someone help ?
Composer is just a package manager for PHP, keeps track of all the different php packages, their versions, updates etc
Thanks for the video. Just a quick question. Do you know how to have the form on every page without using the shortcode?
You can think of creating some custom action hooks.
Thanks, man for this useful tutorial. When I activate the plugin I get a fatal error. I downloaded the zip file from your Github.
Hey, thanks for the tutorial, my plugin is working so far. But I struggle with updating an existing submission. everything I tried always created a new submission instead of updating the old one - or it does not change save anything at all because I can't seem to get the correct post ID for the existing submission. Any idea?
Nevermind, I made it work. The title of a 'submission' is a unique userID.
So I grab the existing post by using get_page_by_title that returns an object. This holds the correct post ID ('$postByTitle->ID'). Here's the snippet that works for me:
$postByTitle = get_page_by_title( $params['userID'], 'OBJECT', 'submission');
foreach ($params as $label => $value) {
update_post_meta ( $postByTitle->ID, $label, $value);
}
Amazing job! Well done!
Thanks for this, Can you also work on Gutenberg block on how to create custom blocks? Thanks
Hi, Yes, I will do a new video specifically for this!
@@mrdigitalau awesome 😎
Brother, I would like to display plugin update notice on the admin panel.. please make a video for this... Thank you so much...
When I added the jQuery instruction, I got problems saying jQuery isn't not defined.
PS: I'm developing on local host and I'm new to wordpress
Same here any update?
Hello: I created your sample plugin. When I try to install I get Unpacking the package…
Installing the plugin…
The package could not be installed. No valid plugins were found.
Plugin installation failed.
This is the code:
where you put your plugin, is it in correct place?
damn this was perfect man, thank you!
Welcome back
Thank You :)
To run the jquery I had to enqueue it, also I had to wrap the code into a seTimeout. is it because the new wordpress version?
Can you tell me how you did it.? The code
@@sidharth3881
add_action('wp_enqueue_scripts', 'enqueue_jquery');
function enqueue_jquery() {
wp_enqueue_script('jquery');
}
setTimeout(() => {
jQuery(document).ready(function ($) {
$("#enquiry_form").on("submit", (e) => {
e.preventDefault()
const form = $("#enquiry_form")
$.ajax({
type: "POST",
url: "",
data: form.serialize(),
})
})
});
}, 50)
Please, let me know if it worked.
Please, please for future tutorial increase the font size. Thank you
Super love ❤❤❤
Thank you, hope you like it!!
Hey, I'm having some issues with verifying the nonce - it seems that it only verifies when I'm logged off, when I'm logged in it's not getting verified - Any ideas?
Hey Rob. What happens when you are logged in? Does it just fail to send the email?
@@mrdigitalau Yes, it's just gives me the error message I've added when wp_verify_nonce function fails... When I'm logged out - it submits ok, wp_verify_nonce succeeds.
Thankyou Sir...
You're most welcome!
How do i make the form appear any where on the page like within a div i place it in? when i add the shortcode in it always shows at the top of the page
Hi Carina, go to your contact-form.php file and edit the "show_contact_form" function, can you change it to this and let me know if it works?
function show_contact_form()
{
ob_start();
include MY_PLUGIN_PATH . '/includes/templates/contact-form.php';
return ob_get_clean();
}
@@mrdigitalau yes that worked perfectly, you are the man!
Nice tutorial but you video resolution must should be 1080p
Thank u sir🙂
The shortcode causes the page its inserted into to not be able to update with invalid json response. :(
it gives me the same error. did you solve the error?
very useful thx
You're doing this in a WP folder.... you can't develop a plugin outside of a live WP project?
You can. Then zip the file. on the "Add new plugin" option in wordpress admin click on the "upload" option and then upload your zipped plugin file.
Would you like to make Woocommerce plugin & theme development tutorial?
thanks mate. G'Day
Awesome videos ++++++++++++ 🙂
Thank you so much for this tutorial. Could you please make a video where you integrate recaptcha?
Can you please record more video's please.. mate your are my teacher.. more thrn school or courses
somehow in my case JQuery wasn't working as in the video. So let me share what I did to fix it. (And... quite funny that in 2023 we are still using jQuery lol)
symbol $ was generating some conflict so the first thing is add a "$ = jQuery.noConflict()" in the very first line of the form script. Then, you shall set "const form = $("#enquiry_form")" and work with the variable form all the time, it's possible that "$(this)" won't grab the form itself but the document. It happened to me because I was using arrow functions in stead of anonym function as in the video. And last, since the ajax action wasn't sending any data, PHP was thouing an error "_nonce key is not in array", so it may be a good idea to check first if the key is in the $params, and if is not, send a proper error warning, and not let PHP to send a debug error message.
Can you please help me? I also faced the same error. How do i enqueue the jquery.
@@sidharth3881 oh, jQuery is already there, Wordpress include it by default
❤❤❤❤
Unfortunately, after watching this video after your five wordpress plugin from scratch series, as a beginner trying to learn developing plugins, this definitely wasn't simple. I got a lot from the security side of protecting the plugins. What happened to Part 6 and the end of the plugin from scratch? That was far easier to follow, probably as is was broken up a little more.
25:00 use \CarbonFields{CarbonFields,Field,Container];
Great video, given you a sub and like ! Please make a another video on converting html website to Wordpress theme. Please let your html website have Author and authors page, tags page with each tag and its own post under, signup and signin page, membership page, comment section, single page, eror 404 page, archive page and more. Precisely for a blog. Waiting for my video request. Thank you in advance🙈
make course on theme development
it's 4 years old but I think it's still relevant
ruclips.net/p/PLgFB6lmeXFOpHnNmQ4fdIYA5X_9XhjJ9d
The screen is too small to see well and the speech is too fast to understand.
zoom in can't see clearly
This ain't simple and maintainable at all as it requires carbon fields which is a rather complicated solution.
Apart from that I wonder how an add-on using Composer can easily be shipped and installed into another WordPress.
Carbon is installed as a plugin dependency, not as a WP theme dependency or separate WP plugin
@@kakosnaki Does this in any way weaken my objections?
@@michaelperlbach3438I agree that CF is not the easiest to use, the docs are hit-and-miss. The whole plugin vs library thing is confusing. Even the video is wrong, only carbon-fields needs to be installed the other is just a useless wrapper for it.
I thought you meant that CF needs to be installed as WP plugin using Composer and that makes migrations difficult. But migration are easy as CF comes bundled into the plugin. I have had no issues with Composer.
@@kakosnaki You might have no problems with composer because you presumably have composer on your server and you have access to a shell. For hosting environments that do not provide for that this whole solution is useless.
Ssadly, the man has gone again so no point in subscribing 😞
for those having error "Uncaught ReferenceError: jQuery is not defined", just add ob_start and ob_get_clean on show_contact_form function.
Code will look like this:
function show_contact_form()
{
ob_start();
include MY_PLUGIN_PATH . '/includes/templates/contact-form.php';
return ob_get_clean();
}
and also add this on contact-form.php under includes directory
add_action('wp_enqueue_scripts', 'enqueue_scripts');
function enqueue_scripts()
{
wp_enqueue_script('jquery');
}
1:52:56 what about echo get_post_meta($post?id, $column, true):