Divi Plugin Creator
The Divi Plugin Creator extends the functionality of the Divi Module Builder, giving you the option to turn any custom module into a standalone plugin. Once activated, the Plugin Creator link will appear as a submenu item under Custom Modules. Click on this link to open the Plugin Creator page.
The Plugin Creator page has two tabs:
- New Plugin
- My Plugins
The New Plugin tab is where you will create your plugin. The tab contains two sets of options:
- Basic Options
- Advanced Options
The Basic Options panel contains optional and required fields that are universal for all WordPress plugins.
- Select the module you want to include in the plugin – This select box will contain all of your published modules. Only modules that are published will display in this list. Select the module you want to use to create the standalone plugin.
- Plugin Prefix (required) – The Plugin Prefix is used to differentiate your plugin folder, functions, scripts, etc. from other WordPress plugins that might use the same names. This could potentially cause conflicts or even a fatal PHP error. The prefix should contain at least two or three characters and should be different for different plugins you create. If your company name is Acme Plugins and your plugin name is Really Fantastic Plugin, your prefix might be ap_rfp. If you create another plugin called Another Fantastic Plugin, your prefix could be ap_afp.
- Plugin Name (required) – The Plugin Name is the name of the plugin as you want it to appear on the plugin page in the admin of the WordPress website it is installed.
- Plugin URI – This should be the URL of the plugin. It can be the sales or download page on your website for this specific module.
- Plugin Description – This description is displayed on the plugin page in the admin of the WordPress website it is installed.
- Plugin Author – Your name or company name.
- Author URI – This should be the URL of your website.
- Include GPLv2 license – Check this box if you want to license your plugin under the GPLv2 license. This will add licensing verbiage to the top of the plugin’s main file.
- Dependency URL – Enter the CDN URL for the dependency.
Click the Add Dependency button to enter additional dependencies.
Once you have filled out the information in the Basic Options panel and added all dependencies, click the Create Plugin File button to convert your module into a standalone plugin. Once the plugin is ready, you can download it using the Download Plugin button that appears.
You can view previously created plugins from the My Plugins tab. These are stored in the /uploads/dmb/plugins/ folder. You can delete or download your plugins from this page.
When a plugin is created, the module is assigned a class name with an ID that corresponds to the ID of the custom module. This ID is auto generated by WordPress when you initially create the module. It’s important that this ID remains the same when updating your plugin, otherwise all instances of the custom module added to any page in a Divi website that your plugin is installed will lose the reference to the module. In other words, the module will break.
To keep the same module ID, you MUST update the original module on the original website and select that module from the dropdown in the Divi Plugin Creator. If you create the plugin from a different module or from a different site that has the Divi Plugin Creator installed, the module ID will not match the original.
The plugin prefix does not get added to custom functions added under the Add Custom Functions section when creating or editing a module. To limit the likelihood that your function names will conflict with function names from other WordPress plugins, you should add your prefix to all custom functions within each module.