This is an old revision of the document!


If you use the Installatron 1-click installer, then you have the option to install the LiteSpeed Cache plugin using their hook system.

You have to go to WHM then Plugins → Installatron → Applications → Customization and add the following code:

<?php 
class i_installer_customcode 
{ 
    function init($o) 
    { 
        $o->registerArchive("litespeed-cache", "https://downloads.wordpress.org/plugin/litespeed-cache.zip", "zip");
        $o->registerCustomCode("wordpress", "all", "install", "input", "wordpressinstallinput");
        $o->registerCustomCode("wordpress", "all", "install", "last", "wordpressinstall");
    } 

    function wordpressinstallinput($o) 
    { 
        $o->setInputFields(array( 
            array( 
                "ID" => "litespeed-cache", 
                "LABEL" => "LiteSpeed Cache", 
                "TEXT" => "Install the LiteSpeed Cache plugin?", 
                "TYPE" => "radio",
                "VALUE" => "yes",
                "OPTIONS" => array( "yes" => "Yes", "no" => "No")
             ), 
        )); 
    } 

    function wordpressinstall($o) 
    { 
        if ( isset($o->input["field_litespeed-cache"]) && $o->input["field_litespeed-cache"] == "yes" ) 
        { 
            $o->installPlugin("litespeed-cache/litespeed-cache.php", "litespeed-cache");
        }
    } 
}
?>

The above code will register the latest LiteSpeed Cache plugin version as an archive in Installatron, then it will make a selection box to whether the LiteSpeed Cache plugin should be installed or not (Defaults to yes).

If the value is set to yes, then it will install the plugin and activate it.

  • Admin
  • Last modified: 2019/05/03 14:39
  • by Lucas Rolff