From 3553dc92ef025e99b84077736910e992d87ffe7e Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Wed, 9 Oct 2024 21:03:58 +0200 Subject: [PATCH 01/12] start duplicated names --- .../Checks/Plugin_Repo/File_Type_Check.php | 18 ++++++++++++++++++ .../Checker/Checks/File_Type_Check_Tests.php | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index f1e547347..ba1bc04af 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -283,6 +283,24 @@ protected function look_for_badly_named_files( Check_Result $result, array $file ); } } + + // Duplicated names. + $files = array_map( 'basename', $files ); + $files = array_map( 'strtolower', $files ); + $duplicated_files = array_unique( array_diff_assoc( $files, array_unique( $files ) ) ); + + if ( ! empty( $duplicated_files ) ) { + $this->add_result_error_for_file( + $result, + __( 'Duplicated file names are not permitted.', 'plugin-check' ), + 'duplicated_files', + implode( ', ', $duplicated_files ), + 0, + 0, + '', + 8 + ); + } } /** diff --git a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php index 7e73cfd36..3ef04bb44 100644 --- a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php @@ -126,5 +126,10 @@ public function test_run_with_badly_named_errors() { $this->assertArrayHasKey( 0, $errors['badly|file%name!@#$%^&*()+=[]{};:"\'<>,?|`~.php'] ); $this->assertArrayHasKey( 0, $errors['badly|file%name!@#$%^&*()+=[]{};:"\'<>,?|`~.php'][0] ); $this->assertCount( 1, wp_list_filter( $errors['badly|file%name!@#$%^&*()+=[]{};:"\'<>,?|`~.php'][0][0], array( 'code' => 'badly_named_files' ) ) ); + + // Duplicated filenames. + $this->assertArrayHasKey( 0, $errors['class-filename.php'] ); + $this->assertArrayHasKey( 0, $errors['class-filename.php'][0] ); + $this->assertCount( 1, wp_list_filter( $errors['class-filename.php'][0][0], array( 'code' => 'duplicated_files' ) ) ); } } From 78473ec95ab5ebefc660ee3a34cd22d8f3ca96f4 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Tue, 5 Nov 2024 22:29:11 +0100 Subject: [PATCH 02/12] approach --- .../Checker/Checks/File_Type_Check_Tests.php | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php index 002a9a1e0..41ea389b6 100644 --- a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php @@ -126,11 +126,35 @@ public function test_run_with_badly_named_errors() { $this->assertArrayHasKey( 0, $errors['badly|file%name!@#$%^&*()+=[]{};:"\'<>,?|`~.php'] ); $this->assertArrayHasKey( 0, $errors['badly|file%name!@#$%^&*()+=[]{};:"\'<>,?|`~.php'][0] ); $this->assertCount( 1, wp_list_filter( $errors['badly|file%name!@#$%^&*()+=[]{};:"\'<>,?|`~.php'][0][0], array( 'code' => 'badly_named_files' ) ) ); + } + + public function test_run_with_duplicated_named_errors() { + // Initialize the Check_Context with a plugin path that mimics the directory structure. + $check_context = new Check_Context( UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/load.php' ); + + // Create an empty Check_Result instance for this context. + $check_result = new Check_Result( $check_context ); + + // Initialize the File_Type_Check instance. + $check = new File_Type_Check(); + + // Use reflection to make check_files accessible. + $reflection = new \ReflectionClass( $check ); + $checkFilesMethod = $reflection->getMethod('check_files'); + $checkFilesMethod->setAccessible(true); + + // Define the custom file list with duplicate names as they would appear in a plugin directory. + $customFiles = [ + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-file.php', + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/Custom-File.php', + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-FILE.php' + ]; + + // Invoke check_files with the Check_Result instance and custom file list. + $result = $checkFilesMethod->invoke($check, $check_result, $customFiles); - // Duplicated filenames. - $this->assertArrayHasKey( 0, $errors['class-filename.php'] ); - $this->assertArrayHasKey( 0, $errors['class-filename.php'][0] ); - $this->assertCount( 1, wp_list_filter( $errors['class-filename.php'][0][0], array( 'code' => 'duplicated_files' ) ) ); + // Assert that check_files handles the custom file list with duplicates correctly. + $this->assertTrue($result->has_errors(), "The check_files method should detect errors for duplicate file names."); } public function test_run_with_library_core_errors() { From 05721c3e0bb74bdd0b999d8cc338fab938540002 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Fri, 22 Nov 2024 10:32:06 +0545 Subject: [PATCH 03/12] Fix unit test for duplicated files --- .../Checker/Checks/File_Type_Check_Tests.php | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php index 41ea389b6..72a04febe 100644 --- a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php @@ -131,30 +131,31 @@ public function test_run_with_badly_named_errors() { public function test_run_with_duplicated_named_errors() { // Initialize the Check_Context with a plugin path that mimics the directory structure. $check_context = new Check_Context( UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/load.php' ); - + // Create an empty Check_Result instance for this context. $check_result = new Check_Result( $check_context ); // Initialize the File_Type_Check instance. $check = new File_Type_Check(); - // Use reflection to make check_files accessible. - $reflection = new \ReflectionClass( $check ); - $checkFilesMethod = $reflection->getMethod('check_files'); - $checkFilesMethod->setAccessible(true); + // Use reflection to make protected method accessible. + $reflection = new ReflectionClass( $check ); + $checkFilesMethod = $reflection->getMethod( 'look_for_badly_named_files' ); + $checkFilesMethod->setAccessible( true ); // Define the custom file list with duplicate names as they would appear in a plugin directory. - $customFiles = [ - UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-file.php', - UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/Custom-File.php', - UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-FILE.php' - ]; + $customFiles = array( + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-file.php', + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/Custom-File.php', + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-FILE.php', + ); - // Invoke check_files with the Check_Result instance and custom file list. - $result = $checkFilesMethod->invoke($check, $check_result, $customFiles); + // Invoke method with the Check_Result instance and custom file list. + $result = $checkFilesMethod->invoke( $check, $check_result, $customFiles ); + + $errors = $check_result->get_errors(); - // Assert that check_files handles the custom file list with duplicates correctly. - $this->assertTrue($result->has_errors(), "The check_files method should detect errors for duplicate file names."); + $this->assertCount( 1, wp_list_filter( $errors['custom-file.php'][0][0], array( 'code' => 'duplicated_files' ) ) ); } public function test_run_with_library_core_errors() { From 7d9ac61c5acc0962aba3e54faf88c3f4c6c4cc88 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Fri, 22 Nov 2024 10:37:05 +0545 Subject: [PATCH 04/12] Rename variables mentioned in lint results --- .../tests/Checker/Checks/File_Type_Check_Tests.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php index 72a04febe..01b245cde 100644 --- a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php @@ -139,19 +139,19 @@ public function test_run_with_duplicated_named_errors() { $check = new File_Type_Check(); // Use reflection to make protected method accessible. - $reflection = new ReflectionClass( $check ); - $checkFilesMethod = $reflection->getMethod( 'look_for_badly_named_files' ); - $checkFilesMethod->setAccessible( true ); + $reflection = new ReflectionClass( $check ); + $check_files_method = $reflection->getMethod( 'look_for_badly_named_files' ); + $check_files_method->setAccessible( true ); // Define the custom file list with duplicate names as they would appear in a plugin directory. - $customFiles = array( + $custom_files = array( UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-file.php', UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/Custom-File.php', UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/custom-FILE.php', ); // Invoke method with the Check_Result instance and custom file list. - $result = $checkFilesMethod->invoke( $check, $check_result, $customFiles ); + $result = $check_files_method->invoke( $check, $check_result, $custom_files ); $errors = $check_result->get_errors(); From 9a83c79db07b603fc3d272eb49cab42e5f2f2165 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Fri, 3 Jan 2025 23:47:34 +0100 Subject: [PATCH 05/12] updated check for duplicated named folders --- .../Checks/Plugin_Repo/File_Type_Check.php | 32 ++++++++++++++++--- .../Checker/Checks/File_Type_Check_Tests.php | 12 +++++++ 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index 5352b147f..b58789b0d 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -297,10 +297,34 @@ function ( $file ) use ( $plugin_path ) { } } - // Duplicated names. - $files = array_map( 'basename', $files ); - $files = array_map( 'strtolower', $files ); - $duplicated_files = array_unique( array_diff_assoc( $files, array_unique( $files ) ) ); + // Duplicated names in different folders. + $folders = array(); + foreach ( $files as $file ) { + $folder = str_replace( basename( $file ), '', $file ); + if ( empty( $folder ) ) { + continue; + } + $folders[] = $folder; + } + $folders = array_unique( $folders ); + $folders_lowercase = array_map( 'strtolower', $folders ); + $duplicated_folders = array_unique( array_diff_assoc( $folders_lowercase, array_unique( $folders_lowercase ) ) ); + if ( ! empty( $duplicated_folders ) ) { + $this->add_result_error_for_file( + $result, + __( 'Duplicated folders names are not permitted.', 'plugin-check' ), + 'duplicated_folders', + implode( ', ', $duplicated_folders ), + 0, + 0, + '', + 8 + ); + } + + // Duplicated names in same folder. + $files_lowercase = array_map( 'strtolower', $files ); + $duplicated_files = array_unique( array_diff_assoc( $files_lowercase, array_unique( $files_lowercase ) ) ); if ( ! empty( $duplicated_files ) ) { $this->add_result_error_for_file( diff --git a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php index 01b245cde..5303c991d 100644 --- a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php @@ -156,6 +156,18 @@ public function test_run_with_duplicated_named_errors() { $errors = $check_result->get_errors(); $this->assertCount( 1, wp_list_filter( $errors['custom-file.php'][0][0], array( 'code' => 'duplicated_files' ) ) ); + + // Define the custom file list with duplicate folder names as they would appear in a plugin directory. + $custom_files = array( + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/sub directory/file-1.php', + UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/Sub Directory/file-2.php', + ); + + // Invoke method with the Check_Result instance and custom file list. + $result = $check_files_method->invoke( $check, $check_result, $custom_files ); + $errors = $check_result->get_errors(); + + $this->assertCount( 1, wp_list_filter( $errors['sub directory/'][0][0], array( 'code' => 'duplicated_folders' ) ) ); } public function test_run_with_library_core_errors() { From 721cf88bded064f78f073664eb60dad5f2e27536 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Sat, 4 Jan 2025 00:06:02 +0100 Subject: [PATCH 06/12] return --- includes/Checker/Checks/Plugin_Repo/File_Type_Check.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index 64e94e8fa..1786c53b4 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -315,6 +315,7 @@ function ( $file ) use ( $plugin_path ) { $folders = array_unique( $folders ); $folders_lowercase = array_map( 'strtolower', $folders ); $duplicated_folders = array_unique( array_diff_assoc( $folders_lowercase, array_unique( $folders_lowercase ) ) ); + if ( ! empty( $duplicated_folders ) ) { $this->add_result_error_for_file( $result, From 2cb3359df1cc48a38d1c776f7fa921308210c8d2 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Wed, 8 Jan 2025 22:59:03 +0100 Subject: [PATCH 07/12] changed error message case sensitive --- .../Checks/Plugin_Repo/File_Type_Check.php | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index 1786c53b4..5e6f25915 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -312,16 +312,16 @@ function ( $file ) use ( $plugin_path ) { } $folders[] = $folder; } - $folders = array_unique( $folders ); - $folders_lowercase = array_map( 'strtolower', $folders ); - $duplicated_folders = array_unique( array_diff_assoc( $folders_lowercase, array_unique( $folders_lowercase ) ) ); + $folders = array_unique( $folders ); + $folders_lowercase = array_map( 'strtolower', $folders ); + $case_sensitive_folders = array_unique( array_diff_assoc( $folders_lowercase, array_unique( $folders_lowercase ) ) ); - if ( ! empty( $duplicated_folders ) ) { + if ( ! empty( $case_sensitive_folders ) ) { $this->add_result_error_for_file( $result, - __( 'Duplicated folders names are not permitted.', 'plugin-check' ), + __( 'Case-Sensitive folders were found. They\'ll be problematic in different systems.', 'plugin-check' ), 'duplicated_folders', - implode( ', ', $duplicated_folders ), + implode( ', ', $case_sensitive_folders ), 0, 0, '', @@ -330,15 +330,15 @@ function ( $file ) use ( $plugin_path ) { } // Duplicated names in same folder. - $files_lowercase = array_map( 'strtolower', $files ); - $duplicated_files = array_unique( array_diff_assoc( $files_lowercase, array_unique( $files_lowercase ) ) ); + $files_lowercase = array_map( 'strtolower', $files ); + $case_sensitive_files = array_unique( array_diff_assoc( $files_lowercase, array_unique( $files_lowercase ) ) ); - if ( ! empty( $duplicated_files ) ) { + if ( ! empty( $case_sensitive_files ) ) { $this->add_result_error_for_file( $result, - __( 'Duplicated file names are not permitted.', 'plugin-check' ), - 'duplicated_files', - implode( ', ', $duplicated_files ), + __( 'Case-Sensitive files were found. They\'ll be problematic in different systems.', 'plugin-check' ), + 'case_sensitive_files', + implode( ', ', $case_sensitive_files ), 0, 0, '', From 10cb56168daeab6bcdaebb6b66f68bcc89cbb4ec Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Wed, 8 Jan 2025 23:01:50 +0100 Subject: [PATCH 08/12] added duplicated --- includes/Checker/Checks/Plugin_Repo/File_Type_Check.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index 5e6f25915..e750ce755 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -319,7 +319,7 @@ function ( $file ) use ( $plugin_path ) { if ( ! empty( $case_sensitive_folders ) ) { $this->add_result_error_for_file( $result, - __( 'Case-Sensitive folders were found. They\'ll be problematic in different systems.', 'plugin-check' ), + __( 'Case-Sensitive duplicated folders were found. They\'ll be problematic in different systems.', 'plugin-check' ), 'duplicated_folders', implode( ', ', $case_sensitive_folders ), 0, @@ -336,7 +336,7 @@ function ( $file ) use ( $plugin_path ) { if ( ! empty( $case_sensitive_files ) ) { $this->add_result_error_for_file( $result, - __( 'Case-Sensitive files were found. They\'ll be problematic in different systems.', 'plugin-check' ), + __( 'Case-Sensitive duplicated files were found. They\'ll be problematic in different systems.', 'plugin-check' ), 'case_sensitive_files', implode( ', ', $case_sensitive_files ), 0, From 75533a5d409b6fcd69aed1985504dc4cb91bb9e7 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Wed, 8 Jan 2025 23:20:56 +0100 Subject: [PATCH 09/12] updated tests with error names --- includes/Checker/Checks/Plugin_Repo/File_Type_Check.php | 2 +- .../phpunit/tests/Checker/Checks/File_Type_Check_Tests.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index e750ce755..247fb3e1f 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -320,7 +320,7 @@ function ( $file ) use ( $plugin_path ) { $this->add_result_error_for_file( $result, __( 'Case-Sensitive duplicated folders were found. They\'ll be problematic in different systems.', 'plugin-check' ), - 'duplicated_folders', + 'case_sensitive_folders', implode( ', ', $case_sensitive_folders ), 0, 0, diff --git a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php index 2ebded8f4..cb7bfbe33 100644 --- a/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php +++ b/tests/phpunit/tests/Checker/Checks/File_Type_Check_Tests.php @@ -128,7 +128,7 @@ public function test_run_with_badly_named_errors() { $this->assertCount( 1, wp_list_filter( $errors['badly|file%name!@#$%^&*()+=[]{};:"\'<>,?|`~.php'][0][0], array( 'code' => 'badly_named_files' ) ) ); } - public function test_run_with_duplicated_named_errors() { + public function test_run_with_case_sensitive_named_errors() { // Initialize the Check_Context with a plugin path that mimics the directory structure. $check_context = new Check_Context( UNIT_TESTS_PLUGIN_DIR . 'test-plugin-file-type-badly-named-files-errors/load.php' ); @@ -155,7 +155,7 @@ public function test_run_with_duplicated_named_errors() { $errors = $check_result->get_errors(); - $this->assertCount( 1, wp_list_filter( $errors['custom-file.php'][0][0], array( 'code' => 'duplicated_files' ) ) ); + $this->assertCount( 1, wp_list_filter( $errors['custom-file.php'][0][0], array( 'code' => 'case_sensitive_files' ) ) ); // Define the custom file list with duplicate folder names as they would appear in a plugin directory. $custom_files = array( @@ -167,7 +167,7 @@ public function test_run_with_duplicated_named_errors() { $result = $check_files_method->invoke( $check, $check_result, $custom_files ); $errors = $check_result->get_errors(); - $this->assertCount( 1, wp_list_filter( $errors['sub directory/'][0][0], array( 'code' => 'duplicated_folders' ) ) ); + $this->assertCount( 1, wp_list_filter( $errors['sub directory/'][0][0], array( 'code' => 'case_sensitive_folders' ) ) ); } public function test_run_with_library_core_errors() { From e7ad3d57e3d4d138092383862f0ed0c56eb435fc Mon Sep 17 00:00:00 2001 From: David Perez Date: Thu, 9 Jan 2025 19:39:48 +0100 Subject: [PATCH 10/12] Update includes/Checker/Checks/Plugin_Repo/File_Type_Check.php Co-authored-by: Pascal Birchler --- 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 247fb3e1f..b807e788e 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -319,7 +319,7 @@ function ( $file ) use ( $plugin_path ) { if ( ! empty( $case_sensitive_folders ) ) { $this->add_result_error_for_file( $result, - __( 'Case-Sensitive duplicated folders were found. They\'ll be problematic in different systems.', 'plugin-check' ), + __( 'Multiple folders with the same name but different case were found. This can be problematic on certain file systems.', 'plugin-check' ), 'case_sensitive_folders', implode( ', ', $case_sensitive_folders ), 0, From 42cec2050b8fb942bce6f540f7c0f08194e083c4 Mon Sep 17 00:00:00 2001 From: David Perez Date: Thu, 9 Jan 2025 19:39:59 +0100 Subject: [PATCH 11/12] Update includes/Checker/Checks/Plugin_Repo/File_Type_Check.php Co-authored-by: Pascal Birchler --- 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 b807e788e..b2a8b372b 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -336,7 +336,7 @@ function ( $file ) use ( $plugin_path ) { if ( ! empty( $case_sensitive_files ) ) { $this->add_result_error_for_file( $result, - __( 'Case-Sensitive duplicated files were found. They\'ll be problematic in different systems.', 'plugin-check' ), + __( 'Multiple files with the same name but different case were found. This can be problematic on certain file systems.' ), 'case_sensitive_files', implode( ', ', $case_sensitive_files ), 0, From 860a58b8dc053166385c69dae79eaf9b47204d13 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Thu, 9 Jan 2025 23:29:33 +0100 Subject: [PATCH 12/12] fixed lint error --- 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 b2a8b372b..7ecea7ac5 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -336,7 +336,7 @@ function ( $file ) use ( $plugin_path ) { if ( ! empty( $case_sensitive_files ) ) { $this->add_result_error_for_file( $result, - __( 'Multiple files with the same name but different case were found. This can be problematic on certain file systems.' ), + __( 'Multiple files with the same name but different case were found. This can be problematic on certain file systems.', 'plugin-check' ), 'case_sensitive_files', implode( ', ', $case_sensitive_files ), 0,