[wp-trac] [WordPress Trac] #60457: Plugin Dependencies: Running update_option within wp-settings can be catastrophic for a high traffic site

WordPress Trac noreply at wordpress.org
Wed Feb 7 07:58:36 UTC 2024


#60457: Plugin Dependencies: Running update_option within wp-settings can be
catastrophic for a high traffic site
--------------------------+--------------------------
 Reporter:  dd32          |       Owner:  costdev
     Type:  defect (bug)  |      Status:  assigned
 Priority:  normal        |   Milestone:  6.5
Component:  Plugins       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  dev-feedback  |     Focuses:  performance
--------------------------+--------------------------
Changes (by costdev):

 * keywords:   => dev-feedback
 * owner:  (none) => costdev
 * status:  new => assigned
 * milestone:  Awaiting Review => 6.5


Comment:

 Thanks for opening the ticket Dion! Your point about DB write during
 bootstrap is well taken.

 In this case, the DB write in `wp-settings.php` is to update any
 potentially missing plugin data for active plugins, rather than being a
 required part of the plugin dependencies feature. It's an extra layer of
 ensuring no plugin activation goes unnoticed by the feature (such as
 external database updates to `active_plugins`, for example).

 It can be removed without hindering the dependencies check being performed
 during the bootstrap, which essentially just checks against the
 `active_plugins` option - which will be cached from the call to
 `wp_get_active_and_valid_plugins()` already in the bootstrap a few lines
 above.

 I'm happy to write the patch to remove the `update_option()` and related
 lines. I'll hold off on doing this until we get thoughts from @afragen and
 @azaozz.

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


More information about the wp-trac mailing list