path = $path; self::$min_php = $min_php; // To increase the minimum PHP required, change this value _AND_ WPMDB_MINIMUM_PHP_VERSION in the main plugin files self::$base_message = __( '%s requires PHP version %s or higher and cannot be activated. You are currently running version %s. Learn More »', 'wp-migrate-db' ); self::$php_doc_link = 'https://deliciousbrains.com/wp-migrate-db-pro/doc/upgrading-php/'; add_action( 'admin_init', array( $this, 'maybe_deactivate_plugin' ) ); } public static function wpmdb_php_version_too_low() { wp_die( sprintf( self::$base_message, __( 'WP Migrate DB' ), self::$min_php, PHP_VERSION, self::$php_doc_link ) ); } public static function wpmdb_pro_php_version_too_low() { wp_die( sprintf( self::$base_message, __( 'WP Migrate DB Pro' ), self::$min_php, PHP_VERSION, self::$php_doc_link ) ); } public function maybe_deactivate_plugin() { if ( version_compare( PHP_VERSION, self::$min_php, '>=' ) || ! is_plugin_active( plugin_basename( $this->path ) ) ) { return; } deactivate_plugins( plugin_basename( $this->path ) ); add_action( 'admin_notices', array( $this, 'disabled_notice' ) ); if ( isset( $_GET['activate'] ) ) { unset( $_GET['activate'] ); } } public function is_compatible_check() { if ( version_compare( PHP_VERSION, self::$min_php, '<' ) ) { return false; } return true; } public function disabled_notice() { $str = '
%s %s