diff --git a/CHANGELOG.md b/CHANGELOG.md index decc6190f2e017e957fd3113272e1248511f1a2f..aa03d825afac95b52f564296c59283a099eef241 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. diff --git a/src/Basic_Requirement_Checker.php b/src/Basic_Requirement_Checker.php index d3309d976954e57993e99a2450251129be597363..2370703fa941e3baefd01ffcd7bf3aa187d23ab9 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 ) ) ) ); } @@ -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 ); } } diff --git a/src/Basic_Requirement_Checker_With_Update_Disable.php b/src/Basic_Requirement_Checker_With_Update_Disable.php index 791603fb4963653c58ac175a17059cce3150205a..4c10438a409807a408338f004457e1d5361694b5 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 ) ); } }