/** * Let's check Wordpress version, and PHP version and tell those * guys whats needed to upgrade, if anything. * * @return bool */ public static function checkRequirements() { global $wp_version; $wp_version_min = '3.3'; $php = '5.3.1'; $recoverUrl = admin_url('plugins.php'); $recoverLink = '<br /><br /><a href="' . $recoverUrl . '">Back to plugins.</a>'; if (!version_compare($wp_version, $wp_version_min, '>=')) { SimpleSubscribeCheck::pluginDeactivate('Sorry mate, this plugin requires at least WordPress varsion <strong>' . $wp_version_min . ' or higher.</strong> You are currently using <strong>' . $wp_version . '.</strong> Please upgrade your WordPress.' . $recoverLink); } elseif (!version_compare(PHP_VERSION, $php, '>=')) { SimpleSubscribeCheck::pluginDeactivate('You need PHP version at least <strong>' . $php . '</strong> to run this plugin. You are currently using PHP version <strong>' . PHP_VERSION . '.</strong>' . $recoverLink); } }
/** * 1. If no Wordpress, go home */ global $wpdb, $wp_version; if (!defined('ABSPATH')) { exit; } //define("WP_ssubscribe_TABLE_APP", $wpdb->prefix . "ssubscribe_app"); /** * 2. Check minimum requirements (wp version, php version) * Reason behind this is, we just need PHP 5.3.1 at least, * and wordpress 3.3 or higher. We just can't run the show * on some outdated installation. */ require_once 'SimpleSubscribeCheck.php'; SimpleSubscribeCheck::checkRequirements(); /** * 3. Activation / deactivation */ register_activation_hook(__FILE__, array('SimpleSubscribe', 'activate')); register_deactivation_hook(__FILE__, array('SimpleSubscribe', 'deactivate')); /** * 4. Go, and do Simple Subscribe! */ function ss_rrmdir($dir) { if (is_dir($dir)) { $objects = scandir($dir); foreach ($objects as $object) { if ($object != "." && $object != "..") { if (filetype($dir . "/" . $object) == "dir") {