From 9b15549b1c8540492424ed16fab71b8bdf934be2 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Wed, 27 Mar 2019 20:39:51 +0000 Subject: [PATCH] Accessibility: Simplify the Site Health score indicator. The Site Health score indicator isn't exactly a "progress bar" and shouldn't use ARIA roles and properties related to progress bars. Also, some browser / screen reader combinations don't announce the score properly. - removes any ARIA - adds a screen-reader-text "Current health score:" - adds `role="img" aria-hidden="true" focusable="false"` to the SVG - reduces CSS specificity simplifying unnecessary overqualified selectors - fixes the syntax for ::after and ::before (double colon) Fixes #46621. Built from https://develop.svn.wordpress.org/trunk@45041 git-svn-id: http://core.svn.wordpress.org/trunk@44850 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/site-health-rtl.css | 37 +++++++++++++++------------- wp-admin/css/site-health-rtl.min.css | 2 +- wp-admin/css/site-health.css | 37 +++++++++++++++------------- wp-admin/css/site-health.min.css | 2 +- wp-admin/js/site-health.js | 12 ++++----- wp-admin/js/site-health.min.js | 2 +- wp-admin/site-health-info.php | 6 +++-- wp-admin/site-health.php | 6 +++-- wp-includes/version.php | 2 +- 9 files changed, 58 insertions(+), 48 deletions(-) diff --git a/wp-admin/css/site-health-rtl.css b/wp-admin/css/site-health-rtl.css index 6685ebb1f5..d07ebe848a 100644 --- a/wp-admin/css/site-health-rtl.css +++ b/wp-admin/css/site-health-rtl.css @@ -39,7 +39,7 @@ body.site-health .health-check-header .title-section h1 { margin: 1rem 0.8rem 1rem 0.8rem; } -body.site-health .health-check-header .title-section #progressbar { +.site-health-progress { display: inline-block; height: 40px; width: 40px; @@ -50,14 +50,13 @@ body.site-health .health-check-header .title-section #progressbar { font-size: 0.4rem; } -body.site-health .health-check-header .title-section #progressbar:after { +.site-health-progress .progress-count { position: absolute; display: block; height: 80px; width: 80px; right: 50%; top: 50%; - content: attr(data-pct) "%"; margin-top: -40px; margin-right: -40px; border-radius: 100%; @@ -65,37 +64,41 @@ body.site-health .health-check-header .title-section #progressbar:after { font-size: 2em; } -body.site-health .health-check-header .title-section #progressbar.hidden { +.site-health-progress .progress-count::after { + content: ""; +} + +.site-health-progress.hidden { display: none; } -body.site-health .health-check-header .title-section #progressbar.loading:after { +.site-health-progress.loading .progress-count::after { animation: loadingEllipsis 3s infinite ease-in-out; } -body.site-health .health-check-header .title-section #progressbar.loading svg #bar { +.site-health-progress.loading svg #bar { stroke-dashoffset: 0; stroke: #adc5d2; animation: loadingPulse 3s infinite ease-in-out; } -body.site-health .health-check-header .title-section #progressbar svg circle { +.site-health-progress svg circle { stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; stroke: #ccc; stroke-width: 2em; } -body.site-health .health-check-header .title-section #progressbar svg #bar { +.site-health-progress svg #bar { stroke-dashoffset: 565; stroke: #dc3232; } -body.site-health .health-check-header .title-section #progressbar svg #bar.green { +.site-health-progress svg #bar.green { stroke: #46b450; } -body.site-health .health-check-header .title-section #progressbar svg #bar.orange { +.site-health-progress svg #bar.orange { stroke: #ffb900; } @@ -171,8 +174,8 @@ body.site-health .health-check-table tbody td ol { margin: 0; } -body.site-health .pass:before, -body.site-health .good:before { +.site-health .pass::before, +.site-health .good::before { content: "\f147"; display: inline-block; color: #46b450; @@ -180,22 +183,22 @@ body.site-health .good:before { vertical-align: top; } -body.site-health .warning:before { +.site-health .warning::before { content: "\f460"; display: inline-block; color: #ffb900; font-family: dashicons; } -body.site-health .info:before { +.site-health .info::before { content: "\f348"; display: inline-block; color: #00a0d2; font-family: dashicons; } -body.site-health .fail:before, -body.site-health .error:before { +.site-health .fail::before, +.site-health .error::before { content: "\f335"; display: inline-block; color: #dc3232; @@ -447,4 +450,4 @@ body .health-check-accordion dl dd { margin: 0 22px; width: initial; } -} \ No newline at end of file +} diff --git a/wp-admin/css/site-health-rtl.min.css b/wp-admin/css/site-health-rtl.min.css index a8e41288c8..281f5db8a0 100644 --- a/wp-admin/css/site-health-rtl.min.css +++ b/wp-admin/css/site-health-rtl.min.css @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -body.site-health #wpcontent{padding-right:0}body.site-health .wrap{margin-left:0;margin-right:0}body.site-health .wrap h2{padding:1rem 0;font-size:1.3em;line-height:1.4;font-weight:600}body.site-health ol li,body.site-health ul li{line-height:1.5}body.site-health .health-check-header{text-align:center;margin-top:0;margin-bottom:1rem;background:#fff;border-bottom:1px solid #e2e4e7}body.site-health .health-check-header .title-section{display:flex;align-items:center;justify-content:center}body.site-health .health-check-header .title-section h1{display:inline-block;font-weight:600;margin:1rem .8rem 1rem .8rem}body.site-health .health-check-header .title-section #progressbar{display:inline-block;height:40px;width:40px;margin:0;border-radius:100%;position:relative;font-weight:600;font-size:.4rem}body.site-health .health-check-header .title-section #progressbar:after{position:absolute;display:block;height:80px;width:80px;right:50%;top:50%;content:attr(data-pct) "%";margin-top:-40px;margin-right:-40px;border-radius:100%;line-height:80px;font-size:2em}body.site-health .health-check-header .title-section #progressbar.hidden{display:none}body.site-health .health-check-header .title-section #progressbar.loading:after{animation:loadingEllipsis 3s infinite ease-in-out}body.site-health .health-check-header .title-section #progressbar.loading svg #bar{stroke-dashoffset:0;stroke:#adc5d2;animation:loadingPulse 3s infinite ease-in-out}body.site-health .health-check-header .title-section #progressbar svg circle{stroke-dashoffset:0;transition:stroke-dashoffset 1s linear;stroke:#ccc;stroke-width:2em}body.site-health .health-check-header .title-section #progressbar svg #bar{stroke-dashoffset:565;stroke:#dc3232}body.site-health .health-check-header .title-section #progressbar svg #bar.green{stroke:#46b450}body.site-health .health-check-header .title-section #progressbar svg #bar.orange{stroke:#ffb900}@keyframes loadingPulse{0%{stroke:#adc5d2}50%{stroke:#00a0d2}100%{stroke:#adc5d2}}@keyframes loadingEllipsis{0%{content:"."}50%{content:".."}100%{content:"..."}}body.site-health .health-check-header .tabs-wrapper{display:block}body.site-health .health-check-header .tabs-wrapper .tab{float:none;display:inline-block;text-decoration:none;color:inherit;padding:.5rem 1rem 1rem;margin:0 1rem;transition:box-shadow .5s ease-in-out}body.site-health .health-check-header .tabs-wrapper .tab:focus{color:#191e23;outline:1px solid #6c7781;box-shadow:none}body.site-health .health-check-header .tabs-wrapper .tab.active{box-shadow:inset 0 -3px #007cba;font-weight:600}body.site-health .health-check-body{max-width:800px;margin:0 auto}body.site-health .health-check-table thead td:first-child,body.site-health .health-check-table thead th:first-child{width:30%}body.site-health .health-check-table tbody td{width:70%}body.site-health .health-check-table tbody td:first-child{width:30%}body.site-health .health-check-table tbody td ol,body.site-health .health-check-table tbody td ul{margin:0}body.site-health .good:before,body.site-health .pass:before{content:"\f147";display:inline-block;color:#46b450;font-family:dashicons;vertical-align:top}body.site-health .warning:before{content:"\f460";display:inline-block;color:#ffb900;font-family:dashicons}body.site-health .info:before{content:"\f348";display:inline-block;color:#00a0d2;font-family:dashicons}body.site-health .error:before,body.site-health .fail:before{content:"\f335";display:inline-block;color:#dc3232;font-family:dashicons}body.site-health .spinner{float:none}body.site-health .system-information-copy-wrapper{display:block;margin:1rem 0}body.site-health .system-information-copy-wrapper textarea{border:0;padding:0;margin:0;position:absolute;right:-9999px;top:-9999px}body.site-health .health-check-toggle-copy-section:hover{background:0 0}body.site-health .system-information-copy-wrapper .copy-button-wrapper{margin:.5rem 0 1rem}body.site-health .copy-field-success{display:none;color:#40860a;line-height:1.8;margin-right:.5rem}body.site-health .copy-field-success.visible{display:inline-block;height:28px;line-height:28px}body.site-health .site-status-has-issues{display:block}body.site-health .site-status-has-issues.hide{display:none}body.site-health h3{padding:0;font-weight:400}body.site-health .view-more{text-align:center}body.site-health .issues-wrapper:first-of-type{margin-top:3rem}body.site-health .issues-wrapper{margin-bottom:3rem;margin-top:2rem}body.site-health .site-status-all-clear{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;width:100%;margin-top:0}@media all and (min-width:784px){body.site-health .site-status-all-clear{margin:5rem 0}}body.site-health .site-status-all-clear.hide{display:none}body.site-health .site-status-all-clear .dashicons{font-size:150px;height:130px;width:150px}body.site-health .site-status-all-clear .encouragement{font-size:1.5rem;font-weight:600}body.site-health .site-status-all-clear p{margin:0}body .health-check-accordion{border:1px solid #e2e4e7}body .health-check-accordion dt{font-weight:600;border-top:1px solid #e2e4e7}body .health-check-accordion dt:first-child{border-radius:.3em .3em 0 0;border-top:none}body .health-check-accordion .health-check-accordion-trigger{background:#fff;border:0;color:#212121;cursor:pointer;display:block;font-weight:400;margin:0;padding:1em 1.5em;position:relative;text-align:right;width:100%}body .health-check-accordion .health-check-accordion-trigger:active,body .health-check-accordion .health-check-accordion-trigger:hover{background:#f8f9f9}body .health-check-accordion .health-check-accordion-trigger:focus{color:#191e23;border:none;box-shadow:none;outline-offset:-2px;outline:1px dotted #555d66}body .health-check-accordion .health-check-accordion-trigger .title{display:inline-block;pointer-events:none;font-weight:600}body .health-check-accordion .health-check-accordion-trigger .icon{border:solid #191e23;border-width:0 0 2px 2px;height:.5rem;pointer-events:none;position:absolute;left:1.5em;top:50%;transform:translateY(-70%) rotate(-45deg);width:.5rem}body .health-check-accordion .health-check-accordion-trigger .badge{display:inline-block;padding:.1rem .5rem .15rem;background-color:#d7dade;border-radius:3px;color:#000;font-weight:600;margin:0 .5rem}body .health-check-accordion .health-check-accordion-trigger .badge.blue{background-color:#0073af;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.orange{background-color:#ffb900;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.red{background-color:#dc3232;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.green{background-color:#40860a;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.pink{background-color:#f4b0fc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.gray{background-color:#ccc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-blue{background-color:#10e9fb;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-green{background-color:#60f999;color:#000}body .health-check-accordion .health-check-accordion-trigger[aria-expanded=true] .icon{transform:translateY(-30%) rotate(135deg)}body .health-check-accordion .health-check-accordion-panel{margin:0;padding:1em 1.5em;background:#fff}body .health-check-accordion .health-check-accordion-panel>div{display:block}body .health-check-accordion .health-check-accordion-panel[hidden]{display:none}body .health-check-accordion dl dd{margin:0 2em .5em 0}@media screen and (max-width:782px){body.site-health .health-check-body{margin:0 12px;width:initial}}@media only screen and (max-width:1004px){body.site-health .health-check-body{margin:0 22px;width:initial}} \ No newline at end of file +body.site-health #wpcontent{padding-right:0}body.site-health .wrap{margin-left:0;margin-right:0}body.site-health .wrap h2{padding:1rem 0;font-size:1.3em;line-height:1.4;font-weight:600}body.site-health ol li,body.site-health ul li{line-height:1.5}body.site-health .health-check-header{text-align:center;margin-top:0;margin-bottom:1rem;background:#fff;border-bottom:1px solid #e2e4e7}body.site-health .health-check-header .title-section{display:flex;align-items:center;justify-content:center}body.site-health .health-check-header .title-section h1{display:inline-block;font-weight:600;margin:1rem .8rem 1rem .8rem}.site-health-progress{display:inline-block;height:40px;width:40px;margin:0;border-radius:100%;position:relative;font-weight:600;font-size:.4rem}.site-health-progress .progress-count{position:absolute;display:block;height:80px;width:80px;right:50%;top:50%;margin-top:-40px;margin-right:-40px;border-radius:100%;line-height:80px;font-size:2em}.site-health-progress .progress-count::after{content:""}.site-health-progress.hidden{display:none}.site-health-progress.loading .progress-count::after{animation:loadingEllipsis 3s infinite ease-in-out}.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}}@keyframes loadingEllipsis{0%{content:"."}50%{content:".."}100%{content:"..."}}body.site-health .health-check-header .tabs-wrapper{display:block}body.site-health .health-check-header .tabs-wrapper .tab{float:none;display:inline-block;text-decoration:none;color:inherit;padding:.5rem 1rem 1rem;margin:0 1rem;transition:box-shadow .5s ease-in-out}body.site-health .health-check-header .tabs-wrapper .tab:focus{color:#191e23;outline:1px solid #6c7781;box-shadow:none}body.site-health .health-check-header .tabs-wrapper .tab.active{box-shadow:inset 0 -3px #007cba;font-weight:600}body.site-health .health-check-body{max-width:800px;margin:0 auto}body.site-health .health-check-table thead td:first-child,body.site-health .health-check-table thead th:first-child{width:30%}body.site-health .health-check-table tbody td{width:70%}body.site-health .health-check-table tbody td:first-child{width:30%}body.site-health .health-check-table tbody td ol,body.site-health .health-check-table tbody td ul{margin:0}.site-health .good::before,.site-health .pass::before{content:"\f147";display:inline-block;color:#46b450;font-family:dashicons;vertical-align:top}.site-health .warning::before{content:"\f460";display:inline-block;color:#ffb900;font-family:dashicons}.site-health .info::before{content:"\f348";display:inline-block;color:#00a0d2;font-family:dashicons}.site-health .error::before,.site-health .fail::before{content:"\f335";display:inline-block;color:#dc3232;font-family:dashicons}body.site-health .spinner{float:none}body.site-health .system-information-copy-wrapper{display:block;margin:1rem 0}body.site-health .system-information-copy-wrapper textarea{border:0;padding:0;margin:0;position:absolute;right:-9999px;top:-9999px}body.site-health .health-check-toggle-copy-section:hover{background:0 0}body.site-health .system-information-copy-wrapper .copy-button-wrapper{margin:.5rem 0 1rem}body.site-health .copy-field-success{display:none;color:#40860a;line-height:1.8;margin-right:.5rem}body.site-health .copy-field-success.visible{display:inline-block;height:28px;line-height:28px}body.site-health .site-status-has-issues{display:block}body.site-health .site-status-has-issues.hide{display:none}body.site-health h3{padding:0;font-weight:400}body.site-health .view-more{text-align:center}body.site-health .issues-wrapper:first-of-type{margin-top:3rem}body.site-health .issues-wrapper{margin-bottom:3rem;margin-top:2rem}body.site-health .site-status-all-clear{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;width:100%;margin-top:0}@media all and (min-width:784px){body.site-health .site-status-all-clear{margin:5rem 0}}body.site-health .site-status-all-clear.hide{display:none}body.site-health .site-status-all-clear .dashicons{font-size:150px;height:130px;width:150px}body.site-health .site-status-all-clear .encouragement{font-size:1.5rem;font-weight:600}body.site-health .site-status-all-clear p{margin:0}body .health-check-accordion{border:1px solid #e2e4e7}body .health-check-accordion dt{font-weight:600;border-top:1px solid #e2e4e7}body .health-check-accordion dt:first-child{border-radius:.3em .3em 0 0;border-top:none}body .health-check-accordion .health-check-accordion-trigger{background:#fff;border:0;color:#212121;cursor:pointer;display:block;font-weight:400;margin:0;padding:1em 1.5em;position:relative;text-align:right;width:100%}body .health-check-accordion .health-check-accordion-trigger:active,body .health-check-accordion .health-check-accordion-trigger:hover{background:#f8f9f9}body .health-check-accordion .health-check-accordion-trigger:focus{color:#191e23;border:none;box-shadow:none;outline-offset:-2px;outline:1px dotted #555d66}body .health-check-accordion .health-check-accordion-trigger .title{display:inline-block;pointer-events:none;font-weight:600}body .health-check-accordion .health-check-accordion-trigger .icon{border:solid #191e23;border-width:0 0 2px 2px;height:.5rem;pointer-events:none;position:absolute;left:1.5em;top:50%;transform:translateY(-70%) rotate(-45deg);width:.5rem}body .health-check-accordion .health-check-accordion-trigger .badge{display:inline-block;padding:.1rem .5rem .15rem;background-color:#d7dade;border-radius:3px;color:#000;font-weight:600;margin:0 .5rem}body .health-check-accordion .health-check-accordion-trigger .badge.blue{background-color:#0073af;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.orange{background-color:#ffb900;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.red{background-color:#dc3232;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.green{background-color:#40860a;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.pink{background-color:#f4b0fc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.gray{background-color:#ccc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-blue{background-color:#10e9fb;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-green{background-color:#60f999;color:#000}body .health-check-accordion .health-check-accordion-trigger[aria-expanded=true] .icon{transform:translateY(-30%) rotate(135deg)}body .health-check-accordion .health-check-accordion-panel{margin:0;padding:1em 1.5em;background:#fff}body .health-check-accordion .health-check-accordion-panel>div{display:block}body .health-check-accordion .health-check-accordion-panel[hidden]{display:none}body .health-check-accordion dl dd{margin:0 2em .5em 0}@media screen and (max-width:782px){body.site-health .health-check-body{margin:0 12px;width:initial}}@media only screen and (max-width:1004px){body.site-health .health-check-body{margin:0 22px;width:initial}} \ No newline at end of file diff --git a/wp-admin/css/site-health.css b/wp-admin/css/site-health.css index c12b52b019..cd39fe3a21 100644 --- a/wp-admin/css/site-health.css +++ b/wp-admin/css/site-health.css @@ -39,7 +39,7 @@ body.site-health .health-check-header .title-section h1 { margin: 1rem 0.8rem 1rem 0.8rem; } -body.site-health .health-check-header .title-section #progressbar { +.site-health-progress { display: inline-block; height: 40px; width: 40px; @@ -50,14 +50,13 @@ body.site-health .health-check-header .title-section #progressbar { font-size: 0.4rem; } -body.site-health .health-check-header .title-section #progressbar:after { +.site-health-progress .progress-count { position: absolute; display: block; height: 80px; width: 80px; left: 50%; top: 50%; - content: attr(data-pct) "%"; margin-top: -40px; margin-left: -40px; border-radius: 100%; @@ -65,37 +64,41 @@ body.site-health .health-check-header .title-section #progressbar:after { font-size: 2em; } -body.site-health .health-check-header .title-section #progressbar.hidden { +.site-health-progress .progress-count::after { + content: ""; +} + +.site-health-progress.hidden { display: none; } -body.site-health .health-check-header .title-section #progressbar.loading:after { +.site-health-progress.loading .progress-count::after { animation: loadingEllipsis 3s infinite ease-in-out; } -body.site-health .health-check-header .title-section #progressbar.loading svg #bar { +.site-health-progress.loading svg #bar { stroke-dashoffset: 0; stroke: #adc5d2; animation: loadingPulse 3s infinite ease-in-out; } -body.site-health .health-check-header .title-section #progressbar svg circle { +.site-health-progress svg circle { stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; stroke: #ccc; stroke-width: 2em; } -body.site-health .health-check-header .title-section #progressbar svg #bar { +.site-health-progress svg #bar { stroke-dashoffset: 565; stroke: #dc3232; } -body.site-health .health-check-header .title-section #progressbar svg #bar.green { +.site-health-progress svg #bar.green { stroke: #46b450; } -body.site-health .health-check-header .title-section #progressbar svg #bar.orange { +.site-health-progress svg #bar.orange { stroke: #ffb900; } @@ -171,8 +174,8 @@ body.site-health .health-check-table tbody td ol { margin: 0; } -body.site-health .pass:before, -body.site-health .good:before { +.site-health .pass::before, +.site-health .good::before { content: "\f147"; display: inline-block; color: #46b450; @@ -180,22 +183,22 @@ body.site-health .good:before { vertical-align: top; } -body.site-health .warning:before { +.site-health .warning::before { content: "\f460"; display: inline-block; color: #ffb900; font-family: dashicons; } -body.site-health .info:before { +.site-health .info::before { content: "\f348"; display: inline-block; color: #00a0d2; font-family: dashicons; } -body.site-health .fail:before, -body.site-health .error:before { +.site-health .fail::before, +.site-health .error::before { content: "\f335"; display: inline-block; color: #dc3232; @@ -447,4 +450,4 @@ body .health-check-accordion dl dd { margin: 0 22px; width: initial; } -} \ No newline at end of file +} diff --git a/wp-admin/css/site-health.min.css b/wp-admin/css/site-health.min.css index 4532c4f4d0..9107180bc6 100644 --- a/wp-admin/css/site-health.min.css +++ b/wp-admin/css/site-health.min.css @@ -1,2 +1,2 @@ /*! This file is auto-generated */ -body.site-health #wpcontent{padding-left:0}body.site-health .wrap{margin-right:0;margin-left:0}body.site-health .wrap h2{padding:1rem 0;font-size:1.3em;line-height:1.4;font-weight:600}body.site-health ol li,body.site-health ul li{line-height:1.5}body.site-health .health-check-header{text-align:center;margin-top:0;margin-bottom:1rem;background:#fff;border-bottom:1px solid #e2e4e7}body.site-health .health-check-header .title-section{display:flex;align-items:center;justify-content:center}body.site-health .health-check-header .title-section h1{display:inline-block;font-weight:600;margin:1rem .8rem 1rem .8rem}body.site-health .health-check-header .title-section #progressbar{display:inline-block;height:40px;width:40px;margin:0;border-radius:100%;position:relative;font-weight:600;font-size:.4rem}body.site-health .health-check-header .title-section #progressbar:after{position:absolute;display:block;height:80px;width:80px;left:50%;top:50%;content:attr(data-pct) "%";margin-top:-40px;margin-left:-40px;border-radius:100%;line-height:80px;font-size:2em}body.site-health .health-check-header .title-section #progressbar.hidden{display:none}body.site-health .health-check-header .title-section #progressbar.loading:after{animation:loadingEllipsis 3s infinite ease-in-out}body.site-health .health-check-header .title-section #progressbar.loading svg #bar{stroke-dashoffset:0;stroke:#adc5d2;animation:loadingPulse 3s infinite ease-in-out}body.site-health .health-check-header .title-section #progressbar svg circle{stroke-dashoffset:0;transition:stroke-dashoffset 1s linear;stroke:#ccc;stroke-width:2em}body.site-health .health-check-header .title-section #progressbar svg #bar{stroke-dashoffset:565;stroke:#dc3232}body.site-health .health-check-header .title-section #progressbar svg #bar.green{stroke:#46b450}body.site-health .health-check-header .title-section #progressbar svg #bar.orange{stroke:#ffb900}@keyframes loadingPulse{0%{stroke:#adc5d2}50%{stroke:#00a0d2}100%{stroke:#adc5d2}}@keyframes loadingEllipsis{0%{content:"."}50%{content:".."}100%{content:"..."}}body.site-health .health-check-header .tabs-wrapper{display:block}body.site-health .health-check-header .tabs-wrapper .tab{float:none;display:inline-block;text-decoration:none;color:inherit;padding:.5rem 1rem 1rem;margin:0 1rem;transition:box-shadow .5s ease-in-out}body.site-health .health-check-header .tabs-wrapper .tab:focus{color:#191e23;outline:1px solid #6c7781;box-shadow:none}body.site-health .health-check-header .tabs-wrapper .tab.active{box-shadow:inset 0 -3px #007cba;font-weight:600}body.site-health .health-check-body{max-width:800px;margin:0 auto}body.site-health .health-check-table thead td:first-child,body.site-health .health-check-table thead th:first-child{width:30%}body.site-health .health-check-table tbody td{width:70%}body.site-health .health-check-table tbody td:first-child{width:30%}body.site-health .health-check-table tbody td ol,body.site-health .health-check-table tbody td ul{margin:0}body.site-health .good:before,body.site-health .pass:before{content:"\f147";display:inline-block;color:#46b450;font-family:dashicons;vertical-align:top}body.site-health .warning:before{content:"\f460";display:inline-block;color:#ffb900;font-family:dashicons}body.site-health .info:before{content:"\f348";display:inline-block;color:#00a0d2;font-family:dashicons}body.site-health .error:before,body.site-health .fail:before{content:"\f335";display:inline-block;color:#dc3232;font-family:dashicons}body.site-health .spinner{float:none}body.site-health .system-information-copy-wrapper{display:block;margin:1rem 0}body.site-health .system-information-copy-wrapper textarea{border:0;padding:0;margin:0;position:absolute;left:-9999px;top:-9999px}body.site-health .health-check-toggle-copy-section:hover{background:0 0}body.site-health .system-information-copy-wrapper .copy-button-wrapper{margin:.5rem 0 1rem}body.site-health .copy-field-success{display:none;color:#40860a;line-height:1.8;margin-left:.5rem}body.site-health .copy-field-success.visible{display:inline-block;height:28px;line-height:28px}body.site-health .site-status-has-issues{display:block}body.site-health .site-status-has-issues.hide{display:none}body.site-health h3{padding:0;font-weight:400}body.site-health .view-more{text-align:center}body.site-health .issues-wrapper:first-of-type{margin-top:3rem}body.site-health .issues-wrapper{margin-bottom:3rem;margin-top:2rem}body.site-health .site-status-all-clear{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;width:100%;margin-top:0}@media all and (min-width:784px){body.site-health .site-status-all-clear{margin:5rem 0}}body.site-health .site-status-all-clear.hide{display:none}body.site-health .site-status-all-clear .dashicons{font-size:150px;height:130px;width:150px}body.site-health .site-status-all-clear .encouragement{font-size:1.5rem;font-weight:600}body.site-health .site-status-all-clear p{margin:0}body .health-check-accordion{border:1px solid #e2e4e7}body .health-check-accordion dt{font-weight:600;border-top:1px solid #e2e4e7}body .health-check-accordion dt:first-child{border-radius:.3em .3em 0 0;border-top:none}body .health-check-accordion .health-check-accordion-trigger{background:#fff;border:0;color:#212121;cursor:pointer;display:block;font-weight:400;margin:0;padding:1em 1.5em;position:relative;text-align:left;width:100%}body .health-check-accordion .health-check-accordion-trigger:active,body .health-check-accordion .health-check-accordion-trigger:hover{background:#f8f9f9}body .health-check-accordion .health-check-accordion-trigger:focus{color:#191e23;border:none;box-shadow:none;outline-offset:-2px;outline:1px dotted #555d66}body .health-check-accordion .health-check-accordion-trigger .title{display:inline-block;pointer-events:none;font-weight:600}body .health-check-accordion .health-check-accordion-trigger .icon{border:solid #191e23;border-width:0 2px 2px 0;height:.5rem;pointer-events:none;position:absolute;right:1.5em;top:50%;transform:translateY(-70%) rotate(45deg);width:.5rem}body .health-check-accordion .health-check-accordion-trigger .badge{display:inline-block;padding:.1rem .5rem .15rem;background-color:#d7dade;border-radius:3px;color:#000;font-weight:600;margin:0 .5rem}body .health-check-accordion .health-check-accordion-trigger .badge.blue{background-color:#0073af;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.orange{background-color:#ffb900;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.red{background-color:#dc3232;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.green{background-color:#40860a;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.pink{background-color:#f4b0fc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.gray{background-color:#ccc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-blue{background-color:#10e9fb;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-green{background-color:#60f999;color:#000}body .health-check-accordion .health-check-accordion-trigger[aria-expanded=true] .icon{transform:translateY(-30%) rotate(-135deg)}body .health-check-accordion .health-check-accordion-panel{margin:0;padding:1em 1.5em;background:#fff}body .health-check-accordion .health-check-accordion-panel>div{display:block}body .health-check-accordion .health-check-accordion-panel[hidden]{display:none}body .health-check-accordion dl dd{margin:0 0 .5em 2em}@media screen and (max-width:782px){body.site-health .health-check-body{margin:0 12px;width:initial}}@media only screen and (max-width:1004px){body.site-health .health-check-body{margin:0 22px;width:initial}} \ No newline at end of file +body.site-health #wpcontent{padding-left:0}body.site-health .wrap{margin-right:0;margin-left:0}body.site-health .wrap h2{padding:1rem 0;font-size:1.3em;line-height:1.4;font-weight:600}body.site-health ol li,body.site-health ul li{line-height:1.5}body.site-health .health-check-header{text-align:center;margin-top:0;margin-bottom:1rem;background:#fff;border-bottom:1px solid #e2e4e7}body.site-health .health-check-header .title-section{display:flex;align-items:center;justify-content:center}body.site-health .health-check-header .title-section h1{display:inline-block;font-weight:600;margin:1rem .8rem 1rem .8rem}.site-health-progress{display:inline-block;height:40px;width:40px;margin:0;border-radius:100%;position:relative;font-weight:600;font-size:.4rem}.site-health-progress .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:80px;font-size:2em}.site-health-progress .progress-count::after{content:""}.site-health-progress.hidden{display:none}.site-health-progress.loading .progress-count::after{animation:loadingEllipsis 3s infinite ease-in-out}.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}}@keyframes loadingEllipsis{0%{content:"."}50%{content:".."}100%{content:"..."}}body.site-health .health-check-header .tabs-wrapper{display:block}body.site-health .health-check-header .tabs-wrapper .tab{float:none;display:inline-block;text-decoration:none;color:inherit;padding:.5rem 1rem 1rem;margin:0 1rem;transition:box-shadow .5s ease-in-out}body.site-health .health-check-header .tabs-wrapper .tab:focus{color:#191e23;outline:1px solid #6c7781;box-shadow:none}body.site-health .health-check-header .tabs-wrapper .tab.active{box-shadow:inset 0 -3px #007cba;font-weight:600}body.site-health .health-check-body{max-width:800px;margin:0 auto}body.site-health .health-check-table thead td:first-child,body.site-health .health-check-table thead th:first-child{width:30%}body.site-health .health-check-table tbody td{width:70%}body.site-health .health-check-table tbody td:first-child{width:30%}body.site-health .health-check-table tbody td ol,body.site-health .health-check-table tbody td ul{margin:0}.site-health .good::before,.site-health .pass::before{content:"\f147";display:inline-block;color:#46b450;font-family:dashicons;vertical-align:top}.site-health .warning::before{content:"\f460";display:inline-block;color:#ffb900;font-family:dashicons}.site-health .info::before{content:"\f348";display:inline-block;color:#00a0d2;font-family:dashicons}.site-health .error::before,.site-health .fail::before{content:"\f335";display:inline-block;color:#dc3232;font-family:dashicons}body.site-health .spinner{float:none}body.site-health .system-information-copy-wrapper{display:block;margin:1rem 0}body.site-health .system-information-copy-wrapper textarea{border:0;padding:0;margin:0;position:absolute;left:-9999px;top:-9999px}body.site-health .health-check-toggle-copy-section:hover{background:0 0}body.site-health .system-information-copy-wrapper .copy-button-wrapper{margin:.5rem 0 1rem}body.site-health .copy-field-success{display:none;color:#40860a;line-height:1.8;margin-left:.5rem}body.site-health .copy-field-success.visible{display:inline-block;height:28px;line-height:28px}body.site-health .site-status-has-issues{display:block}body.site-health .site-status-has-issues.hide{display:none}body.site-health h3{padding:0;font-weight:400}body.site-health .view-more{text-align:center}body.site-health .issues-wrapper:first-of-type{margin-top:3rem}body.site-health .issues-wrapper{margin-bottom:3rem;margin-top:2rem}body.site-health .site-status-all-clear{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;height:100%;width:100%;margin-top:0}@media all and (min-width:784px){body.site-health .site-status-all-clear{margin:5rem 0}}body.site-health .site-status-all-clear.hide{display:none}body.site-health .site-status-all-clear .dashicons{font-size:150px;height:130px;width:150px}body.site-health .site-status-all-clear .encouragement{font-size:1.5rem;font-weight:600}body.site-health .site-status-all-clear p{margin:0}body .health-check-accordion{border:1px solid #e2e4e7}body .health-check-accordion dt{font-weight:600;border-top:1px solid #e2e4e7}body .health-check-accordion dt:first-child{border-radius:.3em .3em 0 0;border-top:none}body .health-check-accordion .health-check-accordion-trigger{background:#fff;border:0;color:#212121;cursor:pointer;display:block;font-weight:400;margin:0;padding:1em 1.5em;position:relative;text-align:left;width:100%}body .health-check-accordion .health-check-accordion-trigger:active,body .health-check-accordion .health-check-accordion-trigger:hover{background:#f8f9f9}body .health-check-accordion .health-check-accordion-trigger:focus{color:#191e23;border:none;box-shadow:none;outline-offset:-2px;outline:1px dotted #555d66}body .health-check-accordion .health-check-accordion-trigger .title{display:inline-block;pointer-events:none;font-weight:600}body .health-check-accordion .health-check-accordion-trigger .icon{border:solid #191e23;border-width:0 2px 2px 0;height:.5rem;pointer-events:none;position:absolute;right:1.5em;top:50%;transform:translateY(-70%) rotate(45deg);width:.5rem}body .health-check-accordion .health-check-accordion-trigger .badge{display:inline-block;padding:.1rem .5rem .15rem;background-color:#d7dade;border-radius:3px;color:#000;font-weight:600;margin:0 .5rem}body .health-check-accordion .health-check-accordion-trigger .badge.blue{background-color:#0073af;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.orange{background-color:#ffb900;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.red{background-color:#dc3232;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.green{background-color:#40860a;color:#fff}body .health-check-accordion .health-check-accordion-trigger .badge.pink{background-color:#f4b0fc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.gray{background-color:#ccc;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-blue{background-color:#10e9fb;color:#000}body .health-check-accordion .health-check-accordion-trigger .badge.light-green{background-color:#60f999;color:#000}body .health-check-accordion .health-check-accordion-trigger[aria-expanded=true] .icon{transform:translateY(-30%) rotate(-135deg)}body .health-check-accordion .health-check-accordion-panel{margin:0;padding:1em 1.5em;background:#fff}body .health-check-accordion .health-check-accordion-panel>div{display:block}body .health-check-accordion .health-check-accordion-panel[hidden]{display:none}body .health-check-accordion dl dd{margin:0 0 .5em 2em}@media screen and (max-width:782px){body.site-health .health-check-body{margin:0 12px;width:initial}}@media only screen and (max-width:1004px){body.site-health .health-check-body{margin:0 22px;width:initial}} \ No newline at end of file diff --git a/wp-admin/js/site-health.js b/wp-admin/js/site-health.js index fba118bb78..826f46f4a2 100644 --- a/wp-admin/js/site-health.js +++ b/wp-admin/js/site-health.js @@ -82,18 +82,19 @@ jQuery( document ).ready( function( $ ) { */ function RecalculateProgression() { var r, c, pct; - var $progressBar = $( '#progressbar' ); - var $circle = $( '#progressbar svg #bar' ); + var $progress = $( '.site-health-progress' ); + var $progressCount = $progress.find( '.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 ) { - $progressBar.addClass( 'hidden' ); + $progress.addClass( 'hidden' ); return; } - $progressBar.removeClass( 'loading' ); + $progress.removeClass( 'loading' ); r = $circle.attr( 'r' ); c = Math.PI * ( r * 2 ); @@ -130,8 +131,7 @@ jQuery( document ).ready( function( $ ) { $( '.site-status-has-issues' ).addClass( 'hide' ); } - $progressBar.attr( 'data-pct', val ); - $progressBar.attr( 'aria-valuenow', val ); + $progressCount.text( val + '%' ); $.post( ajaxurl, diff --git a/wp-admin/js/site-health.min.js b/wp-admin/js/site-health.min.js index 259d7e4eb1..95bea37691 100644 --- a/wp-admin/js/site-health.min.js +++ b/wp-admin/js/site-health.min.js @@ -1 +1 @@ -jQuery(document).ready(function(a){function b(b){var c=wp.template("health-check-issue"),d=a("#health-check-issues-"+b.status),e=a(".issue-count",d);SiteHealth.site_status.issues[b.status]++,e.text(SiteHealth.site_status.issues[b.status]),a(".issues","#health-check-issues-"+b.status).append(c(b))}function c(){var b,c,d,e=a("#progressbar"),f=a("#progressbar svg #bar"),g=parseInt(SiteHealth.site_status.issues.good,0)+parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),h=parseInt(SiteHealth.site_status.issues.recommended,0)+1.5*parseInt(SiteHealth.site_status.issues.critical,0),i=100-Math.ceil(h/g*100);return 0===g?void e.addClass("hidden"):(e.removeClass("loading"),b=f.attr("r"),c=Math.PI*(2*b),0>i&&(i=0),100parseInt(SiteHealth.site_status.issues.critical,0)&&a("#health-check-issues-critical").addClass("hidden"),1>parseInt(SiteHealth.site_status.issues.recommended,0)&&a("#health-check-issues-recommended").addClass("hidden"),50<=i&&f.addClass("orange").removeClass("red"),90<=i&&f.addClass("green").removeClass("orange"),100===i&&(a(".site-status-all-clear").removeClass("hide"),a(".site-status-has-issues").addClass("hide")),e.attr("data-pct",i),e.attr("aria-valuenow",i),a.post(ajaxurl,{action:"health-check-site-status-result",_wpnonce:SiteHealth.nonce.site_status_result,counts:SiteHealth.site_status.issues}),void wp.a11y.speak(SiteHealth.string.site_health_complete_screen_reader.replace("%s",i+"%")))}function d(){var e=!0;1<=SiteHealth.site_status.async.length&&a.each(SiteHealth.site_status.async,function(){var c={action:"health-check-"+this.test.replace("_","-"),_wpnonce:SiteHealth.nonce.site_status};return!!this.completed||(e=!1,this.completed=!0,a.post(ajaxurl,c,function(a){b(a.data),d()}),!1)}),e&&c()}var e;a(".health-check-copy-field").click(function(b){var c=a("#system-information-"+a(this).data("copy-field")+"-copy-field"),d=a(this).closest("div");b.preventDefault(),c.select(),document.execCommand("copy")&&(a(".copy-field-success",d).addClass("visible"),a(this).focus(),wp.a11y.speak(SiteHealth.string.site_info_copied))}),a(".health-check-accordion").on("click",".health-check-accordion-trigger",function(){var b="true"===a(this).attr("aria-expanded");b?(a(this).attr("aria-expanded","false"),a("#"+a(this).attr("aria-controls")).attr("hidden",!0)):(a(this).attr("aria-expanded","true"),a("#"+a(this).attr("aria-controls")).attr("hidden",!1))}),a(".health-check-accordion").on("keyup",".health-check-accordion-trigger",function(b){"38"===b.keyCode.toString()?a(".health-check-accordion-trigger",a(this).closest("dt").prevAll("dt")).focus():"40"===b.keyCode.toString()&&a(".health-check-accordion-trigger",a(this).closest("dt").nextAll("dt")).focus()}),a(".site-health-view-passed").on("click",function(){var b=a("#health-check-issues-good");b.toggleClass("hidden"),a(this).attr("aria-expanded",!b.hasClass("hidden"))}),"undefined"!=typeof SiteHealth&&(0===SiteHealth.site_status.direct.length&&0===SiteHealth.site_status.async.length?c():SiteHealth.site_status.issues={good:0,recommended:0,critical:0},0j&&(j=0),100parseInt(SiteHealth.site_status.issues.critical,0)&&a("#health-check-issues-critical").addClass("hidden"),1>parseInt(SiteHealth.site_status.issues.recommended,0)&&a("#health-check-issues-recommended").addClass("hidden"),50<=j&&g.addClass("orange").removeClass("red"),90<=j&&g.addClass("green").removeClass("orange"),100===j&&(a(".site-status-all-clear").removeClass("hide"),a(".site-status-has-issues").addClass("hide")),f.text(j+"%"),a.post(ajaxurl,{action:"health-check-site-status-result",_wpnonce:SiteHealth.nonce.site_status_result,counts:SiteHealth.site_status.issues}),void wp.a11y.speak(SiteHealth.string.site_health_complete_screen_reader.replace("%s",j+"%")))}function d(){var e=!0;1<=SiteHealth.site_status.async.length&&a.each(SiteHealth.site_status.async,function(){var c={action:"health-check-"+this.test.replace("_","-"),_wpnonce:SiteHealth.nonce.site_status};return!!this.completed||(e=!1,this.completed=!0,a.post(ajaxurl,c,function(a){b(a.data),d()}),!1)}),e&&c()}var e;a(".health-check-copy-field").click(function(b){var c=a("#system-information-"+a(this).data("copy-field")+"-copy-field"),d=a(this).closest("div");b.preventDefault(),c.select(),document.execCommand("copy")&&(a(".copy-field-success",d).addClass("visible"),a(this).focus(),wp.a11y.speak(SiteHealth.string.site_info_copied))}),a(".health-check-accordion").on("click",".health-check-accordion-trigger",function(){var b="true"===a(this).attr("aria-expanded");b?(a(this).attr("aria-expanded","false"),a("#"+a(this).attr("aria-controls")).attr("hidden",!0)):(a(this).attr("aria-expanded","true"),a("#"+a(this).attr("aria-controls")).attr("hidden",!1))}),a(".health-check-accordion").on("keyup",".health-check-accordion-trigger",function(b){"38"===b.keyCode.toString()?a(".health-check-accordion-trigger",a(this).closest("dt").prevAll("dt")).focus():"40"===b.keyCode.toString()&&a(".health-check-accordion-trigger",a(this).closest("dt").nextAll("dt")).focus()}),a(".site-health-view-passed").on("click",function(){var b=a("#health-check-issues-good");b.toggleClass("hidden"),a(this).attr("aria-expanded",!b.hasClass("hidden"))}),"undefined"!=typeof SiteHealth&&(0===SiteHealth.site_status.direct.length&&0===SiteHealth.site_status.async.length?c():SiteHealth.site_status.issues={good:0,recommended:0,critical:0},0 -
- +
+ + +
diff --git a/wp-admin/site-health.php b/wp-admin/site-health.php index 9a7869f425..5c713f6075 100644 --- a/wp-admin/site-health.php +++ b/wp-admin/site-health.php @@ -36,11 +36,13 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); -
- +
+ + +
diff --git a/wp-includes/version.php b/wp-includes/version.php index 45fff81055..091963ac3e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-alpha-45040'; +$wp_version = '5.2-alpha-45041'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.