Skip to main content

Programming language to create cPanel plugin?

Comments

9 comments

  • cPanelTJ
    Hi hansdesjarlais, I hope some plugin developers can weigh in on your question as well, but I'll share my thoughts. Plugins can be written in any language compatible with the Linux shell, but what I can recommend is either Perl or PHP, or a combination of both, as it really depends on how much you're working with cPanel vs. working with WordPress. Perl will make it is easier to access certain cPanel functionality as it's written in Perl and the same can be said for PHP and WordPress.
    0
  • hansdesjarlais
    Hi hansdesjarlais, I hope some plugin developers can weigh in on your question as well, but I'll share my thoughts. Plugins can be written in any language compatible with the Linux shell, but what I can recommend is either Perl or PHP, or a combination of both, as it really depends on how much you're working with cPanel vs. working with WordPress. Perl will make it is easier to access certain cPanel functionality as it's written in Perl and the same can be said for PHP and WordPress.

    Thank for the response @cPanelTJ I do have 2 more questions for you. #1 - What is the best way to setup a cpanel plugin development environment? I was thinking of setting up a small Linode instance with a LAMP stack and then installing cPanel. Do you recommend anything better or easier? #2 - I watched one of your cPanel Youtube videos explaining how to work with the API. For my purposes, should I be working with API1 or API2?
    0
  • cPanelTJ
    Hi @hansdesjarlais, #1 - If you don't have one already, definitely grab a developer's license: Developer License Application. Regarding the environment, it really depends on the application you're trying to develop and what all it may interact. Mostly all cPanel&WHM servers will be running on a version of CentOS. I really don't have too much of a preference, but maybe other external developers can weigh in here. In the end you'll want to make sure your application will install and run as expected on a realistic cPanel&WHM environment. #2 - For cPanel user operations, WHM API 1 is the recommended API to use. We are currently working on consolidating our cPanel APIs so that all functionality is supported in UAPI. The majority of cPanel API 1 functionality will be ported to UAPI in version 86, and project is planned for completion in version 88. If you need specific functionality within UAPI and you don't see it currently, let me know and I can give you an accurate update on when it would be available and/or a recommendation to use instead.
    0
  • hansdesjarlais
    Hi @cPanelTJ Thanks for the responses. I have setup a dev environment and managed to get my custom plugin installed. I have a question about how to enqueue Javascript/jQuery into my files. I see that paper_lantern is using BootStrap v3.1.1, however my custom Jquery code isn't working unless I link in an external copy. This is how I added it at the bottom of my index.live.php file. [CODE=php] footer(); // Add the footer. $cpanel->end(); // Disconnect from cPanel - only do this once. ?>
    Can you help clarify how I can do this without using an external source?
    0
  • cPanelTJ
    @hansdesjarlais, I had to do some digging on this one and ask a few of my team's developers. Would something like this solve your problem? [CODE=php] header('Testing output'); print 'some stuff'; ?> footer(); $cpanel->end(); // Disconnect from cPanel - only do this once. ?>
    This is under the assumption that the file is within paper_lantern of course.
    0
  • hansdesjarlais
    Hi @cPanelTJ Yup, I think it does. I'm going to test that out. Thx.
    0
  • hansdesjarlais
    Hi @cPanelTJ Ok, so that worked but with a slight change. [CODE=php]
    0
  • cPanelTJ
    Hi @cPanelTJ Ok, so that worked but with a slight change. [CODE=php]

    Great to hear!
    0
  • antlemonthorn
    Hi @cPanelTJ Thanks for the responses. I have setup a dev environment and managed to get my custom plugin installed. I have a question about how to enqueue Javascript/jQuery into my files. I see that paper_lantern is using BootStrap v3.1.1, however my custom Jquery code isn't working unless I link in an external copy. This is how I added it at the bottom of my index.live.php file. [CODE=php] footer(); // Add the footer. $cpanel->end(); // Disconnect from cPanel - only do this once. ?>
    Can you help clarify how I can do this without using an external source?

    // Keep these files local (Copy to their own Files respectly - Your Welcome in Advance! require_multi('../js/jquery.min.js','../js/bootstrap.min.js','../js/script.js'); require('../config/php.config'); echo $cpanel -> footer(); $cpanel ->end(); ?>
    0

Please sign in to leave a comment.