Question

I recently committed version 2 of my new plugin to the Plugin Directory, but now when you install the plugin for the first time, you get this error on activation: "The plugin does not have a valid header."

alt text

You can workaround it by browsing to the plugin section of wp-admin and activating from there with no errors, but this is still not ideal.

As far as I can tell, the header looks fine, and is pretty much the same as version 1.0. Which leave me to wonder why I get this error?

Here is the plugin: http://wordpress.org/extend/plugins/export-to-text/

Was it helpful?

Solution

From what you write, it looks to me that you accidentially copied/tagged the whole /trunk directory in your SVN while tagging/branching. As the wordpress plugin directory just grabs the full directory that got tagged, the zip package was invalidated.

You can recover from that. I once made the same mistake. Just do a full checkout on your local machine in another directory (not the working copy in which you develop your plugin). That check downloads everything, the current trunk and all tags.

Then go inside the tags directory and locate the tag in which you accidentially created the mess. SVN-Delete it and commit that change. You probably can revert the accidental change as well, but I think deleting the directory of the concrete tag is more straight forward.

Next time you tag your plugin, tag the working copy and not the trunk directory.

If you're using SVN on the commandline:

Tags - Chapter 4. Branching and Merging

If you're using Tortoise SVN:

Branching / Tagging - Chapter 4. Daily Use Guide

OTHER TIPS

It seems you have some issue with folder structure, fresh install (or download) of your plugin has following:

export-to-text/trunk/[plugin files]
export-to-text/[plugin files]

The trunk copy seems like an error and is what likely messes up WP scanning for plugin files.

After checking the plugin package (1.1), something else popped into my eyes in the readme:

Requires at least: 3.01 Tested up to: 3.01

I do not know if this is causing the error, but probably you should write 3.0.1 (see the dot between 0 and 1).

I had the exact same error before and I was not using any kind of version control when I faced the issue. But I will just go ahead and tell you what solved the problem for me and it might actually help you.

The problem for me was the IDE I was using. It was inserting a blank invisible char just before the PHP opening tag. Problem solved by trying a different IDE which is the regular notepad :)

That error generally occurs when it's missing one of the key header fields WP requires. Always include a name, author, URL, author URL, description, and version.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top