Skip to content
Snippets Groups Projects
Commit 6e793fc0 authored by Marcin Kolanko's avatar Marcin Kolanko
Browse files

Merge branch 'bugfix/wordpress-review' into 'master'

Bugfix/wordpress review

See merge request !46
parents d2ed9a75 28b9ecf7
No related branches found
No related tags found
1 merge request!46Bugfix/wordpress review
Pipeline #516842 failed with stages
in 23 seconds
## [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.
......
......@@ -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 &#8220;%1$s&#8221; 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 &#8220;%1$s&#8221; 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 &#8220;%s&#8221; 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 &#8220;%s&#8221; 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 &#8220;%s&#8221; 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 &#8220;%s&#8221; 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 &#8220;%s&#8221; 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 );
}
}
......
......@@ -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 &#8220;%s&#8221; 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 ) );
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment