yanknudtskov
3/1/2015 - 10:21 PM

Check for PHP 5.3+ in WordPress plugins

Check for PHP 5.3+ in WordPress plugins

<?php

// Prevent direct file access
if ( ! defined( 'ABSPATH' ) ) {
	header( 'Status: 403 Forbidden' );
	header( 'HTTP/1.1 403 Forbidden' );
	exit;
}
// Check if PHP is at the minimum required version
if( version_compare( PHP_VERSION, '5.3', '>=' ) ) {
	define( 'MAILCHIMP_TOP_BAR_FILE', __FILE__ );
	require_once dirname( __FILE__ ) . '/plugin.php';
} else {
	require_once dirname( __FILE__ ) . '/php-backwards-compatibility.php';
}

?>