WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 4 months ago

#37799 assigned enhancement

Add progress indicator to "Upgrade Network" page

Reported by: johnjamesjacoby Owned by: pcarvalho
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-screenshots has-patch
Focuses: ui, multisite Cc:

Description

The "Upgrade Network" page loops through sites in a network, and upgrades them 5 at a time. As primitive as this interface is, as a network admin responsible for upgrading thousands of sites, I actually don't mind the simplicity.

What would be nice, though, is some indication of how many sites there are, and how many are left until the routine is complete. Maybe this is a progress bar (can we steal that from media?) or a pie-chart, or a simple "Upgrading sites 10-15 out of 2,378" or something more encouraging like "Only 2,375 to go!"

Attachments (6)

Screen Shot 2016-08-23 at 15.08.17.png (50.2 KB) - added by johnjamesjacoby 4 years ago.
"All Done!", while a hilariously simple response, could also include a nice summary of events
37799.diff (1.5 KB) - added by danhgilmore 4 years ago.
Added "Upgrading sites X - Y of Total"
37799.1.diff (1.2 KB) - added by gma992 4 years ago.
Added translatable strings via printf()
37799.2.diff.png (46.1 KB) - added by pcarvalho 3 years ago.
Printed Messages
37799.2.diff (2.6 KB) - added by pcarvalho 3 years ago.
add current batch count and total, and improve messages for network upgrade
37799.4.diff (2.6 KB) - added by pcarvalho 3 years ago.
fixed typo and comment block. add plural form for first total message.

Download all attachments as: .zip

Change History (36)

@johnjamesjacoby
4 years ago

"All Done!", while a hilariously simple response, could also include a nice summary of events

@danhgilmore
4 years ago

Added "Upgrading sites X - Y of Total"

#2 @danhgilmore
4 years ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


4 years ago

#4 @karmatosed
4 years ago

  • Keywords has-ui-feedback added

I'd +1 having some indication and the current solution I think works well.

Last edited 4 years ago by karmatosed (previous) (diff)

#5 @karmatosed
4 years ago

  • Keywords commit added

This ticket was mentioned in Slack in #core-multisite by sergey. View the logs.


4 years ago

#7 @SergeyBiryukov
4 years ago

  • Keywords needs-patch added; 2nd-opinion has-patch commit removed
  • Milestone changed from Awaiting Review to 4.8

Translatable strings cannot be concatenated like that:

_e('Upgrading sites ' . $x . '-' . $n .' out of ' . $total_sites);

It should be a printf() with translator comments for placeholders.

@gma992
4 years ago

Added translatable strings via printf()

This ticket was mentioned in Slack in #forums by danhgilmore. View the logs.


4 years ago

This ticket was mentioned in Slack in #core by danhgilmore. View the logs.


3 years ago

@pcarvalho
3 years ago

Printed Messages

@pcarvalho
3 years ago

add current batch count and total, and improve messages for network upgrade

#10 @pcarvalho
3 years ago

Hi everyone, I took @gma992 patch and the other ideas to improve it:

Initial screen now says how many sites are.

During the upgrades, it shows which batch is currently being processed and the total.

Final message says it has no more sites to process ( "No more sites found." ) and the count of sites upgraded. This number is just the iterator, because if an error occurs, it wp_die(), and won't proceed anymore.

@pcarvalho
3 years ago

fixed typo and comment block. add plural form for first total message.

#11 @pcarvalho
3 years ago

  • Keywords needs-screenshots needs-patch removed

Note for the latest patch:

I didn't properly escaped echo ( $upper_bound ) , should I?

Also, would a progress bar be nice?

#12 @pcarvalho
3 years ago

  • Keywords has-screenshots has-patch ui-feedback added

This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.


3 years ago

#14 @flixos90
3 years ago

  • Milestone changed from 4.8 to Future Release

This needs more discussion on what we should do. Moving to Future Release.

#15 follow-up: @pcarvalho
3 years ago

what kind of discussion?

