Avoiding plugin install problems with zip install
|Reported by:||anmari||Owned by:|
A number of problems can be experienced with installing via a zip file. Since it is usually lesser skilled people who use the zip installer, arguably this should be a 'cleverer' process.
1) If the developer is used to ftp, they will probably zip a plugin at the higher folder level. This is convenient for unzip and ftping up, but not for zip installing. The unzip cannot deal with this, it wants the zip file not to have a top level folder structure. It says "installed" but then one gets invalid header message. The error message is misleading as it is more than there is a intervening folder there instead of an invalid header.
2) If the developer names the zip file with a version number (which is arguably a good practice) Say pluginname.1.1.zip, the zip installer will create that exact folder - causing a duplicate plugin problem if an upgrade was intended. The ftper will avoid this because if they unzip locally and then ftp, the folder name will be correct.
3) Once problems like this have been experienced, then one seems to get an invalid header message on plugin activation, even though the plugin is now in the right folder structure. Possibly wordpress has saved the state somehow? However it seems that one can ignore this and reverse back to the plugins list and either the plugin has activated anyway, or one can then activate from the inactive list. It does not happen cleanly though.
I've had a bit of a look and it seems that it is code in class-wp-upgrader.php that needs changing. Somewhere between unpack_package and install_package - probably the working_dir needs to be fixed
Line 192 of wp-admin\includes\class-wp-upgrader.php says:
Locate which directory to copy to the new folder, This is based on the actual folder holding the files.
Sooo if one "fixed" the working_dir (stripped the version numbers off and dealt with the 'inside a folder' situation) then, perhaps the rest would follow naturally?
My quick notes with some links (to see the wide-spreadness (is that real word) of people experiencing problems. http://webdesign.anmari.com/2312/activation-error-plugin-does-not-have-valid-header-still-activates/
Change History (5)
- Keywords changed from zip install, upgrade, invalid plugin header to zip install upgrade, invalid plugin header
- Resolution set to worksforme
- Status changed from new to closed
- Version changed from 3.0.1 to 3.1.2
- Keywords changed from zip install upgrade, invalid plugin header to zip install upgrade invalid plugin header
- Milestone changed from Future Release to 3.1.2
- Version changed from 3.1.2 to 3.0.1