Skip to content

Commit

Permalink
Remove plugin_header_same_plugin_author_uri check
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Nov 28, 2024
1 parent 21755bf commit e45151b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
23 changes: 0 additions & 23 deletions includes/Checker/Checks/Plugin_Repo/Plugin_Header_Fields_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,29 +223,6 @@ public function run( Check_Result $result ) {
}
}

if ( ! empty( $plugin_header['PluginURI'] ) && ! empty( $plugin_header['AuthorURI'] ) ) {
$plugin_uri = rtrim( strtolower( $plugin_header['PluginURI'] ), '/' );
$author_uri = rtrim( strtolower( $plugin_header['AuthorURI'] ), '/' );

if ( $plugin_uri === $author_uri ) {
$this->add_result_error_for_file(
$result,
sprintf(
/* translators: 1: plugin uri header field, 2: author uri header field */
__( 'The "%1$s" and "%2$s" header in the plugin file must be different. It is not required to provide both, so pick the one that best applies to your situation.', 'plugin-check' ),
esc_html( $labels['PluginURI'] ),
esc_html( $labels['AuthorURI'] )
),
'plugin_header_same_plugin_author_uri',
$plugin_main_file,
0,
0,
__( 'https://developer.wordpress.org/plugins/plugin-basics/header-requirements/', 'plugin-check' ),
7
);
}
}

if ( ! empty( $plugin_header['Network'] ) ) {
if ( 'true' !== strtolower( $plugin_header['Network'] ) ) {
$this->add_result_warning_for_file(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Requires PHP: 5.6
* Version: 1.0.0 Beta
* Author: WordPress Performance Team
* Author URI: https://github.com/wordpress/plugin-check/
* Author URI: https://make.wordpress.org/performance/
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* Text Domain: test-plugin-check-errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,5 @@ public function test_run_with_invalid_header_fields() {

$this->assertCount( 1, wp_list_filter( $errors['load.php'][0][0], array( 'code' => 'plugin_header_missing_plugin_description' ) ) );
$this->assertCount( 1, wp_list_filter( $errors['load.php'][0][0], array( 'code' => 'plugin_header_invalid_plugin_version' ) ) );
$this->assertCount( 1, wp_list_filter( $errors['load.php'][0][0], array( 'code' => 'plugin_header_same_plugin_author_uri' ) ) );
}
}

0 comments on commit e45151b

Please sign in to comment.