Make WordPress Core

Opened 2 years ago

Last modified 3 months ago

#24922 new enhancement

Please do not hardcode network upgrade to 5 sites at a time.

Reported by: _ck_ Owned by:
Milestone: Future Release Priority: normal
Severity: minor Version: 3.6
Component: Upgrade/Install Keywords:
Focuses: multisite Cc:


Upgrading hundreds of thousands of sites via network upgrade is a process of insanity with browser based 5-at-a-time limit.

Please put a filter on it and/or allow it to be set via get_options.

Hardcoded "5" can be found in /wp-admin/network/upgrade.php

CLI tool for upgrading would be even better - I guess I can extract the code from that script to make it CLI based at high speed.

Also, why does the query for the upgrade use

$wpdb->get_results("SELECT * FROM (note the select wildcard)

when only $details['blog_id'] is used in the script afterwards?

You could fetch thousands of integers at a time if you didn't use a wildcard to wastefully grab and return all columns.

Use instead

$wpdb->get_col("SELECT blog_id FROM

Attachments (1)

24922.diff (1.9 KB) - added by kuliraj 3 months ago.
Filter added

Download all attachments as: .zip

Change History (8)

comment:1 @channeleaton2 years ago

  • Cc channeleaton added

Isn't it set to 5 to keep PHP from timing out?

As far as a CLI tool, not everyone has SSH access, thus making it less useful for many users. It may be better to release something like that as a wp-cli extension.

comment:2 @jeremyfelt21 months ago

  • Component changed from Network Admin to Upgrade/Install

comment:3 @cfoellmann21 months ago

I am all for making the hardcoded value "5" modifiable via a filter. Why not?

comment:4 @jeremyfelt12 months ago

  • Milestone changed from Awaiting Review to Future Release

We should consider this ticket as part of any UI work done around core updates. Definitely room for a filter if things do not get a full revisit via JS.

5 is pretty sad sometimes and I've done horrible things to make it 10. :)

comment:5 @jeremyfelt11 months ago

I created #30097 to track the second part of this report separately, as it can be fixed without adding a filter.

comment:6 @jeremyfelt5 months ago

Related (maybe duplicate) #11869. See also #18292.

@kuliraj3 months ago

Filter added

comment:7 @kuliraj3 months ago

The uploaded patch runs the number of sites that are upgraded at once through the filter called "ms_upgrade_sites".

Note: See TracTickets for help on using tickets.