Skip to content

Commit

Permalink
Improve message for plugin_header_invalid_plugin_uri_domain check
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Nov 27, 2024
1 parent 68f97ca commit 4043399
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,20 @@ public function run( Check_Result $result ) {
'',
6
);
} elseif ( str_contains( $plugin_header['PluginURI'], '//wordpress.org/' ) || str_contains( $plugin_header['PluginURI'], '//example.com/' ) ) {
} elseif ( preg_match( '/\/\/(WordPress\.org|example\.com)\//', $plugin_header['PluginURI'], $matches ) ) {
$this->add_result_warning_for_file(
$result,
sprintf(
/* translators: %s: plugin header field */
__( 'The "%s" header in the plugin file is not valid.', 'plugin-check' ),
esc_html( $labels['PluginURI'] )
/* translators: 1: plugin header field, 2: domain */
__( 'The "%1$s" header in the plugin file is not valid. Discouraged domain "%2$s" found. This is the home page of the plugin, which should be a unique URL, preferably on your own website. ', 'plugin-check' ),
esc_html( $labels['PluginURI'] ),
esc_html( $matches[1] ),
),
'plugin_header_invalid_plugin_uri_domain',
$plugin_main_file,
0,
0,
'',
'https://developer.wordpress.org/plugins/plugin-basics/header-requirements/#header-fields',
6
);
}
Expand Down

0 comments on commit 4043399

Please sign in to comment.