WordPress.org

Make WordPress Core

Changeset 50833


Ignore:
Timestamp:
05/10/2021 02:54:57 PM (5 weeks ago)
Author:
SergeyBiryukov
Message:

Site Health: Improve the appearance of Site Health Status dashboard widget.

This better utilizes the available screen space on wider screens.

Props mblach, hedgefield, Clorith.
Fixes #52966.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/site-health.css

    r50784 r50833  
    3131
    3232.health-check-title-section {
     33    clear: both;
     34    text-align: center;
     35    padding-top: 8px;
     36}
     37
     38.site-health .health-check-title-section {
    3339    display: flex;
    3440    align-items: center;
    3541    justify-content: center;
    36     clear: both;
    3742}
    3843
     
    459464}
    460465
     466/* Styling unique to the dashboard widget. */
     467#dashboard_site_health .site-health-details {
     468    padding-left: 16px;
     469}
     470
     471#dashboard_site_health .inside {
     472    display: grid;
     473    grid-template-columns: 1fr 2fr;
     474    grid-auto-rows: minmax(64px, auto);
     475    column-gap: 16px;
     476    align-items: center;
     477}
     478
     479@media screen and (max-width: 480px) {
     480    #dashboard_site_health .inside {
     481        grid-template-columns: 100%;
     482    }
     483}
     484
    461485@media screen and (max-width: 782px) {
    462486    .health-check-body {
  • trunk/src/wp-admin/includes/dashboard.php

    r50689 r50833  
    19081908    </div>
    19091909
    1910     <?php if ( false === $get_issues ) : ?>
    1911         <p>
    1912             <?php
    1913             printf(
    1914                 /* translators: %s: URL to Site Health screen. */
    1915                 __( 'Site health checks will automatically run periodically to gather information about your site. You can also <a href="%s">visit the Site Health screen</a> to gather information about your site now.' ),
    1916                 esc_url( admin_url( 'site-health.php' ) )
    1917             );
    1918             ?>
    1919         </p>
    1920     <?php else : ?>
    1921         <p>
    1922             <?php if ( $issues_total <= 0 ) : ?>
    1923                 <?php _e( 'Great job! Your site currently passes all site health checks.' ); ?>
    1924             <?php elseif ( 1 === (int) $issue_counts['critical'] ) : ?>
    1925                 <?php _e( 'Your site has a critical issue that should be addressed as soon as possible to improve its performance and security.' ); ?>
    1926             <?php elseif ( $issue_counts['critical'] > 1 ) : ?>
    1927                 <?php _e( 'Your site has critical issues that should be addressed as soon as possible to improve its performance and security.' ); ?>
    1928             <?php elseif ( 1 === (int) $issue_counts['recommended'] ) : ?>
    1929                 <?php _e( 'Your site&#8217;s health is looking good, but there is still one thing you can do to improve its performance and security.' ); ?>
    1930             <?php else : ?>
    1931                 <?php _e( 'Your site&#8217;s health is looking good, but there are still some things you can do to improve its performance and security.' ); ?>
    1932             <?php endif; ?>
    1933         </p>
    1934     <?php endif; ?>
    1935 
    1936     <?php if ( $issues_total > 0 && false !== $get_issues ) : ?>
    1937         <p>
    1938             <?php
    1939             printf(
    1940                 /* translators: 1: Number of issues. 2: URL to Site Health screen. */
    1941                 _n(
    1942                     'Take a look at the <strong>%1$d item</strong> on the <a href="%2$s">Site Health screen</a>.',
    1943                     'Take a look at the <strong>%1$d items</strong> on the <a href="%2$s">Site Health screen</a>.',
    1944                     $issues_total
    1945                 ),
    1946                 $issues_total,
    1947                 esc_url( admin_url( 'site-health.php' ) )
    1948             );
    1949             ?>
    1950         </p>
    1951     <?php endif; ?>
     1910    <div class="site-health-details">
     1911        <?php if ( false === $get_issues ) : ?>
     1912            <p>
     1913                <?php
     1914                printf(
     1915                    /* translators: %s: URL to Site Health screen. */
     1916                    __( 'Site health checks will automatically run periodically to gather information about your site. You can also <a href="%s">visit the Site Health screen</a> to gather information about your site now.' ),
     1917                    esc_url( admin_url( 'site-health.php' ) )
     1918                );
     1919                ?>
     1920            </p>
     1921        <?php else : ?>
     1922            <p>
     1923                <?php if ( $issues_total <= 0 ) : ?>
     1924                    <?php _e( 'Great job! Your site currently passes all site health checks.' ); ?>
     1925                <?php elseif ( 1 === (int) $issue_counts['critical'] ) : ?>
     1926                    <?php _e( 'Your site has a critical issue that should be addressed as soon as possible to improve its performance and security.' ); ?>
     1927                <?php elseif ( $issue_counts['critical'] > 1 ) : ?>
     1928                    <?php _e( 'Your site has critical issues that should be addressed as soon as possible to improve its performance and security.' ); ?>
     1929                <?php elseif ( 1 === (int) $issue_counts['recommended'] ) : ?>
     1930                    <?php _e( 'Your site&#8217;s health is looking good, but there is still one thing you can do to improve its performance and security.' ); ?>
     1931                <?php else : ?>
     1932                    <?php _e( 'Your site&#8217;s health is looking good, but there are still some things you can do to improve its performance and security.' ); ?>
     1933                <?php endif; ?>
     1934            </p>
     1935        <?php endif; ?>
     1936
     1937        <?php if ( $issues_total > 0 && false !== $get_issues ) : ?>
     1938            <p>
     1939                <?php
     1940                printf(
     1941                    /* translators: 1: Number of issues. 2: URL to Site Health screen. */
     1942                    _n(
     1943                        'Take a look at the <strong>%1$d item</strong> on the <a href="%2$s">Site Health screen</a>.',
     1944                        'Take a look at the <strong>%1$d items</strong> on the <a href="%2$s">Site Health screen</a>.',
     1945                        $issues_total
     1946                    ),
     1947                    $issues_total,
     1948                    esc_url( admin_url( 'site-health.php' ) )
     1949                );
     1950                ?>
     1951            </p>
     1952        <?php endif; ?>
     1953    </div>
    19521954
    19531955    <?php
Note: See TracChangeset for help on using the changeset viewer.