Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compat Checker – Fix admin notices not triggered when WooCommerce is not installed #83

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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