Changeset 42343 for trunk/src/wp-admin/network/upgrade.php
- Timestamp:
- 11/30/2017 11:09:33 PM (8 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/network/upgrade.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/network/upgrade.php
r41200 r42343 13 13 require_once( ABSPATH . WPINC . '/http.php' ); 14 14 15 $title = __( 'Upgrade Network' );15 $title = __( 'Upgrade Network' ); 16 16 $parent_file = 'upgrade.php'; 17 17 18 get_current_screen()->add_help_tab( array( 19 'id' => 'overview', 20 'title' => __('Overview'), 21 'content' => 22 '<p>' . __('Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Upgrade Network button will step through each site in the network, five at a time, and make sure any database updates are applied.') . '</p>' . 23 '<p>' . __('If a version update to core has not happened, clicking this button won’t affect anything.') . '</p>' . 24 '<p>' . __('If this process fails for any reason, users logging in to their sites will force the same update.') . '</p>' 25 ) ); 18 get_current_screen()->add_help_tab( 19 array( 20 'id' => 'overview', 21 'title' => __( 'Overview' ), 22 'content' => 23 '<p>' . __( 'Only use this screen once you have updated to a new version of WordPress through Updates/Available Updates (via the Network Administration navigation menu or the Toolbar). Clicking the Upgrade Network button will step through each site in the network, five at a time, and make sure any database updates are applied.' ) . '</p>' . 24 '<p>' . __( 'If a version update to core has not happened, clicking this button won’t affect anything.' ) . '</p>' . 25 '<p>' . __( 'If this process fails for any reason, users logging in to their sites will force the same update.' ) . '</p>', 26 ) 27 ); 26 28 27 29 get_current_screen()->set_help_sidebar( 28 '<p><strong>' . __( 'For more information:') . '</strong></p>' .29 '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Updates_Screen">Documentation on Upgrade Network</a>') . '</p>' .30 '<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'30 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 31 '<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Updates_Screen">Documentation on Upgrade Network</a>' ) . '</p>' . 32 '<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>' 31 33 ); 32 34 … … 40 42 echo '<h1>' . __( 'Upgrade Network' ) . '</h1>'; 41 43 42 $action = isset( $_GET['action']) ? $_GET['action'] : 'show';44 $action = isset( $_GET['action'] ) ? $_GET['action'] : 'show'; 43 45 44 46 switch ( $action ) { 45 case "upgrade":46 $n = ( isset( $_GET['n']) ) ? intval($_GET['n']) : 0;47 case 'upgrade': 48 $n = ( isset( $_GET['n'] ) ) ? intval( $_GET['n'] ) : 0; 47 49 48 50 if ( $n < 5 ) { … … 54 56 } 55 57 56 $site_ids = get_sites( array( 57 'spam' => 0, 58 'deleted' => 0, 59 'archived' => 0, 60 'network_id' => get_current_network_id(), 61 'number' => 5, 62 'offset' => $n, 63 'fields' => 'ids', 64 'order' => 'DESC', 65 'orderby' => 'id', 66 ) ); 58 $site_ids = get_sites( 59 array( 60 'spam' => 0, 61 'deleted' => 0, 62 'archived' => 0, 63 'network_id' => get_current_network_id(), 64 'number' => 5, 65 'offset' => $n, 66 'fields' => 'ids', 67 'order' => 'DESC', 68 'orderby' => 'id', 69 ) 70 ); 67 71 if ( empty( $site_ids ) ) { 68 72 echo '<p>' . __( 'All done!' ) . '</p>'; 69 73 break; 70 74 } 71 echo "<ul>";75 echo '<ul>'; 72 76 foreach ( (array) $site_ids as $site_id ) { 73 77 switch_to_blog( $site_id ); 74 $siteurl = site_url();78 $siteurl = site_url(); 75 79 $upgrade_url = admin_url( 'upgrade.php?step=upgrade_db' ); 76 80 restore_current_blog(); … … 78 82 echo "<li>$siteurl</li>"; 79 83 80 $response = wp_remote_get( $upgrade_url, array( 81 'timeout' => 120, 82 'httpversion' => '1.1', 83 'sslverify' => false, 84 ) ); 84 $response = wp_remote_get( 85 $upgrade_url, array( 86 'timeout' => 120, 87 'httpversion' => '1.1', 88 'sslverify' => false, 89 ) 90 ); 85 91 if ( is_wp_error( $response ) ) { 86 wp_die( sprintf( 87 /* translators: 1: site url, 2: server error message */ 88 __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s' ), 89 $siteurl, 90 '<em>' . $response->get_error_message() . '</em>' 91 ) ); 92 wp_die( 93 sprintf( 94 /* translators: 1: site url, 2: server error message */ 95 __( 'Warning! Problem updating %1$s. Your server may not be able to connect to sites running on it. Error message: %2$s' ), 96 $siteurl, 97 '<em>' . $response->get_error_message() . '</em>' 98 ) 99 ); 92 100 } 93 101 … … 109 117 do_action( 'wpmu_upgrade_site', $site_id ); 110 118 } 111 echo "</ul>";112 ?><p><?php _e( 'If your browser doesn’t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ( $n + 5) ?>"><?php _e("Next Sites"); ?></a></p>119 echo '</ul>'; 120 ?><p><?php _e( 'If your browser doesn’t start loading the next page automatically, click this link:' ); ?> <a class="button" href="upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>"><?php _e( 'Next Sites' ); ?></a></p> 113 121 <script type="text/javascript"> 114 122 <!-- 115 123 function nextpage() { 116 location.href = "upgrade.php?action=upgrade&n=<?php echo ( $n + 5)?>";124 location.href = "upgrade.php?action=upgrade&n=<?php echo ( $n + 5 ); ?>"; 117 125 } 118 126 setTimeout( "nextpage()", 250 ); 119 127 //--> 120 </script><?php 121 break; 128 </script> 129 <?php 130 break; 122 131 case 'show': 123 132 default: … … 137 146 */ 138 147 do_action( 'wpmu_upgrade_page' ); 139 break;148 break; 140 149 } 141 150 ?>
Note: See TracChangeset
for help on using the changeset viewer.