Do you have an app you want to promote? Integration with cPanel and WHM can bring benefits. Integration can give it worldwide exposure, active marketing and app support, among other things.
In the first place, how do you make sure you app is cPanel and WHM friendly? Here are some things you should know first.
The cPanel plugin development workflow
cPanel is driven by an API system, so interactions between the front and back ends of cPanel are handled by API calls. These API calls are divided into two categories: API1 and and API2.
Either API function corresponds to a function contained within a Perl module. In cPanel the Perl modules are located in /usr/local/cpanel/Cpanel.
The decision whether you should use an API1 or API2 depends on the functions you wish to use and the data you wish to work with. API1 can let you work with a single piece of data like a single string or integer while API2 can let you work with multiple pieces of data or a custom template.
The front end of your plugin
Your plugin’s front end interface should consist of HTML, PHP, or CGI files placed in the following directory:
These files can be accessed via
For those who don’t want any hassle HTML is the fastest available option. In using HTML, you can provide logic and querying via cPanel HTML tags. Using cPanel HTML tags will depend on what API you wish to use for the operation.
If you opt to use PHP you have two implementation options to choose from:
In choosing a CGI application, remember that you cannot directly access cPanel’s API. You will have to use cPanel’s XMLAPI to do this.
cPanel plugin registration file
cPanel will recognize your plugin through the cPanel Plugin Registration File. After creating the file, you will need to run the following command:
You can also bypass this system by writing dynamicui files directly, these files allow you greater flexibility but are also more complex.
As mentioned above, cPanel currently does not provide a universal method for managing plugins. To distribute your plugin you will have to provide a script that installs your plugin. That script should: