Skip to content

Instantly share code, notes, and snippets.

@willmot
Created January 29, 2012 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save willmot/1699727 to your computer and use it in GitHub Desktop.
Save willmot/1699727 to your computer and use it in GitHub Desktop.
Require a minimum PHP version on plugin activation
<?php
// Don't activate on anything less than PHP 5.2.4
if ( version_compare( phpversion(), '5.2.4', '<' ) ) {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
deactivate_plugins( WPRP_PLUGIN_SLUG . '/plugin.php' );
if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) )
die( __( 'WP Remote requires PHP version 5.2.4 or greater.', 'wpremote' ) );
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment