diff --git a/php-notifier.php b/php-notifier.php index 8885f7d..d845b5a 100644 --- a/php-notifier.php +++ b/php-notifier.php @@ -36,6 +36,8 @@ class CP_PHP_Notifier { public function __construct() { define( 'PHP_NOTIFIER_PATH', plugin_dir_path( __FILE__ ) ); + define( 'php_notifier_notice', 0 ); + define( 'php_notifier_last_version', 0 ); define( 'PHP_NOTIFIER_URL', plugin_dir_url( __FILE__ ) ); define( 'PHP_NOTIFIER_VERSION', '1.0.0' ); @@ -72,8 +74,31 @@ public function init() { register_deactivation_hook( __FILE__, array( $this, 'plugin_deactivation' ) ); + $this->version_check(); + } + /** + * Cross check the installed PHP version with PHP.net support versions + * + * @return mixed + */ + public function version_check() + { + // wp_die( intval( self::$options['php_notifier_last_version'] ) . ' and ' . intval( self::$php_version ) ); + + if ( intval( self::$options['php_notifier_last_version'] ) !== intval( self::$php_version ) ) { + + wp_die( self::$options['php_notifier_last_version'] . ' is not equal to ' . self::$php_version ); + + self::$options['php_notifier_notice'] = 0; + + self::$options['php_notifier_last_version'] = self::$php_version; + + } + + } + /** * Cross check the installed PHP version with PHP.net support versions * @@ -235,7 +260,7 @@ public function php_version_error( $echo = true ) { } $notice = sprintf( - '
%2$s
%3$s