[wp-trac] [WordPress Trac] #22287: Plugin in another plugin folder causes Activate link to be wrong on Download

WordPress Trac noreply at wordpress.org
Thu Sep 17 21:35:15 UTC 2020


#22287: Plugin in another plugin folder causes Activate link to be wrong on
Download
------------------------------------+------------------------------
 Reporter:  joehoyle                |       Owner:  (none)
     Type:  defect (bug)            |      Status:  new
 Priority:  normal                  |   Milestone:  Awaiting Review
Component:  Upgrade/Install         |     Version:  3.4
 Severity:  normal                  |  Resolution:
 Keywords:  dev-feedback has-patch  |     Focuses:
------------------------------------+------------------------------
Changes (by pbiron):

 * keywords:  dev-feedback has-patch needs-refresh => dev-feedback has-patch


Comment:

 [attachment:"22287.diff"] refreshes [attachment:"class-wp-
 upgrader.php.diff"] so that applies cleanly after all these years :-)

 While patch solves the case of the plugin in #21954 (i.e., when the
 "additional" plugin is in a sub-directory), it's also possible to have
 multiple files with plugin headers directly in the plugin's dir...and the
 "main" plugin in that case may not necessarily be the one that is
 alphabetically first.

 One example of a plugin that has 2 files with plugin headers at the "root"
 of the plugin's directory is
 https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html
 /wp-content/plugins/handbook

 So, maybe a heuristic for that case would be to first check for a file
 named `{$slug}.php`, where `$slug` is the plugin's directory name.  If
 that file exists, use it; if not, then do the sort and return as in the
 patch.

 Thoughts?

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


More information about the wp-trac mailing list