'5.1',
'wp' => '3.5'
);
/**
* Constructor
*/
function __construct() {
add_action( 'su/activation', array( __CLASS__, 'php' ) );
add_action( 'su/activation', array( __CLASS__, 'wp' ) );
}
/**
* Check PHP version
*/
public static function php() {
$php = phpversion();
load_plugin_textdomain( 'su', false, dirname( plugin_basename( SU_PLUGIN_FILE ) ), '/languages/' );
$msg = sprintf( __( '
Oops! Plugin not activated…
Shortcodes Ultimate is not fully compatible with your PHP version (%s).
Reccomended PHP version – %s (or higher).
← Return to the plugins screen Continue and activate anyway →', 'shortcodes-ultimate' ), $php, self::$config['php'], network_admin_url( 'plugins.php?deactivate=true' ), $_SERVER['REQUEST_URI'] . '&continue=true', ' style="float:right;font-weight:bold"' );
// Check Forced activation
if ( isset( $_GET['continue'] ) ) return;
// PHP version is too low
elseif ( version_compare( self::$config['php'], $php, '>' ) ) {
deactivate_plugins( plugin_basename( SU_PLUGIN_FILE ) );
wp_die( $msg );
}
}
/**
* Check WordPress version
*/
public static function wp() {
$wp = get_bloginfo( 'version' );
load_plugin_textdomain( 'su', false, dirname( plugin_basename( SU_PLUGIN_FILE ) ), '/languages/' );
$msg = sprintf( __( 'Oops! Plugin not activated…
Shortcodes Ultimate is not fully compatible with your version of WordPress (%s).
Reccomended WordPress version – %s (or higher).
← Return to the plugins screen Continue and activate anyway →', 'shortcodes-ultimate' ), $wp, self::$config['wp'], network_admin_url( 'plugins.php?deactivate=true' ), $_SERVER['REQUEST_URI'] . '&continue=true', ' style="float:right;font-weight:bold"' );
// Check Forced activation
if ( isset( $_GET['continue'] ) ) return;
// PHP version is too low
elseif ( version_compare( self::$config['wp'], $wp, '>' ) ) {
deactivate_plugins( plugin_basename( SU_PLUGIN_FILE ) );
wp_die( $msg );
}
}
}
new Su_Requirements;