Index: wp-admin/network/upgrade.php
===================================================================
--- wp-admin/network/upgrade.php	(revision 40416)
+++ wp-admin/network/upgrade.php	(working copy)
@@ -41,6 +41,8 @@
 
 $action = isset($_GET['action']) ? $_GET['action'] : 'show';
 
+$total_sites = get_blog_count();
+
 switch ( $action ) {
 	case "upgrade":
 		$n = ( isset($_GET['n']) ) ? intval($_GET['n']) : 0;
@@ -65,9 +67,12 @@
 			'orderby'    => 'id',
 		) );
 		if ( empty( $site_ids ) ) {
-			echo '<p>' . __( 'All done!' ) . '</p>';
+			echo '<p>' . esc_html__( 'No more sites found.' ) . '</p>';
+			// If a site fails to be upgraded, the script will just stop, so the $n has always the total so far
+			echo '<p>' . esc_html( sprintf( _n( '%1$s site have been upgraded.', '%1$s sites have been upgraded.', $n ), $n ) ) . '</p>';
 			break;
 		}
+
 		echo "<ul>";
 		foreach ( (array) $site_ids as $site_id ) {
 			switch_to_blog( $site_id );
@@ -90,7 +95,6 @@
 					'<em>' . $response->get_error_message() . '</em>'
 				) );
 			}
-
 			/**
 			 * Fires after the Multisite DB upgrade for each site is complete.
 			 *
@@ -109,11 +113,22 @@
 			do_action( 'wpmu_upgrade_site', $site_id );
 		}
 		echo "</ul>";
-		?><p><?php _e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&amp;n=<?php echo ($n + 5) ?>"><?php _e("Next Sites"); ?></a></p>
+
+		$top_boundery = $n + 5;
+		if ( $total_sites < $top_boundery ) {
+			$top_boundery = $total_sites;
+		}
+		$lower_boundery = $n + 1;
+
+		?>
+		<p><?php echo esc_html( sprintf( __( 'Upgrading sites %1$d-%2$d out of %3$d' ),$lower_boundery , $top_boundery , $total_sites ) ); ?></p>
+		<p><?php esc_html_e( 'If your browser doesn&#8217;t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&amp;n=<?php echo ( $top_boundery ) ?>"><?php esc_html_e( 'Next Sites' ); ?></a></p>
+
+
 		<script type="text/javascript">
 		<!--
 		function nextpage() {
-			location.href = "upgrade.php?action=upgrade&n=<?php echo ($n + 5) ?>";
+			location.href = "upgrade.php?action=upgrade&n=<?php echo ( $top_boundery ) ?>";
 		}
 		setTimeout( "nextpage()", 250 );
 		//-->
@@ -128,6 +143,7 @@
 		<?php endif; ?>
 
 		<p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>
+		<p><?php echo esc_html( sprintf( __( 'There are %1$s sites.' ), $total_sites ) ); ?></p>
 		<p><a class="button button-primary" href="upgrade.php?action=upgrade"><?php _e( 'Upgrade Network' ); ?></a></p>
 		<?php
 		/**
