WordPress.org

Make WordPress Core

Opened 22 months ago

Last modified 4 weeks 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 needs-design
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 22 months ago.
"All Done!", while a hilariously simple response, could also include a nice summary of events
37799.diff (1.5 KB) - added by danhgilmore 22 months ago.
Added "Upgrading sites X - Y of Total"
37799.1.diff (1.2 KB) - added by gma992 17 months ago.
Added translatable strings via printf()
37799.2.diff.png (46.1 KB) - added by pcarvalho 14 months ago.
Printed Messages
37799.2.diff (2.6 KB) - added by pcarvalho 14 months ago.
add current batch count and total, and improve messages for network upgrade
37799.4.diff (2.6 KB) - added by pcarvalho 14 months ago.
fixed typo and comment block. add plural form for first total message.

Download all attachments as: .zip

Change History (34)

@johnjamesjacoby
22 months ago

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

@danhgilmore
22 months ago

Added "Upgrading sites X - Y of Total"

#2 @danhgilmore
22 months ago

  • Keywords has-patch added

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


22 months ago

#4 @karmatosed
22 months ago

  • Keywords has-ui-feedback added

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

Last edited 22 months ago by karmatosed (previous) (diff)

#5 @karmatosed
22 months ago

  • Keywords commit added

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


21 months ago

#7 @SergeyBiryukov
17 months 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
17 months ago

Added translatable strings via printf()

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


17 months ago

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


15 months ago

@pcarvalho
14 months ago

Printed Messages

@pcarvalho
14 months ago

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

#10 @pcarvalho
14 months 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
14 months ago

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

#11 @pcarvalho
14 months 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
14 months ago

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

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


14 months ago

#14 @flixos90
14 months 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
14 months ago

what kind of discussion?

#16 in reply to: ↑ 15 @danhgilmore
14 months ago

Replying to pcarvalho:

what kind of discussion?

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

#17 follow-up: @spacedmonkey
14 months 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
12 months 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.


12 months ago

#20 in reply to: ↑ 17 @stevenkword
12 months 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 12 months ago by stevenkword (previous) (diff)

#21 @stevenkword
12 months ago

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

#22 @earnjam
12 months 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
12 months 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
12 months 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.


12 months ago

#26 @flixos90
11 months 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.


4 weeks ago

#28 @boemedia
4 weeks 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.

Note: See TracTickets for help on using tickets.