diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/maint/repair.php --- a/wp/wp-admin/maint/repair.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/maint/repair.php Fri Sep 05 18:40:08 2025 +0200 @@ -7,7 +7,7 @@ */ define( 'WP_REPAIRING', true ); -require_once dirname( dirname( __DIR__ ) ) . '/wp-load.php'; +require_once dirname( __DIR__, 2 ) . '/wp-load.php'; header( 'Content-Type: text/html; charset=utf-8' ); ?> @@ -27,7 +27,10 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) { - echo '

' . __( 'Allow automatic database repair' ) . '

'; + echo '

' . + /* translators: Hidden accessibility text. */ + __( 'Allow automatic database repair' ) . + '

'; echo '

'; printf( @@ -37,7 +40,17 @@ ); echo "

define('WP_ALLOW_REPAIR', true);

"; - $default_key = 'put your unique phrase here'; + $default_keys = array_unique( + array( + 'put your unique phrase here', + /* + * translators: This string should only be translated if wp-config-sample.php is localized. + * You can check the localized release package or + * https://i18n.svn.wordpress.org//branches//dist/wp-config-sample.php + */ + __( 'put your unique phrase here' ), + ) + ); $missing_key = false; $duplicated_keys = array(); @@ -51,9 +64,11 @@ } } - // If at least one key uses the default value, consider it duplicated. - if ( isset( $duplicated_keys[ $default_key ] ) ) { - $duplicated_keys[ $default_key ] = true; + // If at least one key uses a default value, consider it duplicated. + foreach ( $default_keys as $default_key ) { + if ( isset( $duplicated_keys[ $default_key ] ) ) { + $duplicated_keys[ $default_key ] = true; + } } // Weed out all unique, non-default values. @@ -61,27 +76,27 @@ if ( $duplicated_keys || $missing_key ) { - echo '

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

'; + echo '

' . + /* translators: Hidden accessibility text. */ + __( 'Check secret keys' ) . + '

'; /* 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'] ) ) { - echo '

' . __( 'Database repair results' ) . '

'; + echo '

' . + /* translators: Hidden accessibility text. */ + __( 'Database repair results' ) . + '

'; - $optimize = 2 == $_GET['repair']; + $optimize = '2' === $_GET['repair']; $okay = true; $problems = array(); $tables = $wpdb->tables(); - // Sitecategories may not exist if global terms are disabled. - $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->sitecategories ) ); - if ( is_multisite() && ! $wpdb->get_var( $query ) ) { - unset( $tables['sitecategories'] ); - } - /** * Filters additional database tables to repair. * @@ -156,7 +171,10 @@ } } else { - echo '

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

'; + echo '

' . + /* translators: Hidden accessibility text. */ + __( 'WordPress database repair' ) . + '

'; 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.' ) . '

';