From ad6f1df33d06ebc577c61af5cc8a953798e73da3 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 12 Mar 2026 07:15:14 +0100 Subject: [PATCH 1/5] Update class-directories-check.php Fix a bug where excluded directories were not detected because only the filename was checked, not the full path. Add __MACOSX to the list of excluded directories. Update error message. --- checks/class-directories-check.php | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/checks/class-directories-check.php b/checks/class-directories-check.php index 2a847b86..602e0dfa 100644 --- a/checks/class-directories-check.php +++ b/checks/class-directories-check.php @@ -1,14 +1,15 @@ error[] = sprintf( '%s: %s', __( 'REQUIRED', 'theme-check' ), - __( 'Please remove any extraneous directories like .git or .svn from the ZIP file before uploading it.', 'theme-check' ) + __( 'Please remove any extraneous directories like .git, .svn or __MACOSX from the ZIP file before uploading it.', 'theme-check' ) ); - $ret = false; + $ret = false; + break; } } From 33bdee98bb6542ec6a0828fb37af84356ef2cc77 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 12 Mar 2026 07:30:05 +0100 Subject: [PATCH 2/5] Update class-directories-check.php --- checks/class-directories-check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/class-directories-check.php b/checks/class-directories-check.php index 602e0dfa..06819c4e 100644 --- a/checks/class-directories-check.php +++ b/checks/class-directories-check.php @@ -55,7 +55,7 @@ public function check( $php_files, $css_files, $other_files ) { __( 'REQUIRED', 'theme-check' ), __( 'Please remove any extraneous directories like .git, .svn or __MACOSX from the ZIP file before uploading it.', 'theme-check' ) ); - $ret = false; + $ret = false; break; } } From 9367941866e24e1cf24feb296c516652edc9c62c Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 19 Mar 2026 11:18:40 +0100 Subject: [PATCH 3/5] Update class-directories-check.php --- checks/class-directories-check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/class-directories-check.php b/checks/class-directories-check.php index 06819c4e..f24df717 100644 --- a/checks/class-directories-check.php +++ b/checks/class-directories-check.php @@ -53,7 +53,7 @@ public function check( $php_files, $css_files, $other_files ) { $this->error[] = sprintf( '%s: %s', __( 'REQUIRED', 'theme-check' ), - __( 'Please remove any extraneous directories like .git, .svn or __MACOSX from the ZIP file before uploading it.', 'theme-check' ) + __( 'Please remove any extraneous directories like .git, .svn, .hg, .bzr or __MACOSX from the ZIP file before uploading it.', 'theme-check' ) ); $ret = false; break; From 9992bc8c12cd04054c9eab2d64021fac93f9d9c9 Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 19 Mar 2026 11:20:08 +0100 Subject: [PATCH 4/5] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- checks/class-directories-check.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/checks/class-directories-check.php b/checks/class-directories-check.php index f24df717..764a5201 100644 --- a/checks/class-directories-check.php +++ b/checks/class-directories-check.php @@ -49,7 +49,8 @@ public function check( $php_files, $css_files, $other_files ) { $path_segments = explode( '/', str_replace( '\\', '/', $path ) ); - if ( array_intersect( $path_segments, $excluded_directories ) ) { + $matched_directories = array_intersect( $path_segments, $excluded_directories ); + if ( ! empty( $matched_directories ) ) { $this->error[] = sprintf( '%s: %s', __( 'REQUIRED', 'theme-check' ), From 388d14c298725f55c2e50c6700d45dbd2039b8aa Mon Sep 17 00:00:00 2001 From: Carolina Nymark Date: Thu, 19 Mar 2026 11:21:06 +0100 Subject: [PATCH 5/5] Update class-directories-check.php --- checks/class-directories-check.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checks/class-directories-check.php b/checks/class-directories-check.php index f24df717..0322f31d 100644 --- a/checks/class-directories-check.php +++ b/checks/class-directories-check.php @@ -53,7 +53,7 @@ public function check( $php_files, $css_files, $other_files ) { $this->error[] = sprintf( '%s: %s', __( 'REQUIRED', 'theme-check' ), - __( 'Please remove any extraneous directories like .git, .svn, .hg, .bzr or __MACOSX from the ZIP file before uploading it.', 'theme-check' ) + __( 'Please remove any extraneous directories like .git, .svn, .hg, .bzr or __MACOSX from the ZIP file before uploading it.', 'theme-check' ) ); $ret = false; break;