Make WordPress Core

Changeset 49750


Ignore:
Timestamp:
12/04/2020 03:48:15 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Database: Check the correct value for displaying the "Successfully repaired table" or "Failed to repair" messages on Database Repair screen.

Additionally, rename the variables holding the results of ANALYZE TABLE and OPTIMIZE TABLE requests, for clarity.

Props mehrshaddarzi.
Fixes #51932.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/maint/repair.php

    r48126 r49750  
    107107
    108108            echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
    109             if ( 'OK' === $check->Msg_text ) {
     109            if ( 'OK' === $repair->Msg_text ) {
    110110                /* translators: %s: Table name. */
    111111                printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
    112112            } else {
    113113                /* 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 />';
    115                 $problems[ $table ] = $check->Msg_text;
     114                printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$repair->Msg_text</code>" ) . '<br />';
     115                $problems[ $table ] = $repair->Msg_text;
    116116                $okay               = false;
    117117            }
     
    119119
    120120        if ( $okay && $optimize ) {
    121             $check = $wpdb->get_row( "ANALYZE TABLE $table" );
     121            $analyze = $wpdb->get_row( "ANALYZE TABLE $table" );
    122122
    123123            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 ) {
    125125                /* translators: %s: Table name. */
    126126                printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
    127127            } else {
    128                 $check = $wpdb->get_row( "OPTIMIZE TABLE $table" );
     128                $optimize = $wpdb->get_row( "OPTIMIZE TABLE $table" );
    129129
    130130                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 ) {
    132132                    /* translators: %s: Table name. */
    133133                    printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
    134134                } else {
    135135                    /* 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>" );
    137137                }
    138138            }
Note: See TracChangeset for help on using the changeset viewer.