Esempio n. 1
0
function adrotate_check_upgrade() {
	global $wpdb;
	
	if(version_compare(PHP_VERSION, '5.3.0', '<') == -1) { 
		deactivate_plugins(plugin_basename('adrotate/adrotate.php'));
		wp_die('AdRotate 3.10.8 and up requires PHP 5.3 or higher. Your server reports version '.PHP_VERSION.'. Contact your hosting provider about upgrading your server!<br /><a href="'. get_option('siteurl').'/wp-admin/plugins.php">Back to plugins</a>.'); 
		return; 
	} else {
		// Old version? Upgrade
		$adrotate_db_version = get_option("adrotate_db_version");
		if($adrotate_db_version['current'] < ADROTATE_DB_VERSION) {
			adrotate_database_upgrade();
			adrotate_prepare_evaluate_ads(false);
		}
	
		// Check if there are changes to core that need upgrading
		$adrotate_version = get_option("adrotate_version");
		if($adrotate_version['current'] < ADROTATE_VERSION) {
			adrotate_core_upgrade();
		}
	}
}
Esempio n. 2
0
function adrotate_check_upgrade()
{
    if (version_compare(PHP_VERSION, '5.3.0', '<') == -1) {
        deactivate_plugins(plugin_basename('adrotate-pro/adrotate.php'));
        wp_die('AdRotate 3.10.8 and up requires PHP 5.3 or higher. Your server reports version ' . PHP_VERSION . '. Contact your hosting provider about upgrading your server!<br /><a href="' . get_option('siteurl') . '/wp-admin/plugins.php">Back to plugins</a>.');
        return;
    } else {
        $adrotate_db_version = get_option("adrotate_db_version");
        if ($adrotate_db_version['current'] < ADROTATE_DB_VERSION) {
            adrotate_database_upgrade();
        }
        $adrotate_version = get_option("adrotate_version");
        if ($adrotate_version['current'] < ADROTATE_VERSION) {
            adrotate_core_upgrade();
        }
        adrotate_check_config();
        adrotate_check_schedules();
        adrotate_evaluate_ads();
    }
}