PHP Plugin not loading in header

Mauritz

Well-Known Member
Apr 29, 2015
62
1
6
Johannesburg
cPanel Access Level
Root Administrator
I created my first WHM plugin today (in PHP) which fundementally works perfectly, however, the plugin does not appear to load into the WHM wrapper. I have used the sample PHP code that is is supposed to load the header / footer but only the footer appears to work. There is simply no header included, only my HTML and then a couple of additional divs which I presume is related to the footer.

What am I doing wrong? The require_once definately loads as the footer output is displayed, just not the header.

<?php
require_once('/usr/local/cpanel/php/WHM.php');
WHM::header('My Plugin Header', 0, 0);
?>

// MY HTML TEMPLATE DISPLAYS HERE

<?php
WHM::footer();
?>
 

Mauritz

Well-Known Member
Apr 29, 2015
62
1
6
Johannesburg
cPanel Access Level
Root Administrator
Hi Kenneth,

v68.0.26

Out of curiousity, can we get a development license? We're currently making changes to a live server which is less than ideal.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
<?php
require_once('/usr/local/cpanel/php/WHM.php');
WHM::header('My Plugin Header', 0, 0);
?>
Hello,

This matches how the instructions we provide in our documentation. In addition to clearing your browser cache, try running the following command to see if it helps:

Code:
mv /var/cpanel/caches/_generated_command_files{,.backup}
If not, feel free to open a support ticket so we can take a closer look.

Thank you.