Introduction
WHM plugins add new functionality to the WHM interface.Third-party developers can add icons that link to new WHM interfaces, or to other files or locations, to the WHM Plugins interface (Home >> Plugins).
Note:
For information about cPanel plugins, read our Guide to cPanel Plugins documentation.
Plugin development workflow
When you create a WHM plugin, we recommend the following workflow:
-
Create your custom application (the plugin's backend code).
-
Create the plugin's interfaces.
Note:
You may also wish to create a package extension for your plugin. Package extensions add custom fields to packages and accounts. These fields can accept customized non-standard variables that you can use in your WHM plugin.
- Use the AppConfig system to register your plugin with the WHM interface.
- Compress your plugin's files for distribution. The compressed file contains the application source files, the plugin registration file, and an installation script. For example:
/var/cpanel/apps/example.conf
— The configuration file./usr/local/cpanel/whostmgr/docroot/cgi/example
— The file that contains the backend code from step 1./usr/local/cpanel/whostmgr/docroot/addon_plugins/
— The.jpg
icon image file.-
/usr/local/cpanel/whostmgr/docroot/templates/
— The plugin interface directory.
Note:
We recommend that you compress your plugin's files as a tarball (
.tar.gz
) file, which makes the plugins easier to distribute.
Plugin files
WHM interfaces can include HTML, Template Toolkit, PHP, or CGI files. You must store plugin interface files in the/usr/local/cpanel/whostmgr/docroot/templates/
directory.
WHM icons
When you register your plugin, the AppConfig configuration file automatically adds your plugin's icon to the WHM interface.
- WHM icons must be 25x25 pixels.
- Image files must be
.gif
or.jpeg
images. - Images must possess white backgrounds, and cannot be transparent.