From 1dcb1a4e39da0fa336cb2f2b0f22b2ff905f5c96 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Sat, 28 Sep 2024 09:27:40 +0200 Subject: [PATCH 1/5] make table results responsive and some mobile fixes --- assets/css/plugin-check-admin.css | 52 +++++++++++++++++++++++++++++++ includes/Admin/Admin_Page.php | 7 +++++ templates/admin-page.php | 2 +- templates/results-row.php | 10 +++--- 4 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 assets/css/plugin-check-admin.css diff --git a/assets/css/plugin-check-admin.css b/assets/css/plugin-check-admin.css new file mode 100644 index 000000000..c1253e6b8 --- /dev/null +++ b/assets/css/plugin-check-admin.css @@ -0,0 +1,52 @@ +/* Responsive table */ +@media only screen and (max-width: 40em) { + #plugin-check__submit { + margin-top: 1em; + } + + table#plugin-check__categories td { + padding-bottom: .5em; + } + + table.plugin-check__results-table { + border: 0; + } + + table.plugin-check__results-table caption { + font-size: 1.3em; + } + + table.plugin-check__results-table thead { + border: none; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; + } + + table.plugin-check__results-table tr { + border-bottom: 3px solid #ddd; + display: block; + } + + table.plugin-check__results-table td { + border-bottom: 1px solid #ddd; + display: block; + font-size: .8em; + text-align: right; + } + + table.plugin-check__results-table td::before { + content: attr(data-label); + float: left; + font-weight: bold; + text-transform: uppercase; + } + + table.plugin-check__results-table td:last-child { + border-bottom: 0; + } +} \ No newline at end of file diff --git a/includes/Admin/Admin_Page.php b/includes/Admin/Admin_Page.php index 8ad4345fa..24736828b 100644 --- a/includes/Admin/Admin_Page.php +++ b/includes/Admin/Admin_Page.php @@ -184,6 +184,13 @@ public function enqueue_scripts() { true ); + wp_enqueue_style( + 'plugin-check-admin', + WP_PLUGIN_CHECK_PLUGIN_DIR_URL . 'assets/css/plugin-check-admin.css', + array(), + WP_PLUGIN_CHECK_VERSION + ); + wp_add_inline_script( 'plugin-check-admin', 'const PLUGIN_CHECK = ' . json_encode( diff --git a/templates/admin-page.php b/templates/admin-page.php index ab91ef046..7440b70d2 100644 --- a/templates/admin-page.php +++ b/templates/admin-page.php @@ -39,7 +39,7 @@ - +
$label ) { ?> diff --git a/templates/results-row.php b/templates/results-row.php index aa3a9e82d..247732201 100644 --- a/templates/results-row.php +++ b/templates/results-row.php @@ -1,17 +1,17 @@ - - - - - - - - - -
+ {{data.line}} + {{data.column}} + {{data.type}} + {{data.code}} + {{{data.message}}} <# if ( data.docs ) { #>
From 24f3736dfa27108dde4be10e4d4e52b698eb5c11 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Sun, 29 Sep 2024 12:21:18 +0200 Subject: [PATCH 2/5] support to rtl --- assets/css/plugin-check-admin.css | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/assets/css/plugin-check-admin.css b/assets/css/plugin-check-admin.css index c1253e6b8..f448e2285 100644 --- a/assets/css/plugin-check-admin.css +++ b/assets/css/plugin-check-admin.css @@ -43,8 +43,15 @@ content: attr(data-label); float: left; font-weight: bold; - text-transform: uppercase; } + + .rtl table.plugin-check__results-table td { + text-align: left; + } + + .rtl table.plugin-check__results-table td::before { + float: right; + } table.plugin-check__results-table td:last-child { border-bottom: 0; From df78a58c99faf32953d79c9cc5b8c35bb4ad6c7a Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Sun, 29 Sep 2024 12:21:26 +0200 Subject: [PATCH 3/5] better escape fit --- templates/results-row.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/results-row.php b/templates/results-row.php index 247732201..fba068492 100644 --- a/templates/results-row.php +++ b/templates/results-row.php @@ -1,17 +1,17 @@
+ {{data.line}} + {{data.column}} + {{data.type}} + {{data.code}} + {{{data.message}}} <# if ( data.docs ) { #>
From a0ccbffa5c502ccc2602806d0eef23e331e4bde3 Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Sun, 29 Sep 2024 12:44:32 +0200 Subject: [PATCH 4/5] use wordpress default responsive width --- assets/css/plugin-check-admin.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/css/plugin-check-admin.css b/assets/css/plugin-check-admin.css index f448e2285..601b35cd9 100644 --- a/assets/css/plugin-check-admin.css +++ b/assets/css/plugin-check-admin.css @@ -1,5 +1,5 @@ /* Responsive table */ -@media only screen and (max-width: 40em) { +@media screen and (max-width: 782px) { #plugin-check__submit { margin-top: 1em; } From 2779cd9776bc9300bcff8ac6458bd609cc9c206f Mon Sep 17 00:00:00 2001 From: davidperezgar Date: Tue, 1 Oct 2024 22:27:07 +0200 Subject: [PATCH 5/5] fix font --- assets/css/plugin-check-admin.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/css/plugin-check-admin.css b/assets/css/plugin-check-admin.css index 601b35cd9..7445f5511 100644 --- a/assets/css/plugin-check-admin.css +++ b/assets/css/plugin-check-admin.css @@ -31,11 +31,15 @@ border-bottom: 3px solid #ddd; display: block; } + + table.plugin-check__results-table td, + table.plugin-check__results-table code { + font-size: .9em; + } table.plugin-check__results-table td { border-bottom: 1px solid #ddd; display: block; - font-size: .8em; text-align: right; }