mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-08 14:44:37 +00:00
Upgrade/Install: Avoid update_option() calls during bootstrap.
[57545] introduced the Plugin Dependencies feature, which contains a new `plugin_data` option. Previously, the `plugin_data` option was being updated during bootstrap and in `get_plugins()`, causing an error when using the install script as the options database table does not yet exist, and also risked an "out of sync" issue between the database and the cache on websites with heavy traffic. This removes the calls to `update_option()` during Core's bootstrap, and guards the call in `get_plugins()` to ensure that it doesn't run when WordPress is installing. Follow-up to [57545]. Props desrosj, swisspidy, huzaifaalmesbah, afragen, dd32, azaozz, costdev. Fixes #60461. See #60457, #60491. git-svn-id: https://develop.svn.wordpress.org/trunk@57592 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -360,7 +360,10 @@ function get_plugins( $plugin_folder = '' ) {
|
||||
|
||||
$cache_plugins[ $plugin_folder ] = $wp_plugins;
|
||||
wp_cache_set( 'plugins', $cache_plugins, 'plugins' );
|
||||
update_option( 'plugin_data', $new_plugin_data );
|
||||
|
||||
if ( ! wp_installing() ) {
|
||||
update_option( 'plugin_data', $new_plugin_data );
|
||||
}
|
||||
|
||||
return $wp_plugins;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user