Welcome Guest. Please Login or Register  


You are here: Index > Softaculous Auto Installer > General Support > Topic : Custom Plugin



Threaded Mode | Print  

 Custom Plugin, Custom plugin in Wpress/Blesta (5 Replies, Read 1057 times)
kepler
Group: Member
Post Group: Newbie
Posts: 11
Status:
Good morning
I'm trying to make an automatic Wordpress installation with Blesta, and I don't have any problems. However, I also am trying to install at the same time a custom plugin (not from the repository). I made a mods.php with a xml file, and in a normal cPanel WP install, the plugin appears as option and everything is fine at the install. But in the Blesta softaculous module no. How do I copy (unzip) the plugin to the correct dir after the WPress installation? What must I add to the code? Any help is apreciated.
Best regards
Kepler
IP: --   

Custom Plugin
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5652
Status:
Hi,

At the moment it is not possible to pass addtional parameters in Blesta module. We will add it in future versions.

However you can make minor change in your mods.php file in the __post_mod_install() function. Where you must be checking if not empty $__settings then unzip the files e.g. :
if(!empty($__settings['smart-maintenance-mode']))

There you can add a OR condition to check if you get "autoinstall" parameter in GET that will be when you auto install a script via Blesta e.g. :
if(!empty($__settings['smart-maintenance-mode']) || !empty($_GET['autoinstall']))

Let us know if this does not work for you.

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Custom Plugin
kepler
Group: Member
Post Group: Newbie
Posts: 11
Status:
Good morning
Thank you very much for the tip - it worked :)
The plugin, was, however, not activated (but at least it was installed). It's a question of activating it manually in the Plugins area.
Can it be pre activated?
Best regards
Kepler
IP: --   

Custom Plugin
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5652
Status:
Hi,

Glad to know it works.

In order to activate a plugin you need to execute an UPDATE query in the database.

Here is an example of the same :
PHP Code

 $__settings['active_plugins'] = array();
    
// First get the active plugin list
$query "SELECT option_value FROM ".$__settings['dbprefix']."options WHERE option_name = 'active_plugins';";
$result sdb_query($query$__settings['softdbhost'], $__settings['softdbuser'], $__settings['softdbpass'], $__settings['softdb']);
    
$__settings['active_plugins'] = _unserialize($result[0]['option_value']);
$__settings['active_plugins'][] = 'smart-maintenance-mode/smart-maintenance-mode.php';
$__settings['active_plugins'] = serialize($__settings['active_plugins']);
$query "UPDATE ".$__settings['dbprefix']."options
            SET option_value = '"
.$__settings['active_plugins']."'
            WHERE option_name = 'active_plugins';"
;
$result sdb_query($query$__settings['softdbhost'], $__settings['softdbuser'], $__settings['softdbpass'], $__settings['softdb']); 



-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

Custom Plugin
kepler
Group: Member
Post Group: Newbie
Posts: 11
Status:
Hi again,
Well....perfect. It installs and activates the plugin perfectly, without any error or warning.
Thank you very much for your kindness and help.
Best regards
Kepler
IP: --   

Custom Plugin
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5652
Status:
Hi,

Glad to know it works !!

-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is April 26, 2024, 7:21 pm.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:0.023