diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/maint/repair.php --- 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' ); ?> -> +> @@ -63,7 +63,7 @@ echo '

' . __( 'Check secret keys' ) . '

'; - /* translators: 1: wp-config.php, 2: secret key service URL */ + /* translators: 1: wp-config.php, 2: Secret key service URL. */ echo '

' . 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 WordPress.org secret key service.' ), 'wp-config.php', 'https://api.wordpress.org/secret-key/1.1/salt/' ) . '

'; } } elseif ( isset( $_GET['repair'] ) ) { @@ -96,22 +96,22 @@ $check = $wpdb->get_row( "CHECK TABLE $table" ); echo '

'; - if ( 'OK' == $check->Msg_text ) { - /* translators: %s: table name */ + if ( 'OK' === $check->Msg_text ) { + /* translators: %s: Table name. */ printf( __( 'The %s table is okay.' ), "$table" ); } 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…' ), "$table", "$check->Msg_text" ); $repair = $wpdb->get_row( "REPAIR TABLE $table" ); echo '
    '; - if ( 'OK' == $check->Msg_text ) { - /* translators: %s: table name */ + if ( 'OK' === $check->Msg_text ) { + /* translators: %s: Table name. */ printf( __( 'Successfully repaired the %s table.' ), "$table" ); } else { - /* translators: 1: table name, 2: error message, */ - echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "$table", "$check->Msg_text" ) . '
'; + /* translators: 1: Table name, 2: Error message. */ + printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "$table", "$check->Msg_text" ) . '
'; $problems[ $table ] = $check->Msg_text; $okay = false; } @@ -121,18 +121,18 @@ $check = $wpdb->get_row( "ANALYZE TABLE $table" ); echo '
    '; - 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.' ), "$table" ); } else { $check = $wpdb->get_row( "OPTIMIZE TABLE $table" ); echo '
    '; - 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.' ), "$table" ); } 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' ), "$table", "$check->Msg_text" ); } } @@ -141,7 +141,11 @@ } if ( $problems ) { - printf( '

' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the WordPress support forums to get additional assistance.' ) . '

', __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' ) ); + printf( + /* translators: %s: URL to "Fixing WordPress" forum. */ + '

' . __( 'Some database problems could not be repaired. Please copy-and-paste the following list of errors to the WordPress support forums to get additional assistance.' ) . '

', + __( '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 '

' . __( 'WordPress database repair' ) . '

'; - if ( isset( $_GET['referrer'] ) && 'is_blog_installed' == $_GET['referrer'] ) { + if ( isset( $_GET['referrer'] ) && 'is_blog_installed' === $_GET['referrer'] ) { echo '

' . __( '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.' ) . '

'; } else { echo '

' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '

';