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

WordPress Trac noreply at wordpress.org
Sat Dec 28 15:22:38 UTC 2013


#26735: Plugin bulk deletion attempts to define WP_UNINSTALL_PLUGIN constant
multiple times
--------------------------+-----------------------------
 Reporter:  jdgrimes      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:  2.7
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 The `WP_UNINSTALL_PLUGIN` constant is defined by `uninstall_plugin()`
 before the plugin's `uninstall.php` file is included (if the plugin has
 one). When deleting multiple plugins with `uninstall.php` files, the
 function attempts to define this constant each time, which will result in
 a notice.

 >`PHP Notice:  Constant WP_UNINSTALL_PLUGIN already defined`

 The notice will never be noticed by most users, because it will be
 silenced by default, but this could be an issue if plugins are checking
 for the value of `WP_UNINSTALL_PLUGIN`, as recommended
 [http://wordpress.stackexchange.com/questions/25910/uninstall-activate-
 deactivate-a-plugin-typical-features-how-to/25979#25979 here] (which is
 linked to
 [http://codex.wordpress.org/Function_Reference/register_uninstall_hook#Discussions
 from the codex]), and not just whether it is defined.

 I don't have a good solution, sorry.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/26735>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list