[wp-trac] [WordPress Trac] #44208: No plugins loaded when user loads wp-activate.php

WordPress Trac noreply at wordpress.org
Wed May 23 18:50:46 UTC 2018


#44208: No plugins loaded when user loads wp-activate.php
--------------------------+-----------------------------
 Reporter:  conner_bw     |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.9.6
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When a user gets an activation email they are asked to click on a URL that
 looks something like:

 https://site/wp-activate.php?key=16d1406f53bc783f

 Expected: I can hook into actions and filters from in my plugin.

 Actual: wp_get_active_and_valid_plugins() returns an empty array, no
 plugins are ever loaded.

 Why? Because:

 First line of wp-activate.php:

 {{{#!php
 <?php
 define( 'WP_INSTALLING', true );
 }}}


 Code to load plugins in `wp_get_active_and_valid_plugins()` if we remove
 the deprecated helper stuff:

 {{{#!php
 <?php
 $plugins = array();
 $active_plugins = (array) get_option( 'active_plugins', array() );
 if ( empty( $active_plugins ) || wp_installing() )
     return $plugins;
 }}}

 Help?

 See:

 [1] https://github.com/WordPress/WordPress/blob/master/wp-
 includes/load.php
 [2] https://github.com/WordPress/WordPress/blob/master/wp-activate.php

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


More information about the wp-trac mailing list