[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 14:57:30 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:4 jdgrimes]:
 > 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).


 Actually, forget about this. I just realized that this will actually be
 backward compatible if we just define `WP_UNINSTALL_PLUGIN` as `true`.
 Because `__FILE__ == true`. So, as long as they aren't use strict
 typechecking (`!==`), they should be fine.

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


More information about the wp-trac mailing list