Site health: Fix gathering the site data twice on non-English locales. Introduces two sets of data:

- More verbose set used to generate the admin page.
- More concise set that is copied when clicking the "Copy the site info" button intended mostly for support and developers.

Props xkon, azaozz.
Fixes #46726.
Built from https://develop.svn.wordpress.org/trunk@45156


git-svn-id: http://core.svn.wordpress.org/trunk@44965 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2019-04-10 05:07:51 +00:00
parent 447b956bb8
commit 8ffebab3e6
3 changed files with 566 additions and 355 deletions

File diff suppressed because it is too large Load Diff

View File

@ -66,11 +66,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<?php
WP_Debug_Data::check_for_updates();
$info = WP_Debug_Data::debug_data();
$english_info = '';
if ( 0 !== strpos( get_user_locale(), 'en' ) ) {
$english_info = WP_Debug_Data::debug_data( 'en_US' );
}
$info = WP_Debug_Data::debug_data();
?>
<h2>
@ -86,15 +83,11 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<div class="site-health-copy-buttons">
<div class="copy-button-wrapper">
<button type="button" class="button button-primary copy-button" data-clipboard-text="<?php echo esc_attr( WP_Debug_Data::format( $info, 'text' ) ); ?>"><?php _e( 'Copy site info to clipboard' ); ?></button>
<button type="button" class="button copy-button" data-clipboard-text="<?php echo esc_attr( WP_Debug_Data::format( $info, 'debug' ) ); ?>">
<?php _e( 'Copy site info to clipboard' ); ?>
</button>
<span class="success" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
</div>
<?php if ( $english_info ) : ?>
<div class="copy-button-wrapper">
<button type="button" class="button copy-button" data-clipboard-text="<?php echo esc_attr( WP_Debug_Data::format( $english_info, 'text' ) ); ?>"><?php _e( 'Copy site info to clipboard (English)' ); ?></button>
<span class="success" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
</div>
<?php endif; ?>
</div>
<div id="health-check-debug" class="health-check-accordion">

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-beta2-45155';
$wp_version = '5.2-beta2-45156';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.