WordPress.org

Make WordPress Core

Opened 6 months ago

Last modified 6 months ago

#52874 new defect (bug)

Activating plugins on Install page randomly errors with "The plugin does not have a valid header" message.

Reported by: danieliser Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Plugins Keywords:
Focuses: administration Cc:

Description

This seems to be something that has been occurring for some time without resolution in core.

Just started seeing a lot more reports of it recently for one of my plugins, which lead me to dig and see that it has been occurring in the same way to other plugins for years.

Issue: On Plugin Installer page, if you install and activate plugins it can show the following message: "The plugin does not have a valid header".

Most users get around it by going to the All Plugins page and activating without issue.

Plugin that currently seems affected include:

And some from the past few years with same issue:

That was only what I found on first page of google.

Change History (4)

#1 @SergeyBiryukov
6 months ago

  • Component changed from General to Plugins

#2 @SergeyBiryukov
6 months ago

  • Summary changed from Activating plugins on Install page randomly erorrs with "The plugin does not have a valid header" message. to Activating plugins on Install page randomly errors with "The plugin does not have a valid header" message.

#3 @siliconforks
6 months ago

It seems that this issue occurs when a plugin contains multiple files with the Plugin Name: header. The Content Control and Zapier plugins both contain a trunk directory which seems to be a nested copy of the entire plugin; presumably this is not intentional and was likely caused by some Subversion-related glitch. The W3 Total Cache plugin contains an extension-example directory which contains a plugin apparently written as example code; this is presumably intentional, but it still seems to be an issue with W3 Total Cache rather than WordPress itself. Note that the Plugin Handbook specifically mentions that only one file in a plugin is allowed to have the plugin header comment.

There might still be an issue in WordPress here; at least, the error message seems misleading (the problem isn't that the plugin does not have a valid header - the problem is that the plugin contains two different files with valid headers).

#4 @danieliser
6 months ago

@siliconforks - I wasn't sure what you meant as I didn't have that locally, but I do see that the Content Control 1.1.5 tag has a nested trunk folder. No idea how that would get there, committed and tagged v1.1.6 this week with the exact same CLI commands sans changing v#.

That said it does make since, but given that this doesn't occur on the All Plugins page, maybe some assumption should be made as to which of the "found" plugins would be the primary, maybe a file priority list.

slug/slug.php
slug/index.php
slug/(*.).php
slug//(*.).php

This way it doesn't throw the error.

I do see the reason not to do so in the case of the extra /trunk/ not supposed to be there, but I know other plugins that do legit contain secondary plugins which as you pointed out would also cause this and likely shouldn't.

If its decided to leave the error, the messaging needs to be updated to be more clear that in fact the header is not invalid, but that multiple headers were detected, then maybe even list them all and let the user choose which to activate.

Anything is better than the generic message happening currently.

Should point out, that if the notice said different and indicated multiple were detected, we wouldn't have ever filed this ticket, would have instantly known something wasn't right and had a much better idea of what it was.

Note: See TracTickets for help on using tickets.