Skip to content

Commit

Permalink
Compat Checker – Fix admin notices not triggered when WooCommerce is …
Browse files Browse the repository at this point in the history
…not installed (#83)
  • Loading branch information
ibndawood authored Oct 10, 2023
2 parents f79b4de + 20a63a8 commit 4486cc1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions packages/php/compat-checker/src/Checks/CompatCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ public static function instance() {
* @param string $message The notice message.
*/
protected function add_admin_notice( $slug, $class, $message ) {
// Bail if the user is not a shop manager.
if ( ! current_user_can( 'manage_woocommerce' ) ) {
return;
}

$screen = get_current_screen();
$hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' );
$show = isset( $screen->id ) && ! in_array( $screen->id, $hidden, true );
Expand Down
2 changes: 1 addition & 1 deletion packages/php/compat-checker/src/Checks/WCCompatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public function wc_out_of_date() {
$plugin_name = $this->plugin_data['Name'];
$wc_version_required = ( 1 === substr_count( $this->plugin_data['RequiresWC'], '.' ) ) ? $this->plugin_data['RequiresWC'] . '.0' : $this->plugin_data['RequiresWC'] ; // Pad .0 if the min required WC version is not in semvar format.

$message = sprintf(
$message = sprintf(
/* translators: %1$s - Plugin Name, %2$s - minimum WooCommerce version, %3$s - update WooCommerce link open, %4$s - update WooCommerce link close, %5$s - download minimum WooCommerce link open, %6$s - download minimum WooCommerce link close. */
esc_html__( '%1$s requires WooCommerce version %2$s or higher. Please %3$supdate WooCommerce%4$s to the latest version, or %5$sdownload the minimum required version »%6$s', 'woogrow-compat-checker' ),
'<strong>' . $plugin_name . '</strong>',
Expand Down

0 comments on commit 4486cc1

Please sign in to comment.