Skip to content

Commit 3488cb0

Browse files
authored
Merge pull request #811 from WordPress/771-the-plugin-uri-header
Update disallowed domains for Plugin URI check
2 parents f104682 + 2b0b423 commit 3488cb0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

includes/Checker/Checks/Plugin_Repo/Plugin_Header_Fields_Check.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,20 @@ public function run( Check_Result $result ) {
114114
'',
115115
6
116116
);
117-
} elseif ( str_contains( $plugin_header['PluginURI'], '//wordpress.org/' ) || str_contains( $plugin_header['PluginURI'], '//example.com/' ) ) {
117+
} elseif ( preg_match( '/\/\/(example\.com|example\.net|example\.org)\//', $plugin_header['PluginURI'], $matches ) ) {
118118
$this->add_result_warning_for_file(
119119
$result,
120120
sprintf(
121-
/* translators: %s: plugin header field */
122-
__( 'The "%s" header in the plugin file is not valid.', 'plugin-check' ),
123-
esc_html( $labels['PluginURI'] )
121+
/* translators: 1: plugin header field, 2: domain */
122+
__( 'The "%1$s" header in the plugin file is not valid. Discouraged domain "%2$s" found. This is the homepage of the plugin, which should be a unique URL, preferably on your own website. ', 'plugin-check' ),
123+
esc_html( $labels['PluginURI'] ),
124+
esc_html( $matches[1] ),
124125
),
125126
'plugin_header_invalid_plugin_uri_domain',
126127
$plugin_main_file,
127128
0,
128129
0,
129-
'',
130+
'https://developer.wordpress.org/plugins/plugin-basics/header-requirements/#header-fields',
130131
6
131132
);
132133
}

0 commit comments

Comments
 (0)