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

WordPress Trac noreply at wordpress.org
Sun Feb 2 16:01:36 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:  needs-patch   |     Focuses:  administration
--------------------------+-----------------------------

Comment (by jdgrimes):

 Replying to [comment:2 nacin]:
 > WP_UNINSTALL_PLUGIN is simply there so a plugin's uninstall.php file can
 confirm it was indeed invoked from the uninstall routine. We simply need
 to do `if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) defined(
 'WP_UNINSTALL_PLUGIN', true );` It'd only avoid the notice, not actually
 change what's happening.

 Right, that seems like the logical solution. The problem is that it could
 cause some plugins not to uninstall themselves, because it's not 100%
 backward compatible. I mentioned that in the original post, but I now see
 that I really didn't make it clear. Some people are checking it like this:

 {{{
 if ( __FILE__ != WP_UNINSTALL_PLUGIN )
      return;
 }}}

 Because right now the value of `WP_UNINSTALL_PLUGIN` is the path of the
 plugin's main file. If we just change it to `true`, the plugin won't
 uninstall. Unfortunately, this might be fairly ubiquitous (see the
 original post).

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


More information about the wp-trac mailing list