Changeset 12092 for trunk/wp-admin/maint/repair.php
- Timestamp:
- 10/22/2009 08:23:19 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/maint/repair.php
r11902 r12092 25 25 check_admin_referer('repair_db'); 26 26 27 if ( 2 == $_GET['repair'] ) 28 $optimize = true; 29 else 30 $optimize = false; 31 32 $okay = true; 33 27 34 // Loop over the WP tables, checking and repairing as needed. 28 35 foreach ($wpdb->tables as $table) { … … 32 39 $check = $wpdb->get_row("CHECK TABLE {$wpdb->prefix}$table"); 33 40 if ( 'OK' == $check->Msg_text ) { 34 echo "<p>The {$wpdb->prefix}$table table is okay. </p>";41 echo "<p>The {$wpdb->prefix}$table table is okay."; 35 42 } else { 36 echo "<p>The {$wpdb->prefix}$table table is not okay. It is reporting the following error: <code>$check->Msg_text</code>. WordPress will attempt to repair this table… <br/>";43 echo "<p>The {$wpdb->prefix}$table table is not okay. It is reporting the following error: <code>$check->Msg_text</code>. WordPress will attempt to repair this table…"; 37 44 $repair = $wpdb->get_row("REPAIR TABLE {$wpb->prefix}$table"); 38 45 if ( 'OK' == $check->Msg_text ) { 39 echo " Sucessfully repaired the {$wpb->prefix}$table table.<br />";46 echo "<br /> Sucessfully repaired the {$wpb->prefix}$table table."; 40 47 } else { 41 echo " Failed to repair the {$wpdb->prefix}$table table. Error: $check->Msg_text<br />";48 echo "<br /> Failed to repair the {$wpdb->prefix}$table table. Error: $check->Msg_text<br />"; 42 49 $problems["{$wpdb->prefix}$table"] = $check->Msg_text; 50 $okay = false; 43 51 } 44 52 } 53 if ( $okay && $optimize ) { 54 $check = $wpdb->get_row("ANALYZE TABLE {$wpdb->prefix}$table"); 55 if ( 'Table is already up to date' == $check->Msg_text ) { 56 echo "<br /> The {$wpb->prefix}$table table is already optimized."; 57 } else { 58 $check = $wpdb->get_row("OPTIMIZE TABLE {$wpdb->prefix}$table"); 59 if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text ) 60 echo "<br /> Sucessfully optimized the {$wpb->prefix}$table table."; 61 else 62 echo "<br /> Failed to optimize the {$wpdb->prefix}$table table. Error: $check->Msg_text"; 63 } 64 } 65 echo '</p>'; 45 66 } 46 67 … … 61 82 ?> 62 83 <p class="step"><a class="button" href="<?php echo wp_nonce_url('repair.php?repair=1', 'repair_db') ?>"><?php _e( 'Repair Database' ); ?></a></p> 84 <?php _e('WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.'); ?> 85 <p class="step"><a class="button" href="<?php echo wp_nonce_url('repair.php?repair=2', 'repair_db') ?>"><?php _e( 'Repair and Optimize Database' ); ?></a></p> 63 86 <?php 64 87 } 65 66 88 ?> 67 89 </body>
Note: See TracChangeset
for help on using the changeset viewer.