. */ if (!function_exists('is_plugin_active')) { include_once ABSPATH . 'wp-admin/includes/plugin.php'; } if (!class_exists('EzKillLite')) { class EzKillLite { var $lite, $pro, $killer; function __construct($lite, $pro, $killer) { $this->lite = $lite; $this->pro = $pro; $this->killer = $killer; } function EzKillLite($lite, $pro, $killer) { if (version_compare(PHP_VERSION, "5.0.0", "<")) { $this->__construct($lite, $pro, $killer); register_shutdown_function(array($this, "__destruct")); } } function init() { deactivate_plugins($this->lite); } function admin_footer() { printf(''); } function kill() { $killed = false; $proActive = is_plugin_active($this->pro); $liteActive = is_plugin_active($this->lite); if ($proActive && $liteActive) { add_action('init', array($this, 'init')); $plgPath = ABSPATH . PLUGINDIR . "/$this->lite"; $liteData = get_plugin_data($plgPath); $plgPath = ABSPATH . PLUGINDIR . "/$this->pro"; $proData = get_plugin_data($plgPath); printf('

'); printf(__("%s cannot be active now. Deactivating it so that you can use the Pro version %s If you really want to use the %s version, please deactivate the %s version first.", "easy-common"), "{$liteData['Name']}", "{$proData['Name']}.
", "Lite", "Pro"); printf("
" . __("Please reload this page to remove stale links.", 'easy-common') . " "); printf('

'); add_action('admin_footer-plugins.php', array($this, 'admin_footer')); $killed = true; } return $killed; } } } foreach ($liteList as $lite) { $ezKillLite = new EzKillLite($lite, $pro, $ezKillingPlg); if ($ezKillLite->kill()) { break; } }