| Server IP : 104.21.94.62 / Your IP : 216.73.216.97 Web Server : Apache System : Linux semi1.us.cloudlogin.co 5.10.244-xeon-hst #1 SMP Sun Sep 14 17:09:20 UTC 2025 x86_64 User : xessglobal ( 271017) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : ON Directory : /proc/self/root/usr/local/ei/ |
Upload File : |
<?php
/* Wordpress Post-Installation Anti-Spam Hook Script */
/* Lite Version */
/* Include the required files to use the WP API and functions such as install() and activate_plugin() */
chdir(__DIR__);
$path = getcwd();
require_once("wp-load.php");
require_once("wp-admin/includes/plugin.php");
require_once("wp-admin/includes/plugin-install.php");
require_once("wp-admin/includes/class-wp-upgrader.php");
require_once("wp-admin/includes/file.php");
require_once("wp-admin/includes/misc.php");
require_once("wp-admin/includes/plugin.php");
/* Check if plugin is already activated */
if (is_plugin_active("anti-spam/anti-spam.php")) {
echo "Anti-Spam plugin is active in $path\n";
exit(0);
} else {
/* Try activating plugin if it is installed, but disabled */
echo "Plugin not activated/installed.. trying to activate..\n";
}
activate_plugin("$path/wp-content/plugins/anti-spam/anti-spam.php");
if (is_plugin_active("anti-spam/anti-spam.php")) {
echo "Plugin has been activated successfully in $path!\n";
exit(0);
} else {
/* Plugin is not installed/present, so we're proceeding with Install */
echo "Plugin not found in $path. Proceeding with installation..\n";
$api = plugins_api("plugin_information", array( "slug" => "Anti-spam"));
/* Retreive information about the Anti-Spam plugin from the WP API */
$object = new Plugin_Upgrader();
$object->install($api->download_link);
/* Install the plugin */
$result = activate_plugin("$path/wp-content/plugins/anti-spam/anti-spam.php");
/* Activate the plugin */
echo "Plugin installed and activated successfully.\n";
exit(0);
}
?>