Class Name:

MP_CORE_Plugin_Installer

Purpose:

To automatically install plugins from outside locations.

Overview:

This class takes arguments, downloads a plugin from an outside location, installs it, and then activates it.

If the plugin requires a license, it needs to be verified before running this plugin. Once a license has been verified, it can be passed to this class and will be used to download the plugin files. If the license passed is invalid, the download will fail with a message that the license was invalid.

Licensing is dealt with in conjunction with the MP_Repo plugin.

Usage:

new MP_CORE_Plugin_Installer( $plugin );

Parameters:

This class expects 1 parameter which is an assoiative array that stores the information needed to install the plugin. It is laid out like this

$plugin = array(
        'plugin_name' => 'Akismet', 
	'plugin_message' => 'In order to keep your website from being overrun with spam, activate the Akismet Plugin. (Required).', 
	'plugin_filename' => 'akismet.php',
	'plugin_required' => 'http://my_website.com/akismet.zip',
        'plugin_download_link' => 'http://akismet.com/',
        'plugin_group_install' => true,
	'plugin_license' => NULL,
	'plugin_success_link' => true
)

The array keys and values above are as follows:

plugin_name (string) – Name of plugin.
plugin_message (string) – Message which shows up in notification for plugin.
plugin_filename (string) – Name of plugin’s main file
plugin_required (bool)(optional)– If false allows plugin notice to be dismissed
plugin_download_link (string) – Link to URL where this plugin’s zip file can be downloaded
plugin_group_install (bool)(optional)– Whether to install this plugin with “the group” or on it’s own
plugin_license (string)(optional) If this plugin needs a license, this is it.
plugin_success_link (string) Where to re-direct the user when installed. No redirect if NULL