Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#19385 closed defect (bug) (fixed)

wp_get_active_network_plugins() can generate a needless query

Reported by: nacin Owned by: ryan
Milestone: 3.3 Priority: normal
Severity: normal Version: 3.3
Component: Multisite Keywords: has-patch commit
Focuses: Cc:


In #18955, we stopped caching the default value when get_site_option() was called on an option that does not exist.

This introduces a situation where active_sitewide_plugins may be queried for on every pageload.

  1. active_sitewide_plugins should be instantiated in populate_network() and added to upgrade_network().
  1. wp_load_core_site_options() should be set up to cache as false any keys it misses. As this only works when an external object cache is not at play, it basically becomes a rudimentary not-options cache. (See #19008.)

Point 1 is for 3.3. Point 2 is a general nice-to-have.

Attachments (2)

19385.diff (1.2 KB) - added by ryan 10 years ago.
Handles point 1.
19385.2.diff (1.4 KB) - added by ryan 10 years ago.
Bump db version

Download all attachments as: .zip

Change History (5)

10 years ago

Handles point 1.

#1 @nacin
10 years ago

  • Keywords has-patch added

Patch from ryan addresses point 1. Due to how get_site_option() checks for null or false against $value coming from the cache, point 2 isn't obtainable for now.

10 years ago

Bump db version

#2 @nacin
10 years ago

  • Keywords commit added

#3 @ryan
10 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [19470]:

Initialize active_sitewide_plugins during network install and upgrade. fixes #19385

Note: See TracTickets for help on using tickets.