Plugin does not have valid header.. still activates

If you experiencing problems installing a plugin from a zip file, do not panic, do not curse the developer!

Google The+plugin+does+not+have+a+valid+header and you will find a lot, most of them will tell you that

  1. Mostly it is the folder structure which suits ftp’ers but does not suit zip installers
  2. sometimes  there is a minor problem in the plugin header
  3. sometimes  it is a bug in the way that the zip installer works and you will find that even though you have that invalid header message, the plugin will have activated or you will be able to activate it from the inactive plugins list

Use FTP if you can

The wordpress zip install is finicky – it does not cope with certain situations that I expect it to.  If you can at all use ftp instead, please do.  Not only will you have a better view of what is going on and your websites folder structure, you will also avoid some problems.

Handling a zip file – Zipped at folder or file level?

  • If the plugin zip file has a version number (which is good practice so one knows which file is which, the zip installer will install it into a version folder… and NOT upgrade – you will end up with two versions.
  • Unzip or explore the zip file first – if it is all neatly in a folder, you can ftp that folder up sweetly.  Nice!
  • If you insist on using the zip install, you will have to unzip, and then rezip at the lower level, without the top folder in order to use the zip installer

Still getting an invalid header message (even in 3.0.1)?

  • Somehow once you have mucked around trying the zip  install with folders etc, WordPress has stored the fact that it does not like the plugin, and even if you have now ftp’ed a copy up it remembers that it had a problem.  I was getting really frustrated and had double checked my header endlessly.  Then I found a note about ignoring the message, heading back, back, back to the plugin list.
  • Go to inactive plugins, refresh if you have to, activate.
  • In one instance, after being told there was an invalid header and not being to see it in the inactive list, I found that it had activated after all.

I have had an attempt at describing what seems to be the cause possible corrective action.  See

http://core.trac.wordpress.org/ticket/15191

Hope that helps!