Changeset 42343 for trunk/src/wp-admin/maint/repair.php
- Timestamp:
- 11/30/2017 11:09:33 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/maint/repair.php
r42205 r42343 6 6 * @subpackage Database 7 7 */ 8 define( 'WP_REPAIRING', true);8 define( 'WP_REPAIRING', true ); 9 9 10 10 require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/wp-load.php' ); … … 69 69 echo '<p>' . sprintf( __( 'While you are editing your %1$s file, take a moment to make sure you have all 8 keys and that they are unique. You can generate these using the <a href="%2$s">WordPress.org secret key service</a>.' ), '<code>wp-config.php</code>', 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '</p>'; 70 70 } 71 72 71 } elseif ( isset( $_GET['repair'] ) ) { 73 72 … … 75 74 76 75 $optimize = 2 == $_GET['repair']; 77 $okay = true;76 $okay = true; 78 77 $problems = array(); 79 78 … … 81 80 82 81 // Sitecategories may not exist if global terms are disabled. 83 $query = $wpdb->prepare( "SHOW TABLES LIKE %s", $wpdb->esc_like( $wpdb->sitecategories ) );82 $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->sitecategories ) ); 84 83 if ( is_multisite() && ! $wpdb->get_var( $query ) ) { 85 84 unset( $tables['sitecategories'] ); … … 105 104 } else { 106 105 /* translators: 1: table name, 2: error message, */ 107 printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table…' ) 106 printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table…' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ); 108 107 109 108 $repair = $wpdb->get_row( "REPAIR TABLE $table" ); … … 116 115 /* translators: 1: table name, 2: error message, */ 117 116 echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />'; 118 $problems[ $table] = $check->Msg_text;119 $okay = false;117 $problems[ $table ] = $check->Msg_text; 118 $okay = false; 120 119 } 121 120 } … … 125 124 126 125 echo '<br /> '; 127 if ( 'Table is already up to date' == $check->Msg_text ) 126 if ( 'Table is already up to date' == $check->Msg_text ) { 128 127 /* translators: %s: table name */ 129 128 printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" ); … … 145 144 146 145 if ( $problems ) { 147 printf( '<p>' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.') . '</p>', __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' ) );146 printf( '<p>' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the <a href="%s">WordPress support forums</a> to get additional assistance.' ) . '</p>', __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' ) ); 148 147 $problem_output = ''; 149 foreach ( $problems as $table => $problem ) 148 foreach ( $problems as $table => $problem ) { 150 149 $problem_output .= "$table: $problem\n"; 150 } 151 151 echo '<p><textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( $problem_output ) . '</textarea></p>'; 152 152 } else { … … 157 157 echo '<h1 class="screen-reader-text">' . __( 'WordPress database repair' ) . '</h1>'; 158 158 159 if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] ) 159 if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] ) { 160 160 echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the “Repair Database” button. Repairing can take a while, so please be patient.' ) . '</p>'; 161 else161 } else { 162 162 echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>'; 163 } 163 164 ?> 164 165 <p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
Note: See TracChangeset
for help on using the changeset viewer.