Make WordPress Core


Ignore:
Timestamp:
04/12/2019 05:03:24 PM (6 years ago)
Author:
desrosj
Message:

Site Health: Improve the test badge implementation.

Label badges for each Site Health test currently display in either red, orange, or green, regardless of if the test passed or failed. This is confusing, as seeing red labels in the “Passed Test” section could alarm users (when really everything is OK and no action is required), and seeing green labels in the “Failed Tests” section would not appropriately encourage the user to take appropriate action.

This change makes several improvements to the label badges:

  • Always right align the badges for consistent display.
  • Remove background fill for badges. Instead, use a border.
  • Use a consistent styling for all tests (passed and failed).
  • The text color no longer uses true black (#000000).
  • The .badge.pink CSS definition has been switched to .badge.purple, and the definitions for blue, gray, and green have also been updated to more closely follow the official WordPress color palette.

Props: pbiron, garrett-eclipse, hedgefield, Clorith, xkon, melchoyce, mdwolinski, alexdenning.
Fixes #46623.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r45164 r45169  
    184184            'badge'       => array(
    185185                'label' => __( 'Performance' ),
    186                 'color' => 'red',
     186                'color' => 'blue',
    187187            ),
    188188            'description' => '',
     
    284284            'badge'       => array(
    285285                'label' => __( 'Security' ),
    286                 'color' => 'red',
     286                'color' => 'blue',
    287287            ),
    288288            'description' => sprintf(
     
    400400            'badge'       => array(
    401401                'label' => __( 'Security' ),
    402                 'color' => 'red',
     402                'color' => 'blue',
    403403            ),
    404404            'description' => sprintf(
     
    624624            'badge'       => array(
    625625                'label' => __( 'Performance' ),
    626                 'color' => 'red',
     626                'color' => 'blue',
    627627            ),
    628628            'description' => sprintf(
     
    713713            'badge'       => array(
    714714                'label' => __( 'Performance' ),
    715                 'color' => 'orange',
     715                'color' => 'blue',
    716716            ),
    717717            'description' => sprintf(
     
    909909            'badge'       => array(
    910910                'label' => __( 'Performance' ),
    911                 'color' => 'red',
     911                'color' => 'blue',
    912912            ),
    913913            'description' => sprintf(
     
    989989            'badge'       => array(
    990990                'label' => __( 'Performance' ),
    991                 'color' => 'orange',
     991                'color' => 'blue',
    992992            ),
    993993            'description' => sprintf(
     
    11041104            'badge'       => array(
    11051105                'label' => __( 'Security' ),
    1106                 'color' => 'red',
     1106                'color' => 'blue',
    11071107            ),
    11081108            'description' => sprintf(
     
    11641164            'badge'       => array(
    11651165                'label' => __( 'Security' ),
    1166                 'color' => 'red',
     1166                'color' => 'blue',
    11671167            ),
    11681168            'description' => sprintf(
     
    12261226            'badge'       => array(
    12271227                'label' => __( 'Security' ),
    1228                 'color' => 'red',
     1228                'color' => 'blue',
    12291229            ),
    12301230            'description' => sprintf(
     
    12891289            'badge'       => array(
    12901290                'label' => __( 'Security' ),
    1291                 'color' => 'red',
     1291                'color' => 'blue',
    12921292            ),
    12931293            'description' => sprintf(
     
    13351335            'badge'       => array(
    13361336                'label' => __( 'Performance' ),
    1337                 'color' => 'orange',
     1337                'color' => 'blue',
    13381338            ),
    13391339            'description' => sprintf(
     
    13961396            'badge'       => array(
    13971397                'label' => __( 'Security' ),
    1398                 'color' => 'red',
     1398                'color' => 'blue',
    13991399            ),
    14001400            'description' => sprintf(
     
    14721472            'badge'       => array(
    14731473                'label' => __( 'Performance' ),
    1474                 'color' => 'orange',
     1474                'color' => 'blue',
    14751475            ),
    14761476            'description' => sprintf(
     
    15141514            'badge'       => array(
    15151515                'label' => __( 'Performance' ),
    1516                 'color' => 'orange',
     1516                'color' => 'blue',
    15171517            ),
    15181518            'description' => sprintf(
     
    15851585            'badge'       => array(
    15861586                'label' => __( 'Performance' ),
    1587                 'color' => 'orange',
     1587                'color' => 'blue',
    15881588            ),
    15891589            'description' => sprintf(
Note: See TracChangeset for help on using the changeset viewer.