diff --git a/assets/css/plugin-check-admin.css b/assets/css/plugin-check-admin.css index 7ed8e00db..6d3d033be 100644 --- a/assets/css/plugin-check-admin.css +++ b/assets/css/plugin-check-admin.css @@ -19,12 +19,14 @@ table.plugin-check__results-table thead { border: none; clip: rect(0 0 0 0); + clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; + white-space: nowrap; } table.plugin-check__results-table tr { diff --git a/assets/js/plugin-check-admin.js b/assets/js/plugin-check-admin.js index 22227cc4e..f1e340759 100644 --- a/assets/js/plugin-check-admin.js +++ b/assets/js/plugin-check-admin.js @@ -80,6 +80,7 @@ e.preventDefault(); resetResults(); + announce( defaultString( 'checkingPlugin' ) ); checkItButton.disabled = true; pluginsList.disabled = true; spinner.classList.add( 'is-active' ); @@ -102,11 +103,17 @@ .then( cleanUpEnvironment ) .then( ( data ) => { console.log( data.message ); + if ( data && data.message ) { + announce( data.message ); + } resetForm(); } ) .catch( ( error ) => { console.error( error ); + const errorMsg = + error && error.message ? error.message : String( error ); + announce( errorMsg ); resetForm(); } ); @@ -119,7 +126,7 @@ */ function resetResults() { // Empty the results container. - resultsContainer.innerText = ''; + resultsContainer.textContent = ''; exportContainer.innerHTML = ''; exportContainer.classList.add( 'is-hidden' ); resetAggregatedResults(); diff --git a/includes/Admin/Admin_Page.php b/includes/Admin/Admin_Page.php index 5dd4881e8..3478c19e0 100644 --- a/includes/Admin/Admin_Page.php +++ b/includes/Admin/Admin_Page.php @@ -180,6 +180,7 @@ public function enqueue_scripts() { WP_PLUGIN_CHECK_PLUGIN_DIR_URL . 'assets/js/plugin-check-admin.js', array( 'wp-util', + 'wp-a11y', ), WP_PLUGIN_CHECK_VERSION, true @@ -218,6 +219,7 @@ public function enqueue_scripts() { /* translators: %s: Formatted issue count string (e.g. "3 errors" or "2 warnings"). */ 'summarySingleTemplate' => __( '%s found.', 'plugin-check' ), 'strings' => array( + 'checkingPlugin' => __( 'Running plugin checks…', 'plugin-check' ), 'exportCsv' => __( 'Export CSV', 'plugin-check' ), 'exportJson' => __( 'Export JSON', 'plugin-check' ), 'exportCtrf' => __( 'Export CTRF', 'plugin-check' ), diff --git a/includes/Lib/Readme/Parser.php b/includes/Lib/Readme/Parser.php index e5524dd37..b58679ace 100644 --- a/includes/Lib/Readme/Parser.php +++ b/includes/Lib/Readme/Parser.php @@ -583,7 +583,7 @@ protected function trim_length( $desc, $length = 150, $type = 'char' ) { } // Apply the length restriction without counting html entities. - $str_length = mb_strlen( html_entity_decode( $desc ) ?: $desc ); + $str_length = mb_strlen( html_entity_decode( $desc, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ) ?: $desc ); if ( $str_length > $length ) { $desc = mb_substr( $desc, 0, $length ); diff --git a/templates/admin-page.php b/templates/admin-page.php index d8bfe935e..c05968a74 100644 --- a/templates/admin-page.php +++ b/templates/admin-page.php @@ -41,14 +41,14 @@
-

+

$label ) : ?>
- +