/data/db/base/13395/2612_vm">2612_vm a4345e5759 first commit 4 年之前 2613 a4345e5759 first commit 4 年之前 2615 a4345e5759 first commit 4 年之前 2615_fsm a4345e5759 first commit 4 年之前 2615_vm a4345e5759 first commit 4 年之前 2616 a4345e5759 first commit 4 年之前 2616_fsm a4345e5759 first commit 4 年之前 2616_vm a4345e5759 first commit 4 年之前 2617 a4345e5759 first commit 4 年之前 2617_fsm a4345e5759 first commit 4 年之前 2617_vm a4345e5759 first commit 4 年之前 2618 a4345e5759 first commit 4 年之前 2618_fsm a4345e5759 first commit 4 年之前 2618_vm a4345e5759 first commit 4 年之前 2619 a4345e5759 first commit 4 年之前 2619_fsm a4345e5759 first commit 4 年之前 2619_vm a4345e5759 first commit 4 年之前 2620 a4345e5759 first commit 4 年之前 2620_fsm a4345e5759 first commit 4 年之前 2650 a4345e5759 first commit 4 年之前 2651 a4345e5759 first commit 4 年之前 2652 a4345e5759 first commit 4 年之前 2653 a4345e5759 first commit 4 年之前 2654 a4345e5759 first commit 4 年之前 2655 a4345e5759 first commit 4 年之前 2656 a4345e5759 first commit 4 年之前 2657 a4345e5759 first commit 4 年之前 2658 a4345e5759 first commit 4 年之前 2659 a4345e5759 first commit 4 年之前 2660 a4345e5759 first commit 4 年之前 2661 a4345e5759 first commit 4 年之前 2662 a4345e5759 first commit 4 年之前 2663 a4345e5759 first commit 4 年之前 2664 a4345e5759 first commit 4 年之前 2665 a4345e5759 first commit 4 年之前 2666 a4345e5759 first commit 4 年之前 2667 a4345e5759 first commit 4 年之前 2668 a4345e5759 first commit 4 年之前 2669 a4345e5759 first commit 4 年之前 2670 a4345e5759 first commit 4 年之前 2673 a4345e5759 first commit 4 年之前 2674 a4345e5759 first commit 4 年之前 2675 a4345e5759 first commit 4 年之前 2678 a4345e5759 first commit 4 年之前 2679 a4345e5759 first commit 4 年之前 2680 a4345e5759 first commit 4 年之前 2681 a4345e5759 first commit 4 年之前 2682 a4345e5759 first commit 4 年之前 2683 a4345e5759 first commit 4 年之前 2684 a4345e5759 first commit 4 年之前 2685 a4345e5759 first commit 4 年之前 2686 a4345e5759 first commit 4 年之前 2687 a4345e5759 first commit 4 年之前 2688 a4345e5759 first commit 4 年之前 2689 a4345e5759 first commit 4 年之前 2690 a4345e5759 first commit 4 年之前 2691 a4345e5759 first commit 4 年之前 2692 a4345e5759 first commit 4 年之前 2693 a4345e5759 first commit 4 年之前 2696 a4345e5759 first commit 4 年之前 2699 a4345e5759 first commit 4 年之前 2701 a4345e5759 first commit 4 年之前 2702 a4345e5759 first commit 4 年之前 2703 a4345e5759 first commit 4 年之前 2704 a4345e5759 first commit 4 年之前 2753 a4345e5759 first commit 4 年之前 2753_fsm a4345e5759 first commit 4 年之前 2753_vm a4345e5759 first commit 4 年之前 2754 a4345e5759 first commit 4 年之前 2755 a4345e5759 first commit 4 年之前 2756 a4345e5759 first commit 4 年之前 2757 a4345e5759 first commit 4 年之前 2830 a4345e5759 first commit 4 年之前 2831 a4345e5759 first commit 4 年之前 2832 a4345e5759 first commit 4 年之前 2833 a4345e5759 first commit 4 年之前 2834 a4345e5759 first commit 4 年之前 2835 a4345e5759 first commit 4 年之前 2836 a4345e5759 first commit 4 年之前 2837 a4345e5759 first commit 4 年之前 2838 a4345e5759 first commit 4 年之前 2838_fsm a4345e5759 first commit 4 年之前 2838_vm a4345e5759 first commit 4 年之前 2839 a4345e5759 first commit 4 年之前 2840 a4345e5759 first commit 4 年之前 2840_fsm a4345e5759 first commit 4 年之前 2840_vm a4345e5759 first commit 4 年之前 2841 a4345e5759 first commit 4 年之前 2995 a4345e5759 first commit 4 年之前 2996 a4345e5759 first commit 4 年之前 3079 a4345e5759 first commit 4 年之前 3079_fsm a4345e5759 first commit 4 年之前 3079_vm a4345e5759 first commit 4 年之前 3080 a4345e5759 first commit 4 年之前 3081 a4345e5759 first commit 4 年之前 3085 a4345e5759 first commit 4 年之前 3118 a4345e5759 first commit 4 年之前 3119 a4345e5759 first commit 4 年之前 3164 a4345e5759 first commit 4 年之前 3256 a4345e5759 first commit 4 年之前 3257 a4345e5759 first commit 4 年之前 3258 a4345e5759 first commit 4 年之前 3350 a4345e5759 first commit 4 年之前 3351 a4345e5759 first commit 4 年之前 3379 a4345e5759 first commit 4 年之前 3380 a4345e5759 first commit 4 年之前 3381 a4345e5759 first commit 4 年之前 3394 a4345e5759 first commit 4 年之前 3394_fsm a4345e5759 first commit 4 年之前 3394_vm a4345e5759 first commit 4 年之前 3395 a4345e5759 first commit 4 年之前 3429 a4345e5759 first commit 4 年之前 3430 a4345e5759 first commit 4 年之前 3431 a4345e5759 first commit 4 年之前 3433 a4345e5759 first commit 4 年之前 3439 a4345e5759 first commit 4 年之前 3440 a4345e5759 first commit 4 年之前 3455 a4345e5759 first commit 4 年之前 3456 a4345e5759 first commit 4 年之前 3456_fsm a4345e5759 first commit 4 年之前 3456_vm a4345e5759 first commit 4 年之前 3466 a4345e5759 first commit 4 年之前 3467 a4345e5759 first commit 4 年之前 3468 a4345e5759 first commit 4 年之前 3501 a4345e5759 first commit 4 年之前 3502 a4345e5759 first commit 4 年之前 3503 a4345e5759 first commit 4 年之前 3534 a4345e5759 first commit 4 年之前 3541 a4345e5759 first commit 4 年之前 3541_fsm a4345e5759 first commit 4 年之前 3541_vm a4345e5759 first commit 4 年之前 3542 a4345e5759 first commit 4 年之前 3574 a4345e5759 first commit 4 年之前 3575 a4345e5759 first commit 4 年之前 3576 a4345e5759 first commit 4 年之前 3596 a4345e5759 first commit 4 年之前 3597 a4345e5759 first commit 4 年之前 3598 a4345e5759 first commit 4 年之前 3599 a4345e5759 first commit 4 年之前 3600 a4345e5759 first commit 4 年之前 3600_fsm a4345e5759 first commit 4 年之前 3600_vm a4345e5759 first commit 4 年之前 3601 a4345e5759 first commit 4 年之前 3601_fsm a4345e5759 first commit 4 年之前 3601_vm a4345e5759 first commit 4 年之前 3602 a4345e5759 first commit 4 年之前 3602_fsm a4345e5759 first commit 4 年之前 3602_vm a4345e5759 first commit 4 年之前 3603 a4345e5759 first commit 4 年之前 3603_fsm a4345e5759 first commit 4 年之前 3603_vm a4345e5759 first commit 4 年之前 3604 a4345e5759 first commit 4 年之前 3605 a4345e5759 first commit 4 年之前 3606 a4345e5759 first commit 4 年之前 3607 a4345e5759 first commit 4 年之前 3608 a4345e5759 first commit 4 年之前 3609 a4345e5759 first commit 4 年之前 3712 a4345e5759 first commit 4 年之前 3764 a4345e5759 first commit 4 年之前 3764_fsm a4345e5759 first commit 4 年之前 3764_vm a4345e5759 first commit 4 年之前 3766 a4345e5759 first commit 4 年之前 3767 a4345e5759 first commit 4 年之前 3997 a4345e5759 first commit 4 年之前 4143 a4345e5759 first commit 4 年之前 4144 a4345e5759 first commit 4 年之前 4145 a4345e5759 first commit 4 年之前 4146 a4345e5759 first commit 4 年之前 4147 a4345e5759 first commit 4 年之前 4148 a4345e5759 first commit 4 年之前 4149 a4345e5759 first commit 4 年之前 4150 a4345e5759 first commit 4 年之前 4151 a4345e5759 first commit 4 年之前 4152 a4345e5759 first commit 4 年之前 4153 a4345e5759 first commit 4 年之前 4154 a4345e5759 first commit 4 年之前 4155 a4345e5759 first commit 4 年之前 4156 a4345e5759 first commit 4 年之前 4157 a4345e5759 first commit 4 年之前 4158 a4345e5759 first commit 4 年之前 4159 a4345e5759 first commit 4 年之前 4160 a4345e5759 first commit 4 年之前 4161 a4345e5759 first commit 4 年之前 4162 a4345e5759 first commit 4 年之前 4163 a4345e5759 first commit 4 年之前 4164 a4345e5759 first commit 4 年之前 4165 a4345e5759 first commit 4 年之前 4166 a4345e5759 first commit 4 年之前 4167 a4345e5759 first commit 4 年之前 4168 a4345e5759 first commit 4 年之前 4169 a4345e5759 first commit 4 年之前 4170 a4345e5759 first commit 4 年之前 4171 a4345e5759 first commit 4 年之前 4172 a4345e5759 first commit 4 年之前 4173 a4345e5759 first commit 4 年之前 4174 a4345e5759 first commit 4 年之前 5002 a4345e5759 first commit 4 年之前 548 a4345e5759 first commit 4 年之前 549 a4345e5759 first commit 4 年之前 6102 a4345e5759 first commit 4 年之前 6104 a4345e5759 first commit 4 年之前 6106 a4345e5759 first commit 4 年之前 6110 a4345e5759 first commit 4 年之前 6111 a4345e5759 first commit 4 年之前 6112 a4345e5759 first commit 4 年之前 6113 a4345e5759 first commit 4 年之前 6117 a4345e5759 first commit 4 年之前 826 a4345e5759 first commit 4 年之前 827 a4345e5759 first commit 4 年之前 828 a4345e5759 first commit 4 年之前 PG_VERSION a4345e5759 first commit 4 年之前 pg_filenode.map a4345e5759 first commit 4 年之前 pg_internal.init a4345e5759 first commit 4 年之前 tum/whitesports - Gogs: Simplico Git Service

