WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
198 stars 39 forks source link

Improve check message #341

Closed ernilambar closed 6 months ago

ernilambar commented 6 months ago

Tasks:

ernilambar commented 6 months ago

Before: before-pr

After: after-pr

cc: @swissspidy @felixarntz @mukeshpanchal27

mukeshpanchal27 commented 6 months ago

Recoding for small plugin checks:

https://github.com/WordPress/plugin-check/assets/10103365/5dd24770-871e-4794-b832-81f658ccb607

ernilambar commented 6 months ago

To address this, we should consider adding error messages at the bottom as well, allowing users to view them without having to scroll back to the top. What do you think?

But also this wont fix the issue of shifting of output.

felixarntz commented 6 months ago

@ernilambar @mukeshpanchal27

To address this, we should consider adding error messages at the bottom as well, allowing users to view them without having to scroll back to the top. What do you think?

But also this wont fix the issue of shifting of output.

Both of this can be addressed. We can keep the notice only at the top, but we need to "reserve" the appropriate space for the notice. We can print a <style> tag on the page to make that happen (and also address https://github.com/WordPress/plugin-check/pull/341#discussion_r1434267845). Something like:

<style>
.plugin-check__results .notice:first-child {
    margin-top: # Whatever margin looks good
}

.plugin-check__results h4:first-child {
    margin-top: # Margin that is the same as the above margin plus the actual height of the notice
}
</style>

By doing that, the contents shouldn't shift any longer from the notice being added.

ernilambar commented 6 months ago

I have updated the PR with CSS. Currently I have added CSS to existing admin_footer() method because when I added new method to hook to admin_head, GitHub Action generate error like Too many public methods.