#16 in reply to: ↑ 15 @danhgilmore
3 years ago

Replying to pcarvalho:

what kind of discussion?

As per this convo: https://wordpress.slack.com/archives/C03BVB47S/p1494263980497879

#17 follow-up: @spacedmonkey
3 years ago

I would recommend the following.

  • Add a new upgrade rest endpoint to core.
  • Add a jQueryUI Progress bar to this page.
  • Use the sites end point to get a list of sites on network, paginated.
  • Go through each site on network, one by one, making ajax calls to each site's upgrade endpoint.

There will be performance issues with this on larger network, but it is a solvable problem.

Related: #40365

#18 @DrewAPicture
3 years ago

  • Owner set to pcarvalho
  • Status changed from new to assigned

Assigning ownership to mark the good-first-bug as "claimed".

This ticket was mentioned in Slack in #core-multisite by stevenkword. View the logs.


3 years ago

#20 in reply to: ↑ 17 @stevenkword
3 years ago

Replying to spacedmonkey:

  • Add a jQueryUI Progress bar to this page.

I like this idea (thinking of the Regenerate Thumbnails plugin).

Looks like 'jquery-ui-progressbar' in bundled in core: https://developer.wordpress.org/reference/functions/wp_enqueue_script/

Last edited 3 years ago by stevenkword (previous) (diff)

#21 @stevenkword
3 years ago

37799.4.diff still applies cleanly against trunk as of July 10, 2017.

#22 @earnjam
3 years ago

  • Keywords has-ui-feedback removed

I like @spacedmonkey suggestions, but I think that will obviously require some additional coordination, especially if we are to create and use a new REST API endpoint.

I think 37799.4.diff can serve as a good interim step while we work toward a total revamp of this process. As far as that particular patch, I don't think it would have any noticeable effect on performance. While it adds a call to get_blog_count() on each load, that's a cached network option and should only updated 2x a day or whenever new sites are added/removed.

I'd prefer the current message "All done!" instead of "No more sites found." upon completion though.

#23 @pcarvalho
3 years ago

Hi @earnjam,

just a point on the "all done": i've changed to improve the task report (as per the comment #1 ), and also, because that screen is reached when there's no sites to update.

So, "all done!" doesn't represent the fact that there wasn't anything done.

Instead, maybe "No more sites found." can be improved? "No sites need to be updated" ?

p.

#24 @earnjam
3 years ago

The main problem I see with using the value of get_blog_count() for this is it that returns the total count of all sites on the current network regardless of status, but the upgrade process skips any sites that are spammed, deactivated or archived. So it's not really accurate as to the total number of sites that will be upgraded. This is especially true on larger networks that have big numbers of those. For instance we have a network here with ~14,000 sites, of which several thousand are deactivated.

I think the most logical end message would be something like:

All done!
50 sites were upgraded.
10 sites were skipped.

This would keep the simple notice that the process is complete, while also adding some statistics about what just occurred. We know how many sites were actually upgraded because it's just the value of $n + count($site_ids) on the final screen. We'd only need to query for how many sites were skipped once on the completion screen.

This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.


3 years ago

#26 @flixos90
3 years ago

  • Keywords good-first-bug removed

Given the complexity and lack of decision (see discussion) of this, it's clear not a good-first-bug, so let's remove the keyword.

This ticket was mentioned in Slack in #design by boemedia. View the logs.


2 years ago

#28 @boemedia
2 years ago

  • Focuses ui added
  • Keywords needs-design added; ui-feedback removed

We discussed this ticket today at design ticket triage and we think this ticket can benefit from a pair of loving design eyes, so added the keyword needs-design.

This ticket was mentioned in Slack in #design by estelaris. View the logs.


4 months ago

#30 @ibdz
4 months ago

  • Keywords needs-design removed

We discussed in design triage today and agreed to add improved messages for network upgrade, using the same pattern of update-core.php that shows the process/results in text format.

So, removed the keyword needs-design.

Note: See TracTickets for help on using tickets.