Sin descripción

repair.php 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <?php
  2. /**
  3. * Database Repair and Optimization Script.
  4. *
  5. * @package WordPress
  6. * @subpackage Database
  7. */
  8. define( 'WP_REPAIRING', true );
  9. require_once dirname( dirname( __DIR__ ) ) . '/wp-load.php';
  10. header( 'Content-Type: text/html; charset=utf-8' );
  11. ?>
  12. <!DOCTYPE html>
  13. <html <?php language_attributes(); ?>>
  14. <head>
  15. <meta name="viewport" content="width=device-width" />
  16. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  17. <meta name="robots" content="noindex,nofollow" />
  18. <title><?php _e( 'WordPress &rsaquo; Database Repair' ); ?></title>
  19. <?php wp_admin_css( 'install', true ); ?>
  20. </head>
  21. <body class="wp-core-ui">
  22. <p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>"><?php _e( 'WordPress' ); ?></a></p>
  23. <?php
  24. if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
  25. echo '<h1 class="screen-reader-text">' . __( 'Allow automatic database repair' ) . '</h1>';
  26. echo '<p>';
  27. printf(
  28. /* translators: %s: wp-config.php */
  29. __( 'To allow use of this page to automatically repair database problems, please add the following line to your %s file. Once this line is added to your config, reload this page.' ),
  30. '<code>wp-config.php</code>'
  31. );
  32. echo "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
  33. $default_key = 'put your unique phrase here';
  34. $missing_key = false;
  35. $duplicated_keys = array();
  36. foreach ( array( 'AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT' ) as $key ) {
  37. if ( defined( $key ) ) {
  38. // Check for unique values of each key.
  39. $duplicated_keys[ constant( $key ) ] = isset( $duplicated_keys[ constant( $key ) ] );
  40. } else {
  41. // If a constant is not defined, it's missing.
  42. $missing_key = true;
  43. }
  44. }
  45. // If at least one key uses the default value, consider it duplicated.
  46. if ( isset( $duplicated_keys[ $default_key ] ) ) {
  47. $duplicated_keys[ $default_key ] = true;
  48. }
  49. // Weed out all unique, non-default values.
  50. $duplicated_keys = array_filter( $duplicated_keys );
  51. if ( $duplicated_keys || $missing_key ) {
  52. echo '<h2 class="screen-reader-text">' . __( 'Check secret keys' ) . '</h2>';
  53. /* translators: 1: wp-config.php, 2: Secret key service URL. */
  54. 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>';
  55. }
  56. } elseif ( isset( $_GET['repair'] ) ) {
  57. echo '<h1 class="screen-reader-text">' . __( 'Database repair results' ) . '</h1>';
  58. $optimize = 2 == $_GET['repair'];
  59. $okay = true;
  60. $problems = array();
  61. $tables = $wpdb->tables();
  62. // Sitecategories may not exist if global terms are disabled.
  63. $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $wpdb->sitecategories ) );
  64. if ( is_multisite() && ! $wpdb->get_var( $query ) ) {
  65. unset( $tables['sitecategories'] );
  66. }
  67. /**
  68. * Filters additional database tables to repair.
  69. *
  70. * @since 3.0.0
  71. *
  72. * @param string[] $tables Array of prefixed table names to be repaired.
  73. */
  74. $tables = array_merge( $tables, (array) apply_filters( 'tables_to_repair', array() ) );
  75. // Loop over the tables, checking and repairing as needed.
  76. foreach ( $tables as $table ) {
  77. $check = $wpdb->get_row( "CHECK TABLE $table" );
  78. echo '<p>';
  79. if ( 'OK' === $check->Msg_text ) {
  80. /* translators: %s: Table name. */
  81. printf( __( 'The %s table is okay.' ), "<code>$table</code>" );
  82. } else {
  83. /* translators: 1: Table name, 2: Error message. */
  84. 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>" );
  85. $repair = $wpdb->get_row( "REPAIR TABLE $table" );
  86. echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
  87. if ( 'OK' === $repair->Msg_text ) {
  88. /* translators: %s: Table name. */
  89. printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
  90. } else {
  91. /* translators: 1: Table name, 2: Error message. */
  92. printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$repair->Msg_text</code>" ) . '<br />';
  93. $problems[ $table ] = $repair->Msg_text;
  94. $okay = false;
  95. }
  96. }
  97. if ( $okay && $optimize ) {
  98. $analyze = $wpdb->get_row( "ANALYZE TABLE $table" );
  99. echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
  100. if ( 'Table is already up to date' === $analyze->Msg_text ) {
  101. /* translators: %s: Table name. */
  102. printf( __( 'The %s table is already optimized.' ), "<code>$table</code>" );
  103. } else {
  104. $optimize = $wpdb->get_row( "OPTIMIZE TABLE $table" );
  105. echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;';
  106. if ( 'OK' === $optimize->Msg_text || 'Table is already up to date' === $optimize->Msg_text ) {
  107. /* translators: %s: Table name. */
  108. printf( __( 'Successfully optimized the %s table.' ), "<code>$table</code>" );
  109. } else {
  110. /* translators: 1: Table name. 2: Error message. */
  111. printf( __( 'Failed to optimize the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$optimize->Msg_text</code>" );
  112. }
  113. }
  114. }
  115. echo '</p>';
  116. }
  117. if ( $problems ) {
  118. printf(
  119. /* translators: %s: URL to "Fixing WordPress" forum. */
  120. '<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>',
  121. __( 'https://wordpress.org/support/forum/how-to-and-troubleshooting' )
  122. );
  123. $problem_output = '';
  124. foreach ( $problems as $table => $problem ) {
  125. $problem_output .= "$table: $problem\n";
  126. }
  127. echo '<p><textarea name="errors" id="errors" rows="20" cols="60">' . esc_textarea( $problem_output ) . '</textarea></p>';
  128. } else {
  129. echo '<p>' . __( 'Repairs complete. Please remove the following line from wp-config.php to prevent this page from being used by unauthorized users.' ) . "</p><p><code>define('WP_ALLOW_REPAIR', true);</code></p>";
  130. }
  131. } else {
  132. echo '<h1 class="screen-reader-text">' . __( 'WordPress database repair' ) . '</h1>';
  133. if ( isset( $_GET['referrer'] ) && 'is_blog_installed' === $_GET['referrer'] ) {
  134. 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>';
  135. } else {
  136. echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
  137. }
  138. ?>
  139. <p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
  140. <p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>
  141. <p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
  142. <?php
  143. }
  144. ?>
  145. </body>
  146. </html>