[wp-trac] [WordPress Trac] #23197: wp-activate.php, without explanation, does not load site plugins

WordPress Trac noreply at wordpress.org
Wed Jul 23 19:21:25 UTC 2025


#23197: wp-activate.php, without explanation, does not load site plugins
---------------------------------------+-----------------------------
 Reporter:  radiok                     |       Owner:  (none)
     Type:  defect (bug)               |      Status:  reopened
 Priority:  normal                     |   Milestone:  Future Release
Component:  Login and Registration     |     Version:  3.0
 Severity:  normal                     |  Resolution:
 Keywords:  needs-testing needs-patch  |     Focuses:  multisite
---------------------------------------+-----------------------------

Comment (by jerclarke):

 I don't know if this will motivate a change after all these years, but
 FWIW this weird behavior where plugins aren't loaded on `wp-activate.php`
 also has an obnoxious side effect of spamming error logs on non-multisite
 installs if someone visits the file directly.

 e.g.


 {{{
 [23-Jul-2025 13:45:17] Uncaught Error: "Class "XYZ" not found" file:
 ...themes/my-theme/file.php:54 url: example.com/wp-activate.php
 }}}

 (I know my error logs have an unusual format, but as you can see, they
 point me to this bug being the cause)

 These errors are caused by the theme being loaded without loading the
 plugins, making it impossible to have anything in the theme that relies on
 the plugin. In my case trying to fix  this lead to dozens of edits that
 basically come down to having `function_exists()` on every single function
 call that relies on a plugin being present.

 Really seems like an unnecessary complication, especially since the site
 in the example above doesn't even have multisite active, it's just bots
 that visit every URL or I guess they are trying to use some exploit
 related to `wp-activate.php`

 On my multisite install the same thing happens, but with the added
 incoherence that network activated plugins are available but not normal-
 active ones. In my case, this meant that the hCaptcha plugin, which is
 network activated, throws an error because it can't find Gravity Forms,
 which it's configured to integrate but the GF plugin isn't network
 activated, so it's not available.

 That scenario strikes me as pretty absurd and without reading this whole
 thread I could never have puzzled out the cause. Loading some plugins and
 not others is just silly, as someone above already said. It leads to bugs
 that no one could predict and me going to the hCaptcha plugin to ask them
 to fix this seems like way more complication than `wp-activate.php` should
 require.

 **If anyone has a solution to reliably silence these errors while keeping
 activation working, I'd love to hear it.**

 I was thinking I could just add something like this in `functions.php` to
 make sure the plugin is active:

 {{{
 if ( !defined( 'my_plugin_function' ) ) {
   die();
 }
 }}}

 But that would break the activation form on multisite right? It solves the
 error log on non-multisite where `wp-activate.php` does nothing, but on
 multisite the activation would be broken unless I could guarantee that the
 plugin was network enabled.

 Is there something else I could add to `functions.php` to "test the plugin
 is active" that doesn't break anything?

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


More information about the wp-trac mailing list