wip
This commit is contained in:
+7
-3
@@ -72,14 +72,15 @@ if ( get_option( 'db_upgraded' ) ) {
|
||||
* @param bool $do_mu_upgrade Whether to perform the Multisite upgrade routine. Default true.
|
||||
*/
|
||||
if ( apply_filters( 'do_mu_upgrade', true ) ) {
|
||||
$c = get_blog_count();
|
||||
$blog_count = get_blog_count();
|
||||
|
||||
/*
|
||||
* If there are 50 or fewer sites, run every time. Otherwise, throttle to reduce load:
|
||||
* attempt to do no more than threshold value, with some +/- allowed.
|
||||
*/
|
||||
if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int) ( $c / 50 ) ) === 1 ) ) {
|
||||
if ( $blog_count <= 50 || ( $blog_count > 50 && mt_rand( 0, (int) ( $blog_count / 50 ) ) === 1 ) ) {
|
||||
require_once ABSPATH . WPINC . '/http.php';
|
||||
|
||||
$response = wp_remote_get(
|
||||
admin_url( 'upgrade.php?step=1' ),
|
||||
array(
|
||||
@@ -87,11 +88,14 @@ if ( get_option( 'db_upgraded' ) ) {
|
||||
'httpversion' => '1.1',
|
||||
)
|
||||
);
|
||||
|
||||
/** This action is documented in wp-admin/network/upgrade.php */
|
||||
do_action( 'after_mu_upgrade', $response );
|
||||
|
||||
unset( $response );
|
||||
}
|
||||
unset( $c );
|
||||
|
||||
unset( $blog_count );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user