From 1853f9461204308e09e2a3d086f37b38159578c1 Mon Sep 17 00:00:00 2001 From: Marcin Kolanko <marcin.kolanko@wpdesk.net> Date: Wed, 4 Jun 2025 16:49:04 +0200 Subject: [PATCH 1/4] fix: replace text domain --- src/Basic_Requirement_Checker.php | 20 +++++++++---------- ...equirement_Checker_With_Update_Disable.php | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Basic_Requirement_Checker.php b/src/Basic_Requirement_Checker.php index d3309d9..a172620 100644 --- a/src/Basic_Requirement_Checker.php +++ b/src/Basic_Requirement_Checker.php @@ -231,19 +231,19 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { $notices = array(); if ( ! self::is_php_at_least( $this->min_php_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run on PHP versions older than %s. Please contact your host and ask them to upgrade.', - $this->get_text_domain() ), esc_html( $this->plugin_name ), $this->min_php_version ) ); + "wp-basic-requirements" ), esc_html( $this->plugin_name ), $this->min_php_version ) ); } if ( ! self::is_wp_at_least( $this->min_wp_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run on WordPress versions older than %s. Please update WordPress.', - $this->get_text_domain() ), esc_html( $this->plugin_name ), $this->min_wp_version ) ); + "wp-basic-requirements" ), esc_html( $this->plugin_name ), $this->min_wp_version ) ); } if ( $this->min_wc_version !== null && $this->can_check_plugin_version() && ! self::is_wc_at_least( $this->min_wc_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run on WooCommerce versions older than %s. Please update WooCommerce.', - $this->get_text_domain() ), esc_html( $this->plugin_name ), $this->min_wc_version ) ); + "wp-basic-requirements" ), esc_html( $this->plugin_name ), $this->min_wc_version ) ); } if ( $this->min_openssl_version !== null && ! self::is_open_ssl_at_least( $this->min_openssl_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without OpenSSL module version at least %s. Please update OpenSSL module.', - $this->get_text_domain() ), esc_html( $this->plugin_name ), + "wp-basic-requirements" ), esc_html( $this->plugin_name ), '0x' . dechex( $this->min_openssl_version ) ) ); } @@ -336,7 +336,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { if ( isset( $plugin['Version'] ) && version_compare( $plugin['Version'], $plugin[ self::PLUGIN_INFO_APPEND_PLUGIN_DATA ], '<=' ) ) { $notices[] = $this->prepare_notice_message( sprintf( - __( 'The “%1$s” plugin requires at least %2$s version of %3$s to work correctly. Please update it to its latest release.', $this->get_text_domain() ), + __( 'The “%1$s” plugin requires at least %2$s version of %3$s to work correctly. Please update it to its latest release.', "wp-basic-requirements" ), esc_html( $this->plugin_name ), $plugin[ self::PLUGIN_INFO_APPEND_PLUGIN_DATA ], $plugin['Name'] @@ -464,7 +464,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { $notice = $this->prepare_plugin_repository_require_notice( $plugin_info ); } elseif ( ! self::is_wp_plugin_active( $plugin_name ) ) { $notice = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without %s active. Please install and activate %s plugin.', - $this->get_text_domain() ), esc_html( $this->plugin_name ), + "wp-basic-requirements" ), esc_html( $this->plugin_name ), esc_html( basename( $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ] ) ), esc_html( basename( $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ] ) ) ) ); } @@ -509,7 +509,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { $install_url = $this->prepare_plugin_repository_install_url( $plugin_info ); return $this->prepare_notice_message( sprintf( wp_kses( __( 'The “%s” plugin requires free %s plugin. <a href="%s">Install %s</a>', - $this->get_text_domain() ), array( 'a' => array( 'href' => array() ) ) ), + "wp-basic-requirements" ), array( 'a' => array( 'href' => array() ) ) ), $this->plugin_name, $nice_name, esc_url( $install_url ), $nice_name ) ); } $activate_url = 'plugins.php?action=activate&plugin=' . urlencode( $plugin_info[ self::PLUGIN_INFO_KEY_NAME ] ) . '&plugin_status=all&paged=1&s'; @@ -518,7 +518,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { } return $this->prepare_notice_message( sprintf( wp_kses( __( 'The “%s” plugin requires activating %s plugin. <a href="%s">Activate %s</a>', - $this->get_text_domain() ), array( 'a' => array( 'href' => array() ) ) ), + "wp-basic-requirements" ), array( 'a' => array( 'href' => array() ) ) ), $this->plugin_name, $nice_name, esc_url( admin_url( $activate_url ) ), $nice_name ) ); } @@ -566,7 +566,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { foreach ( $this->module_require as $module_name => $nice_module_name ) { if ( ! self::is_module_active( $module_name ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without %s PHP module installed. Please contact your host and ask them to install %s.', - $this->get_text_domain() ), esc_html( $this->plugin_name ), + "wp-basic-requirements" ), esc_html( $this->plugin_name ), esc_html( basename( $nice_module_name ) ), esc_html( basename( $nice_module_name ) ) ) ); } } @@ -594,7 +594,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { foreach ( $this->setting_require as $setting => $value ) { if ( ! self::is_setting_set( $setting, $value ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without %s PHP setting set to %s. Please contact your host and ask them to set %s.', - $this->get_text_domain() ), esc_html( $this->plugin_name ), + "wp-basic-requirements" ), esc_html( $this->plugin_name ), esc_html( basename( $setting ) ), esc_html( basename( $value ) ), esc_html( basename( $setting ) ) ) ); } diff --git a/src/Basic_Requirement_Checker_With_Update_Disable.php b/src/Basic_Requirement_Checker_With_Update_Disable.php index 791603f..ca02ff6 100644 --- a/src/Basic_Requirement_Checker_With_Update_Disable.php +++ b/src/Basic_Requirement_Checker_With_Update_Disable.php @@ -25,7 +25,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker_With_Update_Disable' ) ) if ( $this->is_currently_updated( $name ) ) { $nice_name = $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ]; $this->notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin is temporarily disabled since the required %s plugin is being upgraded.', - $this->get_text_domain() ), + "wp-basic-requirements" ), $this->plugin_name, $nice_name, $nice_name ) ); } } -- GitLab From 3aac083aa312bc8b531faf9b1d2c684d4dd1f58b Mon Sep 17 00:00:00 2001 From: Marcin Kolanko <marcin.kolanko@wpdesk.net> Date: Fri, 6 Jun 2025 17:34:37 +0200 Subject: [PATCH 2/4] fix: add escaping function --- src/Basic_Requirement_Checker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Basic_Requirement_Checker.php b/src/Basic_Requirement_Checker.php index a172620..1663b44 100644 --- a/src/Basic_Requirement_Checker.php +++ b/src/Basic_Requirement_Checker.php @@ -698,7 +698,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { */ public function handle_render_notices_action() { foreach ( $this->notices as $notice ) { - echo $notice; + echo wp_kses_post( $notice ); } } -- GitLab From 2bd76a82b9b2b3426a1186692fe3c714bdf1ee4e Mon Sep 17 00:00:00 2001 From: Marcin Kolanko <marcin.kolanko@wpdesk.net> Date: Fri, 6 Jun 2025 17:36:39 +0200 Subject: [PATCH 3/4] docs: changelog update --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index decc619..aa03d82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## [3.7.1] - 2025-06-06 +### Fixed +- Replace text domain. +- Add escaping function. + ## [3.7.0] - 2025-05-16 ### Fixed - Remove of the plugin_api filter as prohibited for use in the plugin review. -- GitLab From 28b9ecf7e164a9b9076d73a437bc4d797b2deda8 Mon Sep 17 00:00:00 2001 From: Marcin Kolanko <marcin.kolanko@wpdesk.net> Date: Mon, 9 Jun 2025 09:17:28 +0200 Subject: [PATCH 4/4] fix: Change apostrophe to quotation mark. --- src/Basic_Requirement_Checker.php | 20 +++++++++---------- ...equirement_Checker_With_Update_Disable.php | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Basic_Requirement_Checker.php b/src/Basic_Requirement_Checker.php index 1663b44..2370703 100644 --- a/src/Basic_Requirement_Checker.php +++ b/src/Basic_Requirement_Checker.php @@ -231,19 +231,19 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { $notices = array(); if ( ! self::is_php_at_least( $this->min_php_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run on PHP versions older than %s. Please contact your host and ask them to upgrade.', - "wp-basic-requirements" ), esc_html( $this->plugin_name ), $this->min_php_version ) ); + 'wp-basic-requirements' ), esc_html( $this->plugin_name ), $this->min_php_version ) ); } if ( ! self::is_wp_at_least( $this->min_wp_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run on WordPress versions older than %s. Please update WordPress.', - "wp-basic-requirements" ), esc_html( $this->plugin_name ), $this->min_wp_version ) ); + 'wp-basic-requirements' ), esc_html( $this->plugin_name ), $this->min_wp_version ) ); } if ( $this->min_wc_version !== null && $this->can_check_plugin_version() && ! self::is_wc_at_least( $this->min_wc_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run on WooCommerce versions older than %s. Please update WooCommerce.', - "wp-basic-requirements" ), esc_html( $this->plugin_name ), $this->min_wc_version ) ); + 'wp-basic-requirements' ), esc_html( $this->plugin_name ), $this->min_wc_version ) ); } if ( $this->min_openssl_version !== null && ! self::is_open_ssl_at_least( $this->min_openssl_version ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without OpenSSL module version at least %s. Please update OpenSSL module.', - "wp-basic-requirements" ), esc_html( $this->plugin_name ), + 'wp-basic-requirements' ), esc_html( $this->plugin_name ), '0x' . dechex( $this->min_openssl_version ) ) ); } @@ -336,7 +336,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { if ( isset( $plugin['Version'] ) && version_compare( $plugin['Version'], $plugin[ self::PLUGIN_INFO_APPEND_PLUGIN_DATA ], '<=' ) ) { $notices[] = $this->prepare_notice_message( sprintf( - __( 'The “%1$s” plugin requires at least %2$s version of %3$s to work correctly. Please update it to its latest release.', "wp-basic-requirements" ), + __( 'The “%1$s” plugin requires at least %2$s version of %3$s to work correctly. Please update it to its latest release.', 'wp-basic-requirements' ), esc_html( $this->plugin_name ), $plugin[ self::PLUGIN_INFO_APPEND_PLUGIN_DATA ], $plugin['Name'] @@ -464,7 +464,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { $notice = $this->prepare_plugin_repository_require_notice( $plugin_info ); } elseif ( ! self::is_wp_plugin_active( $plugin_name ) ) { $notice = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without %s active. Please install and activate %s plugin.', - "wp-basic-requirements" ), esc_html( $this->plugin_name ), + 'wp-basic-requirements' ), esc_html( $this->plugin_name ), esc_html( basename( $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ] ) ), esc_html( basename( $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ] ) ) ) ); } @@ -509,7 +509,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { $install_url = $this->prepare_plugin_repository_install_url( $plugin_info ); return $this->prepare_notice_message( sprintf( wp_kses( __( 'The “%s” plugin requires free %s plugin. <a href="%s">Install %s</a>', - "wp-basic-requirements" ), array( 'a' => array( 'href' => array() ) ) ), + 'wp-basic-requirements' ), array( 'a' => array( 'href' => array() ) ) ), $this->plugin_name, $nice_name, esc_url( $install_url ), $nice_name ) ); } $activate_url = 'plugins.php?action=activate&plugin=' . urlencode( $plugin_info[ self::PLUGIN_INFO_KEY_NAME ] ) . '&plugin_status=all&paged=1&s'; @@ -518,7 +518,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { } return $this->prepare_notice_message( sprintf( wp_kses( __( 'The “%s” plugin requires activating %s plugin. <a href="%s">Activate %s</a>', - "wp-basic-requirements" ), array( 'a' => array( 'href' => array() ) ) ), + 'wp-basic-requirements' ), array( 'a' => array( 'href' => array() ) ) ), $this->plugin_name, $nice_name, esc_url( admin_url( $activate_url ) ), $nice_name ) ); } @@ -566,7 +566,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { foreach ( $this->module_require as $module_name => $nice_module_name ) { if ( ! self::is_module_active( $module_name ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without %s PHP module installed. Please contact your host and ask them to install %s.', - "wp-basic-requirements" ), esc_html( $this->plugin_name ), + 'wp-basic-requirements' ), esc_html( $this->plugin_name ), esc_html( basename( $nice_module_name ) ), esc_html( basename( $nice_module_name ) ) ) ); } } @@ -594,7 +594,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker' ) ) { foreach ( $this->setting_require as $setting => $value ) { if ( ! self::is_setting_set( $setting, $value ) ) { $notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin cannot run without %s PHP setting set to %s. Please contact your host and ask them to set %s.', - "wp-basic-requirements" ), esc_html( $this->plugin_name ), + 'wp-basic-requirements' ), esc_html( $this->plugin_name ), esc_html( basename( $setting ) ), esc_html( basename( $value ) ), esc_html( basename( $setting ) ) ) ); } diff --git a/src/Basic_Requirement_Checker_With_Update_Disable.php b/src/Basic_Requirement_Checker_With_Update_Disable.php index ca02ff6..4c10438 100644 --- a/src/Basic_Requirement_Checker_With_Update_Disable.php +++ b/src/Basic_Requirement_Checker_With_Update_Disable.php @@ -25,7 +25,7 @@ if ( ! class_exists( 'WPDesk_Basic_Requirement_Checker_With_Update_Disable' ) ) if ( $this->is_currently_updated( $name ) ) { $nice_name = $plugin_info[ self::PLUGIN_INFO_KEY_NICE_NAME ]; $this->notices[] = $this->prepare_notice_message( sprintf( __( 'The “%s” plugin is temporarily disabled since the required %s plugin is being upgraded.', - "wp-basic-requirements" ), + 'wp-basic-requirements' ), $this->plugin_name, $nice_name, $nice_name ) ); } } -- GitLab