Skip to content

Commit

Permalink
Fixes admin notices not thrown in compat checker. (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibndawood authored Aug 25, 2023
1 parent e7bc3c8 commit 23df5f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 1 addition & 8 deletions packages/php/compat-checker/src/Checks/CompatCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ protected function set_plugin_data( $plugin_data ) {
public function is_compatible( $plugin_data ) {
$this->set_plugin_data( $plugin_data );
add_action( 'admin_notices', array( $this, 'display_admin_notices' ), 20 );
try {
$this->run_checks();
$is_compatible = true;
} catch ( IncompatibleException $e ) {
$is_compatible = false;
}

return $is_compatible;
return $this->run_checks();
}
}
11 changes: 8 additions & 3 deletions packages/php/compat-checker/src/Checks/WCCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,13 @@ public function make_upgrade_recommendation() {
* Run all compatibility checks.
*/
protected function run_checks() {
$this->check_wc_installation_and_activation();
$this->check_wc_version();
$this->check_wc_upgrade_recommendation();
try {
$this->check_wc_installation_and_activation();
$this->check_wc_version();
$this->check_wc_upgrade_recommendation();
return true;
} catch ( IncompatibleException $e ) {
return false;
}
}
}
1 change: 1 addition & 0 deletions packages/php/compat-checker/src/Checks/WPCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ public function wp_not_tested() {
*/
protected function run_checks() {
$this->check_wp_version();
return true;
}
}

0 comments on commit 23df5f1

Please sign in to comment.