';
echo 'If things are not done in a minute
install the plugin manually via Plugins page';
echo 'Starting ...
';
wp_cache_flush();
$upgrader = new Plugin_Upgrader();
echo 'Check if WP Force SSL is already installed ...
';
if ($this->is_plugin_installed($plugin_slug)) {
echo 'WP Force SSL is already installed!
Making sure it\'s the latest version.
';
$upgrader->upgrade($plugin_slug);
$installed = true;
} else {
echo 'Installing WP Force SSL.
';
$installed = $upgrader->install($plugin_zip);
}
wp_cache_flush();
if (!is_wp_error($installed) && $installed) {
echo 'Activating WP Force SSL.
';
$activate = activate_plugin($plugin_slug);
if (is_null($activate)) {
echo 'WP Force SSL Activated.
';
echo '';
echo '
If you are not redirected in a few seconds -
click here.';
}
} else {
echo 'Could not install WP Force SSL. You\'ll have to
download and install manually.';
}
echo '
';
} // install_wpfssl
// auto download / install / activate Weglot plugin
function install_weglot()
{
check_ajax_referer('install_weglot');
if (false === current_user_can('administrator')) {
wp_die('Sorry, you have to be an admin to run this action.');
}
$plugin_slug = 'weglot/weglot.php';
$plugin_zip = 'https://downloads.wordpress.org/plugin/weglot.latest-stable.zip';
@include_once ABSPATH . 'wp-admin/includes/plugin.php';
@include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
@include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
@include_once ABSPATH . 'wp-admin/includes/file.php';
@include_once ABSPATH . 'wp-admin/includes/misc.php';
echo '';
echo '';
echo 'If things are not done in a minute
install the plugin manually via Plugins page';
echo 'Starting ...
';
wp_cache_flush();
$upgrader = new Plugin_Upgrader();
echo 'Check if Weglot is already installed ...
';
if ($this->is_plugin_installed($plugin_slug)) {
echo 'Weglot is already installed!
Making sure it\'s the latest version.
';
$upgrader->upgrade($plugin_slug);
$installed = true;
} else {
echo 'Installing Weglot.
';
$installed = $upgrader->install($plugin_zip);
}
wp_cache_flush();
if (!is_wp_error($installed) && $installed) {
echo 'Activating Weglot.
';
$activate = activate_plugin($plugin_slug);
if (is_null($activate)) {
echo 'Weglot Activated.
';
echo '';
echo '
If you are not redirected in a few seconds -
click here.';
}
} else {
echo 'Could not install Weglot. You\'ll have to
download and install manually.';
}
echo '
';
} // install_weglot
} // class MTNC
global $mtnc;
$mtnc = new MTNC();