wp/wp-admin/maint/repair.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-admin/maint/repair.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-admin/maint/repair.php	Tue Dec 15 13:49:49 2020 +0100
@@ -7,12 +7,12 @@
  */
 define( 'WP_REPAIRING', true );
 
-require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/wp-load.php' );
+require_once dirname( dirname( __DIR__ ) ) . '/wp-load.php';
 
 header( 'Content-Type: text/html; charset=utf-8' );
 ?>
 <!DOCTYPE html>
-<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
+<html <?php language_attributes(); ?>>
 <head>
 	<meta name="viewport" content="width=device-width" />
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@@ -63,7 +63,7 @@
 
 		echo '<h2 class="screen-reader-text">' . __( 'Check secret keys' ) . '</h2>';
 
-		/* translators: 1: wp-config.php, 2: secret key service URL */
+		/* translators: 1: wp-config.php, 2: Secret key service URL. */
 		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>';
 	}
 } elseif ( isset( $_GET['repair'] ) ) {
@@ -96,22 +96,22 @@
 		$check = $wpdb->get_row( "CHECK TABLE $table" );
 
 		echo '<p>';
-		if ( 'OK' == $check->Msg_text ) {
-			/* translators: %s: table name */
+		if ( 'OK' === $check->Msg_text ) {
+			/* translators: %s: Table name. */
 			printf( __( 'The %s table is okay.' ), "<code>$table</code>" );
 		} else {
-			/* translators: 1: table name, 2: error message, */
+			/* translators: 1: Table name, 2: Error message. */
 			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>" );
 
 			$repair = $wpdb->get_row( "REPAIR TABLE $table" );
 
 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
-			if ( 'OK' == $check->Msg_text ) {
-				/* translators: %s: table name */
+			if ( 'OK' === $check->Msg_text ) {
+				/* translators: %s: Table name. */
 				printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
 			} else {
-				/* translators: 1: table name, 2: error message, */
-				echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
+				/* translators: 1: Table name, 2: Error message. */
+				printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
 				$problems[ $table ] = $check->Msg_text;
 				$okay               = false;
 			}
@@ -121,18 +121,18 @@
 			$check = $wpdb->get_row( "ANALYZE TABLE $table" );
 
 			echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
-			if ( 'Table is already up to date' == $check->Msg_text ) {
-				/* translators: %s: table name */
+			if ( 'Table is already up to date' === $check->Msg_text ) {
+				/* translators: %s: Table name. */
 				printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
 			} else {
 				$check = $wpdb->get_row( "OPTIMIZE TABLE $table" );
 
 				echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
-				if ( 'OK' == $check->Msg_text || 'Table is already up to date' == $check->Msg_text ) {
-					/* translators: %s: table name */
+				if ( 'OK' === $check->Msg_text || 'Table is already up to date' === $check->Msg_text ) {
+					/* translators: %s: Table name. */
 					printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
 				} else {
-					/* translators: 1: table name, 2: error message, */
+					/* translators: 1: Table name. 2: Error message. */
 					printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" );
 				}
 			}
@@ -141,7 +141,11 @@
 	}
 
 	if ( $problems ) {
-		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' ) );
+		printf(
+			/* translators: %s: URL to "Fixing WordPress" forum. */
+			'<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' )
+		);
 		$problem_output = '';
 		foreach ( $problems as $table => $problem ) {
 			$problem_output .= "$table: $problem\n";
@@ -154,7 +158,7 @@
 
 	echo '<h1 class="screen-reader-text">' . __( 'WordPress database repair' ) . '</h1>';
 
-	if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] ) {
+	if ( isset( $_GET['referrer'] ) && 'is_blog_installed' === $_GET['referrer'] ) {
 		echo '<p>' . __( 'One or more database tables are unavailable. To allow WordPress to attempt to repair these tables, press the &#8220;Repair Database&#8221; button. Repairing can take a while, so please be patient.' ) . '</p>';
 	} else {
 		echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';