My Plugin Manager is a drop-in script for your WordPress theme or plugin, which gives your users an interface to manage plugins you suggest be used with your product.
Download and Usage
Please do not copy the files from this repository directly into your WordPress project. Make sure to use one of the methods below to generate the script for your specific project.
Our goal is to provide you with a drop-in script that complies as closely to WordPress coding standards and best practices, as possible. So by generating a custom build for your project, the following will happen:
- Prefix all PHP class names to match your theme or plugin name.
- Name all class files to correctly correspond to the name of those PHP classes.
- Insert your unique namespacing key for anything submitted to the database.
- Insert the localization text domain that matches your theme or plugin.
- If the "plugin" usage type is selected,
add_theme_page()will be substituted for
add_submenu_page()(not allowed in themes).
- Give you an example code snippet to get started, which is customized to your project.
Method 1: Use the Online Generator
The easiest way to incorporate your new plugin manager into your WordPress theme or plugin is to generate a custom instance for your project at:
After you've submitted the form, your plugin manager download will start and you'll be shown instructions specific to your project to get started.
Note: Curious how mypluginmanager.com is built? It's an open source PHP web app. Check it out here.
Method 2: Clone the Repo
- Clone this repository to your local computer.
- Edit the variables in
build-config.jsto match your project.
- Within the cloned repo, run
npm installto install all of dependencies from your terminal.
- Then run
npm run buildto generate a custom build specific to your project, using data from the
- Within the
/distdirectory, find the
plugin-managerdirectory that was generated and copy it to the root of your WordPress theme or plugin.
- Also within the
/distdirectory you'll see an
example.phpfile. You can copy the contents of this file into your theme or plugin's PHP code as a starting point to implement the script.