diff --git a/includes/Checker/Checks/Trademarks_Check.php b/includes/Checker/Checks/Trademarks_Check.php index 7c8093164..8e9180e4b 100644 --- a/includes/Checker/Checks/Trademarks_Check.php +++ b/includes/Checker/Checks/Trademarks_Check.php @@ -348,24 +348,24 @@ private function validate_name_has_no_trademarks( $plugin_name ) { // Trademarks that do NOT end in "-", but are within the FOR_USE_EXCEPTIONS array can be used, but only if it ends with 'for x'. $message = sprintf( /* translators: 1: plugin name, 2: found trademarked term */ - __( 'The plugin name includes a restricted term. Your chosen plugin name - %1$s - contains the restricted term "%2$s" which cannot be used within in your plugin name, unless your plugin name ends with "for %2$s". The term must still not appear anywhere else in your name.', 'plugin-check' ), - '' . esc_html( $plugin_name ) . '', + __( 'The plugin name includes a restricted term. Your chosen plugin name - "%1$s" - contains the restricted term "%2$s" which cannot be used within in your plugin name, unless your plugin name ends with "for %2$s". The term must still not appear anywhere else in your name.', 'plugin-check' ), + esc_html( $plugin_name ), esc_html( trim( $check, '-' ) ) ); } elseif ( trim( $check, '-' ) === $check ) { // Trademarks that do NOT end in "-" indicate slug cannot contain term at all. $message = sprintf( /* translators: 1: plugin name, 2: found trademarked term */ - __( 'The plugin name includes a restricted term. Your chosen plugin name - %1$s - contains the restricted term "%2$s" which cannot be used at all in your plugin name.', 'plugin-check' ), - '' . esc_html( $plugin_name ) . '', + __( 'The plugin name includes a restricted term. Your chosen plugin name - "%1$s" - contains the restricted term "%2$s" which cannot be used at all in your plugin name.', 'plugin-check' ), + esc_html( $plugin_name ), esc_html( trim( $check, '-' ) ) ); } else { // Trademarks ending in "-" indicate slug cannot BEGIN with that term. $message = sprintf( /* translators: 1: plugin name, 2: found trademarked term */ - __( 'The plugin name includes a restricted term. Your chosen plugin name - %1$s - contains the restricted term "%2$s" and cannot be used to begin your plugin name. We disallow the use of certain terms in ways that are abused, or potentially infringe on and/or are misleading with regards to trademarks. You may use the term "%2$s" elsewhere in your plugin name, such as "... for %2$s".', 'plugin-check' ), - '' . esc_html( $plugin_name ) . '', + __( 'The plugin name includes a restricted term. Your chosen plugin name - "%1$s" - contains the restricted term "%2$s" and cannot be used to begin your plugin name. We disallow the use of certain terms in ways that are abused, or potentially infringe on and/or are misleading with regards to trademarks. You may use the term "%2$s" elsewhere in your plugin name, such as "... for %2$s".', 'plugin-check' ), + esc_html( $plugin_name ), esc_html( trim( $check, '-' ) ) ); } @@ -395,24 +395,24 @@ private function validate_slug_has_no_trademarks( $plugin_slug ) { // Trademarks that do NOT end in "-", but are within the FOR_USE_EXCEPTIONS array can be used, but only if it ends with 'for x'. $message = sprintf( /* translators: 1: plugin slug, 2: found trademarked term */ - __( 'The plugin slug includes a restricted term. Your plugin slug - %1$s - contains the restricted term "%2$s" which cannot be used within in your plugin slug, unless your plugin slug ends with "for %2$s". The term must still not appear anywhere else in your plugin slug.', 'plugin-check' ), - '' . esc_html( $plugin_slug ) . '', + __( 'The plugin slug includes a restricted term. Your plugin slug - "%1$s" - contains the restricted term "%2$s" which cannot be used within in your plugin slug, unless your plugin slug ends with "for %2$s". The term must still not appear anywhere else in your plugin slug.', 'plugin-check' ), + esc_html( $plugin_slug ), esc_html( trim( $check, '-' ) ) ); } elseif ( trim( $check, '-' ) === $check ) { // Trademarks that do NOT end in "-" indicate slug cannot contain term at all. $message = sprintf( /* translators: 1: plugin slug, 2: found trademarked term */ - __( 'The plugin slug includes a restricted term. Your plugin slug - %1$s - contains the restricted term "%2$s" which cannot be used at all in your plugin slug.', 'plugin-check' ), - '' . esc_html( $plugin_slug ) . '', + __( 'The plugin slug includes a restricted term. Your plugin slug - "%1$s" - contains the restricted term "%2$s" which cannot be used at all in your plugin slug.', 'plugin-check' ), + esc_html( $plugin_slug ), esc_html( trim( $check, '-' ) ) ); } else { // Trademarks ending in "-" indicate slug cannot BEGIN with that term. $message = sprintf( /* translators: 1: plugin slug, 2: found trademarked term */ - __( 'The plugin slug includes a restricted term. Your plugin slug - %1$s - contains the restricted term "%2$s" and cannot be used to begin your plugin slug. We disallow the use of certain terms in ways that are abused, or potentially infringe on and/or are misleading with regards to trademarks. You may use the term "%2$s" elsewhere in your plugin slug, such as "... for %2$s".', 'plugin-check' ), - '' . esc_html( $plugin_slug ) . '', + __( 'The plugin slug includes a restricted term. Your plugin slug - "%1$s" - contains the restricted term "%2$s" and cannot be used to begin your plugin slug. We disallow the use of certain terms in ways that are abused, or potentially infringe on and/or are misleading with regards to trademarks. You may use the term "%2$s" elsewhere in your plugin slug, such as "... for %2$s".', 'plugin-check' ), + esc_html( $plugin_slug ), esc_html( trim( $check, '-' ) ) ); } diff --git a/tests/phpunit/tests/Checker/Checks/Trademarks_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/Trademarks_Check_Tests.php index 1d9976ccf..018788895 100644 --- a/tests/phpunit/tests/Checker/Checks/Trademarks_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/Trademarks_Check_Tests.php @@ -55,43 +55,43 @@ public function data_trademarks_check() { Trademarks_Check::TYPE_README, 'test-trademarks-plugin-readme-errors/load.php', 'readme.txt', - 'The plugin name includes a restricted term. Your chosen plugin name - Test Plugin with readme - contains the restricted term "plugin" which cannot be used at all in your plugin name.', + 'The plugin name includes a restricted term. Your chosen plugin name - " Test Plugin with readme " - contains the restricted term "plugin" which cannot be used at all in your plugin name.', ), 'Plugin header - Test Trademarks Plugin Header Name Errors' => array( Trademarks_Check::TYPE_NAME, 'test-trademarks-plugin-header-name-errors/load.php', 'load.php', - 'The plugin name includes a restricted term. Your chosen plugin name - Test Trademarks Plugin Header Name Errors - contains the restricted term "plugin" which cannot be used at all in your plugin name.', + 'The plugin name includes a restricted term. Your chosen plugin name - "Test Trademarks Plugin Header Name Errors" - contains the restricted term "plugin" which cannot be used at all in your plugin name.', ), 'Plugin slug - test-trademarks-plugin-header-slug-errors' => array( Trademarks_Check::TYPE_SLUG, 'test-trademarks-plugin-header-slug-errors/load.php', 'load.php', - 'The plugin slug includes a restricted term. Your plugin slug - test-trademarks-plugin-header-slug-errors - contains the restricted term "plugin" which cannot be used at all in your plugin slug.', + 'The plugin slug includes a restricted term. Your plugin slug - "test-trademarks-plugin-header-slug-errors" - contains the restricted term "plugin" which cannot be used at all in your plugin slug.', ), 'Plugin headers - WooCommerce Example String' => array( Trademarks_Check::TYPE_NAME, 'test-trademarks-plugin-header-woocommerce-string/load.php', 'load.php', - 'The plugin name includes a restricted term. Your chosen plugin name - WooCommerce Example String - contains the restricted term "woocommerce" which cannot be used within in your plugin name, unless your plugin name ends with "for woocommerce". The term must still not appear anywhere else in your name.', + 'The plugin name includes a restricted term. Your chosen plugin name - "WooCommerce Example String" - contains the restricted term "woocommerce" which cannot be used within in your plugin name, unless your plugin name ends with "for woocommerce". The term must still not appear anywhere else in your name.', ), 'Plugin headers - WooCommerce String for WooCommerce' => array( Trademarks_Check::TYPE_NAME, 'test-trademarks-plugin-header-woocommerce-string-for-woocommerce/load.php', 'load.php', - 'The plugin name includes a restricted term. Your chosen plugin name - WooCommerce String for WooCommerce - contains the restricted term "woocommerce" which cannot be used within in your plugin name, unless your plugin name ends with "for woocommerce". The term must still not appear anywhere else in your name.', + 'The plugin name includes a restricted term. Your chosen plugin name - "WooCommerce String for WooCommerce" - contains the restricted term "woocommerce" which cannot be used within in your plugin name, unless your plugin name ends with "for woocommerce". The term must still not appear anywhere else in your name.', ), 'Plugin headers - WordPress String for WooCommerce' => array( Trademarks_Check::TYPE_NAME, 'test-trademarks-plugin-header-wordpress-string-for-woocommerce/load.php', 'load.php', - 'The plugin name includes a restricted term. Your chosen plugin name - WordPress String for WooCommerce - contains the restricted term "wordpress" which cannot be used at all in your plugin name.', + 'The plugin name includes a restricted term. Your chosen plugin name - "WordPress String for WooCommerce" - contains the restricted term "wordpress" which cannot be used at all in your plugin name.', ), 'Plugin headers portmanteaus' => array( Trademarks_Check::TYPE_NAME, 'test-trademarks-plugin-header-portmanteaus/load.php', 'load.php', - 'The plugin name includes a restricted term. Your chosen plugin name - WooXample - contains the restricted term "woo" which cannot be used at all in your plugin name.', + 'The plugin name includes a restricted term. Your chosen plugin name - "WooXample" - contains the restricted term "woo" which cannot be used at all in your plugin name.', ), ); }