[wp-trac] [WordPress Trac] #43503: 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.
WordPress Trac
noreply at wordpress.org
Thu Mar 8 16:50:43 UTC 2018
#43503: 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.
-----------------------------+-----------------------------
Reporter: anonym999999 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Upgrade/Install | Version: 4.9.4
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
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?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43503>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list