Almost every other day, I think: “wouldn’t it be nice is I could do this?”. But then I think about the hour or so it will take to copy and paste a base plugin together and realize that I’ve got better things that I should be doing.
Well, in one of those thoughts, I thought it would be nice to have a base plugin, ready to go. Answer a few key questions and poof, there’s a plugin ready to go.
That’s exactly what the Plugin Starter Kit does. It sets up the base files, including the plugin name.php file, the style sheet, and a javascript file. The plugin sets up a class for the bulk of the functionality and includes (require_once) everything that needs to be included.
With the exception of the functionality that you want, this plugin creates a plugin that is ready to be activated, complete with a dashboard menu item.
I’m working on an upgrade which will let the user choose a few more options like:
- Does it need a Javascript file?
- Does it need it’s own stylesheet?
- Will it be complex enough to need a separate class?
- Will it need a shortcode? Or a Gutenberg block?
- How about an AJAX call? Typically, I build my plugins with the AJAX php target functions in their own class. It separates them nicely, and they’re all in one place, instead of scattered throughout the code.
- Or maybe it’s a simple enough plugin that it only, really, needs a functions.php file and a stylesheet.
This plugin isn’t available anywhere yet. But it will be available on GitHub soon.
© 2018, PaulSwarthout. All rights reserved.