#43503 closed defect (bug) (invalid)
Problematic handling of folder name when using upload to add a new theme and problem with delete when forder name have a version number in filename.
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.9.4 |
Component: | Upgrade/Install | Keywords: | close |
Focuses: | Cc: |
Description
Hello,
First bug here. Thanks for the great platform!
I report this as a bug but I think it's probably a bug and a enhancement suggestion.
We are about to release a platform with a plugin and theme that are dependant on each other and could not comply to WordPress official theme and plugin repository, so we will distribute it through Github.
We have a documentation that will be offered in the Wiki to assist with the installation and to offer a simple evaluation installation process, I have used the upload theme feature and another library to install
the required plugin (http://tgmpluginactivation.com/).
For convenience, I also use this other wonderfull projet (https://github.com/YahnisElsts/plugin-update-checker) to add upgrade from Github integrated in WordPress UI.
While testing the integration I stumbled with a few problems and it looks like one is on WordPress side.
For my test, I had a theme release in Github that was named "theme-exemple-1.0.zip".
When I import this file using WordPress UI, everything goes well. The folder created in wp-content/themes is named "theme-exemple-1.0".
BUG: If I try to delete the theme from WordPress UI, the delete is not working (theme not found). I have to rename the folder manually to theme-exemple to be able to delete it (from UI).
I traced the code and was actually surprised to discover that there where no way to change the folder name.
1) The upload process doesn't use metadata from the header of style.css to calculate the slug / folder name (I think this is done on plugin side).
2) It's not possible to have a sub-folder to encapsulate the rightly named folder.
By exemple :
release.zip containing a folder "theme-exemple" (the process to find style.css should scan folders and drill down in folders and accept the package and corresponding folder if it can find ONE styles.css?)
There was a related issue with "plugin-update-checker" where the name of the theme is calculated from slug and become "theme-exemple-10" (without the dot), so WordPress fails the upgrade of the plugin because
"plugin-update-checker" use "theme-exemple-1.0" as theme identifier.
As a workaround, I will modify the filename of my release on github to not have the version tag on it (which is in some ways convenient).
Maybe a known issue?
Change History (3)
#2
@
6 years ago
- Keywords close added
- Resolution set to invalid
- Status changed from new to closed
This is because WordPress expects to see a zip in a standard for plugins and themes. You see this because the processes that you utilize to create these downloads doesn’t follow the format that WordPress expects.
This is not a bug in WordPress.
Correction :
"fails the upgrade of the THEME because "plugin-update-checker" use "theme-exemple-1.0" as theme identifier."