YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.22k stars 403 forks source link

Failed to update the theme, always prompt :The directory structure of the update is incorrect. All files should be inside a directory named unique-plugin-or-theme-slug, not at the root of the ZIP archive. #482

Closed muchenkezhan closed 2 years ago

muchenkezhan commented 2 years ago

The directory structure of the update is incorrect. All files should be inside a directory named unique-plugin-or-theme-slug, not at the root of the ZIP archive.

I can't understand ,json Here's the file : { "version": "4.8", "details_url": "https://xxx.cn/zhuti/51.html", "download_url": "http://www.xxx.cn/wp-content/themes/qzdy-4.8.zip" }

Is the download path name wrong

muchenkezhan commented 2 years ago

https://s3.bmp.ovh/imgs/2022/03/d45c4d9c1ad4c6d3.png

YahnisElsts commented 2 years ago

This error has to do with the contents of the ZIP file. When you make the ZIP file, all of the theme files should be in a directory that has the same name as the theme slug. So when you open the ZIP file, you should only see one directory, and all of the theme files/directories should be inside that directory.

Some ZIP software can make it look like the contents of a ZIP archive are inside a directory when they are actually not. For example, I've received multiple reports from people who use macOS that it shows ZIP archives like that. If you're on a Mac, I would recommend trying a third-party ZIP tool.