[wp-trac] [WordPress Trac] #26735: Plugin bulk deletion attempts to define WP_UNINSTALL_PLUGIN constant multiple times

WordPress Trac noreply at wordpress.org
Mon Feb 3 15:17:46 UTC 2014


#26735: Plugin bulk deletion attempts to define WP_UNINSTALL_PLUGIN constant
multiple times
--------------------------+-----------------------------
 Reporter:  jdgrimes      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.9
Component:  Plugins       |     Version:  2.7
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  administration
--------------------------+-----------------------------

Comment (by jdgrimes):

 Replying to [comment:5 spmlucas]:
 > 26735.diff simply adds the if statement to prevent the error. I've left
 the declaration of `WP_UNINSTALL_PLUGIN` alone, but I don't think changing
 it to `true` is a big deal. The codex prescribes simply checking for the
 existence of the constant, not the value - checking the value during a
 bulk uninstall is going to fail unless the plugin happens to be the first
 in the batch.

 That is true, but it is being done, and possibly by a lot of developers.
 Although the value isn't checked in the codex examples, one of the
 [http://wordpress.stackexchange.com/questions/25910/uninstall-activate-
 deactivate-a-plugin-typical-features-how-to/25979#25979 reference links]
 there does prescribe this (as I pointed out in the original post). The
 fact that it is defined to the file path is misleading. One naturally
 assumes that it is OK to check the value. I believe it was originally
 intended that the value always reflect the plugin being uninstalled.
 Changing it to true would make it so those plugin's that are checking the
 value (and thought they were doing it right) would uninstall properly. I
 don't know of any case where it is necessary to check which plugin is
 being uninstalled, that would be broken by this.

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


More information about the wp-trac mailing list