From 183068b9b0c15326f22f5563828765b6044e7e9b Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Sun, 17 Dec 2023 12:19:21 +0545 Subject: [PATCH 1/5] Improve check message --- assets/js/plugin-check-admin.js | 8 +++++++- templates/admin-page.php | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/js/plugin-check-admin.js b/assets/js/plugin-check-admin.js index 45b35d03d..d4eebea53 100644 --- a/assets/js/plugin-check-admin.js +++ b/assets/js/plugin-check-admin.js @@ -236,6 +236,8 @@ */ async function runChecks( data ) { let isSuccessMessage = true; + const allResults = []; + for ( let i = 0; i < data.checks.length; i++ ) { try { const results = await runCheck( data.plugin, data.checks[ i ] ); @@ -247,13 +249,17 @@ ) { isSuccessMessage = false; } - renderResults( results ); + allResults.push( results ); } catch ( e ) { // Ignore for now. } } renderResultsMessage( isSuccessMessage ); + + for ( let i = 0; i < allResults.length; i++ ) { + renderResults( allResults[ i ] ); + } } /** diff --git a/templates/admin-page.php b/templates/admin-page.php index 65338e975..19203f698 100644 --- a/templates/admin-page.php +++ b/templates/admin-page.php @@ -65,6 +65,8 @@ +
+
From cfef8ab3044eedb7aa7f18ce50030add1298f269 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Thu, 21 Dec 2023 16:45:33 +0545 Subject: [PATCH 2/5] Avoid array to results --- assets/js/plugin-check-admin.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/assets/js/plugin-check-admin.js b/assets/js/plugin-check-admin.js index d4eebea53..8f2750bca 100644 --- a/assets/js/plugin-check-admin.js +++ b/assets/js/plugin-check-admin.js @@ -236,8 +236,6 @@ */ async function runChecks( data ) { let isSuccessMessage = true; - const allResults = []; - for ( let i = 0; i < data.checks.length; i++ ) { try { const results = await runCheck( data.plugin, data.checks[ i ] ); @@ -249,17 +247,13 @@ ) { isSuccessMessage = false; } - allResults.push( results ); + renderResults( results ); } catch ( e ) { // Ignore for now. } } renderResultsMessage( isSuccessMessage ); - - for ( let i = 0; i < allResults.length; i++ ) { - renderResults( allResults[ i ] ); - } } /** @@ -275,13 +269,11 @@ ? pluginCheck.successMessage : pluginCheck.errorMessage; - resultsContainer.innerHTML += renderTemplate( - 'plugin-check-results-complete', - { + resultsContainer.innerHTML = + renderTemplate( 'plugin-check-results-complete', { type: messageType, message: messageText, - } - ); + } ) + resultsContainer.innerHTML; } /** From 7d66976c6fb5898d152689ffaf4998c61d26c41a Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Tue, 2 Jan 2024 11:38:15 +0545 Subject: [PATCH 3/5] Remove br tag --- templates/admin-page.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/templates/admin-page.php b/templates/admin-page.php index 19203f698..65338e975 100644 --- a/templates/admin-page.php +++ b/templates/admin-page.php @@ -65,8 +65,6 @@ -
-
From b2e585d9261496718598e33218e423b7b1e6d71e Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Wed, 3 Jan 2024 12:02:43 +0545 Subject: [PATCH 4/5] Add styling for checks message --- includes/Admin/Admin_Page.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/includes/Admin/Admin_Page.php b/includes/Admin/Admin_Page.php index ba790c737..7dc652f8d 100644 --- a/includes/Admin/Admin_Page.php +++ b/includes/Admin/Admin_Page.php @@ -272,6 +272,26 @@ public function admin_footer() { 'type' => 'text/template', ) ); + + // Print check's page styles. + echo ''; } /** From cf39c42dc3a05cdfdb427570375aafe0bbff9a16 Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Thu, 4 Jan 2024 10:23:24 +0545 Subject: [PATCH 5/5] Simplify CSS for check message --- includes/Admin/Admin_Page.php | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/includes/Admin/Admin_Page.php b/includes/Admin/Admin_Page.php index 7dc652f8d..309e9f548 100644 --- a/includes/Admin/Admin_Page.php +++ b/includes/Admin/Admin_Page.php @@ -272,26 +272,22 @@ public function admin_footer() { 'type' => 'text/template', ) ); - - // Print check's page styles. - echo ''; + #plugin-check__results h4:first-child { + margin-top: 80.5px; + } + @media ( max-width: 782px ) { + #plugin-check__results h4:first-child { + margin-top: 88.5px; + } + } + +