[wp-trac] [WordPress Trac] #28651: activate_plugin() re-triggers activation routine for already-active network plugins

WordPress Trac noreply at wordpress.org
Thu Jun 26 20:46:07 UTC 2014


#28651: activate_plugin() re-triggers activation routine for already-active network
plugins
--------------------------+-----------------------------
 Reporter:  jbrinley      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Plugins       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  multisite     |
--------------------------+-----------------------------
 In `activate_plugins()`, there's a check to see if the plugin you are
 activating is already in the array of currently active plugins. If that
 fails, nothing else should happen in `activate_plugins()`; it just skips
 to the end and returns `null`.

 When network activating a plugin, though, the `$current` array is flipped.
 Plugin paths are keys, and the values are activation timestamps. The
 `in_array()` will always return `false`, unless one of the plugins happens
 to have a timestamp of 0. So if a plugin is already network active,
 sending it through `activate_plugin()` again will trigger
 `'activate_plugin'` and `'activate_' . $plugin` again on the already-
 active plugin.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/28651>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list