WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 4 years ago

#15191 closed enhancement (worksforme)

Avoiding plugin install problems with zip install

Reported by: anmari Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0.1
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description

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 (6)

#1 @dd32
9 years ago

  • Milestone changed from Awaiting Review to Future Release

At this stage, this needs to be smarter.

#2 @hew
9 years ago

  • Cc hew added

anmari, do you have an example zip that is a good test case for what you describe?

#3 @anmari
8 years ago

  • 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

Hi just retested in 3.1.2 and this seems to be working beautifully now.

#4 @scribu
8 years ago

  • 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

#5 @sorich87
8 years ago

  • Keywords zip install upgrade invalid plugin header removed

#6 @DrewAPicture
4 years ago

  • Milestone 3.1.2 deleted
Note: See TracTickets for help on using tickets.