[wp-trac] [WordPress Trac] #14781: Allow upload of PHP files as plugin

WordPress Trac noreply at wordpress.org
Fri May 7 00:22:34 UTC 2021


#14781: Allow upload of PHP files as plugin
----------------------------------------+-----------------------------
 Reporter:  hakre                       |       Owner:  (none)
     Type:  feature request             |      Status:  new
 Priority:  normal                      |   Milestone:  Future Release
Component:  Upgrade/Install             |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:  administration
----------------------------------------+-----------------------------
Changes (by pbiron):

 * keywords:  needs-refresh has-patch needs-unit-tests => has-patch needs-
     unit-tests


Comment:

 [attachment:"14781.4.diff"] Refreshed patch so that it cleaning applies.

 I did add 1 thing to the refreshed patch: if `rename()` fails, it sets
 `$result` to a `WP_Error` instance.  Without this, the update would appear
 to succeed when it actually hasn't.

 As @dd32 mentions, I think the patch should be extended to check that the
 uploaded single PHP file actually has plugin headers.  That is not yet
 included in the patch.

 I'd also say that I'm not sure that creating a sub-directory and putting
 the single PHP in there is ''right'' thing to do.  Since core allows
 single file plugins to exist directly in `WP_PLUGIN_DIR`, if this ticket
 moves forward that ''might'' be what should happen.

 But since at the moment I'm just triaging tickets in this component and
 refreshes patches where needed, I won't bother investigating that
 possibility at this time.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/14781#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list