wp/wp-admin/maint/repair.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
equal deleted inserted replaced
17:34716fd837a4 18:be944660c56a
   104 			printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table&hellip;' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
   104 			printf( __( 'The %1$s table is not okay. It is reporting the following error: %2$s. WordPress will attempt to repair this table&hellip;' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
   105 
   105 
   106 			$repair = $wpdb->get_row( "REPAIR TABLE $table" );
   106 			$repair = $wpdb->get_row( "REPAIR TABLE $table" );
   107 
   107 
   108 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
   108 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
   109 			if ( 'OK' === $check->Msg_text ) {
   109 			if ( 'OK' === $repair->Msg_text ) {
   110 				/* translators: %s: Table name. */
   110 				/* translators: %s: Table name. */
   111 				printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
   111 				printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
   112 			} else {
   112 			} else {
   113 				/* translators: 1: Table name, 2: Error message. */
   113 				/* translators: 1: Table name, 2: Error message. */
   114 				printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
   114 				printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$repair->Msg_text</code>" ) . '<br />';
   115 				$problems[ $table ] = $check->Msg_text;
   115 				$problems[ $table ] = $repair->Msg_text;
   116 				$okay               = false;
   116 				$okay               = false;
   117 			}
   117 			}
   118 		}
   118 		}
   119 
   119 
   120 		if ( $okay && $optimize ) {
   120 		if ( $okay && $optimize ) {
   121 			$check = $wpdb->get_row( "ANALYZE TABLE $table" );
   121 			$analyze = $wpdb->get_row( "ANALYZE TABLE $table" );
   122 
   122 
   123 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
   123 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
   124 			if ( 'Table is already up to date' === $check->Msg_text ) {
   124 			if ( 'Table is already up to date' === $analyze->Msg_text ) {
   125 				/* translators: %s: Table name. */
   125 				/* translators: %s: Table name. */
   126 				printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
   126 				printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
   127 			} else {
   127 			} else {
   128 				$check = $wpdb->get_row( "OPTIMIZE TABLE $table" );
   128 				$optimize = $wpdb->get_row( "OPTIMIZE TABLE $table" );
   129 
   129 
   130 				echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
   130 				echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
   131 				if ( 'OK' === $check->Msg_text || 'Table is already up to date' === $check->Msg_text ) {
   131 				if ( 'OK' === $optimize->Msg_text || 'Table is already up to date' === $optimize->Msg_text ) {
   132 					/* translators: %s: Table name. */
   132 					/* translators: %s: Table name. */
   133 					printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
   133 					printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
   134 				} else {
   134 				} else {
   135 					/* translators: 1: Table name. 2: Error message. */
   135 					/* translators: 1: Table name. 2: Error message. */
   136 					printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
   136 					printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$optimize->Msg_text</code>" );
   137 				}
   137 				}
   138 			}
   138 			}
   139 		}
   139 		}
   140 		echo '</p>';
   140 		echo '</p>';
   141 	}
   141 	}