diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d20b79cf5b1434ac08ae388a9b5145b7fe4b52c..742a389e5d3cb2d2a063847cc1655aff7ec0bb63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.2.2] - 2019-12-17 +### Fixed +- Plugin version should be checked only in needed + ## [3.2.1] - 2019-11-15 ### Fixed - Fixed plugin version notice diff --git a/src/Basic_Requirement_Checker.php b/src/Basic_Requirement_Checker.php index ff0672e289901e97d47e9527c17cb1089f9604f0..36dcc61e2b48adce5118556707505abe290c8c2d 100644 --- a/src/Basic_Requirement_Checker.php +++ b/src/Basic_Requirement_Checker.php @@ -37,6 +37,8 @@ private $min_openssl_version = null; /** @var array */ protected $plugin_require; + /** @var bool */ + protected $should_check_plugin_versions = false; /** @var array */ private $module_require; /** @var array */ @@ -119,6 +121,9 @@ * @return $this */ public function add_plugin_require( $plugin_name, $nice_plugin_name = null, $plugin_require_version = null ) { + if ( $plugin_require_version ) { + $this->should_check_plugin_versions = true; + } $this->plugin_require[ $plugin_name ] = array( self::PLUGIN_INFO_KEY_NAME => $plugin_name, self::PLUGIN_INFO_KEY_NICE_NAME => $nice_plugin_name === null ? $plugin_name : $nice_plugin_name, @@ -214,7 +219,9 @@ $notices = $this->append_plugin_require_notices( $notices ); $notices = $this->append_module_require_notices( $notices ); $notices = $this->append_settings_require_notices( $notices ); - $notices = $this->check_minimum_require_plugins_version_and_append_notices( $notices ); + if ( $this->should_check_plugin_versions ) { + $notices = $this->check_minimum_require_plugins_version_and_append_notices( $notices ); + } return $notices; }