Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save INDIAN2020/7e9049f8628ff54f4c4a0cfbc36f86ee to your computer and use it in GitHub Desktop.
Save INDIAN2020/7e9049f8628ff54f4c4a0cfbc36f86ee to your computer and use it in GitHub Desktop.
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';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment