From 6210ffa2105fd82453081d1edbb7b580e37efeb8 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Fri, 20 Dec 2024 11:28:06 +0545 Subject: [PATCH 1/2] Fix duplicated message in file type check --- includes/Checker/Checks/Plugin_Repo/File_Type_Check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index c2e8c5341..7d4f97e67 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -235,7 +235,7 @@ protected function look_for_hidden_files( Check_Result $result, array $files ) { protected function look_for_application_files( Check_Result $result, array $files ) { $application_files = self::filter_files_by_extensions( $files, - array( 'a', 'bin', 'bpk', 'deploy', 'dist', 'distz', 'dmg', 'dms', 'DS_Store', 'dump', 'elc', 'exe', 'iso', 'lha', 'lrf', 'lzh', 'o', 'obj', 'phar', 'pkg', 'sh', 'so' ) + array( 'a', 'bin', 'bpk', 'deploy', 'dist', 'distz', 'dmg', 'dms', 'dump', 'elc', 'exe', 'iso', 'lha', 'lrf', 'lzh', 'o', 'obj', 'phar', 'pkg', 'sh', 'so' ) ); if ( $application_files ) { foreach ( $application_files as $file ) { From 28d9802e5af9c089f3ff36ff99de8f0df80d22d7 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Fri, 20 Dec 2024 13:01:30 +0545 Subject: [PATCH 2/2] Add feature test for updated changes --- tests/behat/features/plugin-check.feature | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/behat/features/plugin-check.feature b/tests/behat/features/plugin-check.feature index c39dcd776..18f74797e 100644 --- a/tests/behat/features/plugin-check.feature +++ b/tests/behat/features/plugin-check.feature @@ -719,3 +719,34 @@ Feature: Test that the WP-CLI command works. """ readme_invalid_contributors """ + + Scenario: Check duplicated error messages for hidden files and application files + Given a WP install with the Plugin Check plugin + And a wp-content/plugins/foo-sample/foo-sample.php file: + """ +