diff --git a/src/Support/Zip.php b/src/Support/Zip.php index 9310f95..72a72d0 100644 --- a/src/Support/Zip.php +++ b/src/Support/Zip.php @@ -167,6 +167,12 @@ public function ensureDoesntHaveSubdir(string $targetPath): string $files[] = $file; } + foreach ($files as $file) { + if (str_contains($file, 'plugin.json') || str_contains($file, 'theme.json')) { + return $targetPath; + } + } + $fileCount = count($files); if (1 < $fileCount && $fileCount <= 3) { throw new \RuntimeException("Cannot handle the zip file, zip file count is: {$fileCount}, extract path is: {$targetPath}");