Skip to content

Commit

Permalink
Remove confusing health score. Better not to have it at all than show…
Browse files Browse the repository at this point in the history
…ing what seems like random numbers to the user #254
  • Loading branch information
markkap committed May 11, 2019
1 parent ba0f2af commit d3a58f2
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 119 deletions.
26 changes: 0 additions & 26 deletions src/js/_enqueues/admin/site-health.js
Expand Up @@ -85,35 +85,17 @@ jQuery( document ).ready( function( $ ) {
* @since 5.2.0
*/
function RecalculateProgression() {
var r, c, pct;
var $progress = $( '.site-health-progress' );
var $progressCount = $progress.find( '.site-health-progress-count' );
var $circle = $( '.site-health-progress svg #bar' );
var totalTests = parseInt( SiteHealth.site_status.issues.good, 0 ) + parseInt( SiteHealth.site_status.issues.recommended, 0 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
var failedTests = parseInt( SiteHealth.site_status.issues.recommended, 0 ) + ( parseInt( SiteHealth.site_status.issues.critical, 0 ) * 1.5 );
var val = 100 - Math.ceil( ( failedTests / totalTests ) * 100 );

if ( 0 === totalTests ) {
$progress.addClass( 'hidden' );
return;
}

$progress.removeClass( 'loading' );

r = $circle.attr( 'r' );
c = Math.PI * ( r * 2 );

if ( 0 > val ) {
val = 0;
}
if ( 100 < val ) {
val = 100;
}

pct = ( ( 100 - val ) / 100 ) * c;

$circle.css( { strokeDashoffset: pct } );

if ( 1 > parseInt( SiteHealth.site_status.issues.critical, 0 ) ) {
$( '#health-check-issues-critical' ).addClass( 'hidden' );
}
Expand All @@ -122,14 +104,6 @@ jQuery( document ).ready( function( $ ) {
$( '#health-check-issues-recommended' ).addClass( 'hidden' );
}

if ( 50 <= val ) {
$circle.addClass( 'orange' ).removeClass( 'red' );
}

if ( 90 <= val ) {
$circle.addClass( 'green' ).removeClass( 'orange' );
}

if ( 100 === val ) {
$( '.site-status-all-clear' ).removeClass( 'hide' );
$( '.site-status-has-issues' ).addClass( 'hide' );
Expand Down
71 changes: 0 additions & 71 deletions src/wp-admin/css/site-health.css
Expand Up @@ -37,77 +37,6 @@
clear: both;
}

.site-health-progress {
display: inline-block;
height: 40px;
width: 40px;
margin: 0;
border-radius: 100%;
position: relative;
font-weight: 600;
font-size: 0.4rem;
}

.site-health-progress-count {
position: absolute;
display: block;
height: 80px;
width: 80px;
left: 50%;
top: 50%;
margin-top: -40px;
margin-left: -40px;
border-radius: 100%;
line-height: 6.3;
font-size: 2em;
}

.site-health-progress-count::after {
content: "";
}

.site-health-progress.loading .site-health-progress-count::after {
content: "···";
}

.site-health-progress.loading svg #bar {
stroke-dashoffset: 0;
stroke: #adc5d2;
animation: loadingPulse 3s infinite ease-in-out;
}

.site-health-progress svg circle {
stroke-dashoffset: 0;
transition: stroke-dashoffset 1s linear;
stroke: #ccc;
stroke-width: 2em;
}

.site-health-progress svg #bar {
stroke-dashoffset: 565;
stroke: #dc3232;
}

.site-health-progress svg #bar.green {
stroke: #46b450;
}

.site-health-progress svg #bar.orange {
stroke: #ffb900;
}

@keyframes loadingPulse {
0% {
stroke: #adc5d2;
}
50% {
stroke: #00a0d2;
}
100% {
stroke: #adc5d2;
}
}

.health-check-tab {
display: inline-block;
text-decoration: none;
Expand Down
9 changes: 0 additions & 9 deletions src/wp-admin/site-health-info.php
Expand Up @@ -34,15 +34,6 @@
<h1>
<?php _e( 'Site Health' ); ?>
</h1>

<div class="site-health-progress hide-if-no-js loading">
<svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
<circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
</svg>
<span class="screen-reader-text"><?php _e( 'Current health score:' ); ?></span>
<span class="site-health-progress-count"></span>
</div>
</div>

<nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
Expand Down
13 changes: 0 additions & 13 deletions src/wp-admin/site-health.php
Expand Up @@ -39,15 +39,6 @@
<h1>
<?php _e( 'Site Health' ); ?>
</h1>

<div class="site-health-progress hide-if-no-js loading">
<svg role="img" aria-hidden="true" focusable="false" width="100%" height="100%" viewBox="0 0 200 200" version="1.1" xmlns="http://www.w3.org/2000/svg">
<circle r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
<circle id="bar" r="90" cx="100" cy="100" fill="transparent" stroke-dasharray="565.48" stroke-dashoffset="0"></circle>
</svg>
<span class="screen-reader-text"><?php _e( 'Current health score:' ); ?></span>
<span class="site-health-progress-count"></span>
</div>
</div>

<nav class="health-check-tabs-wrapper hide-if-no-js" aria-label="<?php esc_attr_e( 'Secondary menu' ); ?>">
Expand All @@ -73,10 +64,6 @@
<span class="dashicons dashicons-yes"></span>
</p>

<p class="encouragement">
<?php _e( 'Great job!' ); ?>
</p>

<p>
<?php _e( 'Everything is running smoothly here.' ); ?>
</p>
Expand Down

0 comments on commit d3a58f2

Please sign in to comment.