Skip to content

Rebuild the results page with a summary, filters and grouping - #1561

Open
jakaria-istauk wants to merge 2 commits into
WordPress:trunkfrom
jakaria-istauk:update/results-page-ui
Open

jakaria-istauk wants to merge 2 commits into
WordPress:trunkfrom
jakaria-istauk:update/results-page-ui

Conversation

@jakaria-istauk

@jakaria-istauk jakaria-istauk commented Nov 29, 2026 •

Copy link
Copy Markdown

What?

Closes #1334

Rebuilds the results area of Tools › Plugin Check, and tidies the form above it, so long reports can be read and worked through:

  • A summary line with the export buttons next to it.
  • Count tiles for total, errors, warnings and files affected. Clicking a tile filters by that type.
  • A Checks sidebar listing every check that reported something, with its count. Clicking one filters to it.
  • Search across message, file and check code.
  • A filter bar: All / Errors / Warnings, a searchable check picker, and Hide development files.
  • Group by file or by check (the "sort on code" request in Proposal: Add “Collapse” and “Expand” Controls to Results Page #1334).
  • Collapsible groups with Expand all / Collapse all (the main request in Proposal: Add “Collapse” and “Expand” Controls to Results Page #1334). Each group shows 10 issues, then "Show N more".
  • The form becomes one card. Its settings fold into an Options row that lists the active ones as chips, and the row closes when a check starts.

Why?

Today the results are a flat list of tables, one per file per check, with no totals and no way to filter. On a real plugin this gets long fast. Same run of FluentSMTP (Plugin Repo category) before and after:

Before After
Page height after the run 16,635 px 2,136 px
File sections 51 tables 36 groups, one per file
Same file split across tables up to 3 times (AdminMenuHandler.php) never
Find every MissingTranslatorsComment scroll and read one click: 35 issues

The duplicate tables happen because results are drawn as each check finishes. The new view merges them into one list, so a file shows up once with all its issues.

#1334 asks for collapse/expand controls and for sorting by code. Both are in here.

How?

  • No change to how checks run. The AJAX flow (get checks, set up, run one check at a time, clean up), exports, AI analysis and the possible false positives section all work as before. Results still show up while checks run, and the summary line shows "N of M checks finished" until the run is done.
  • One list behind the view. Each check's results go into the existing aggregated trees. The view flattens them into one list and re-renders on every change. Filtering and grouping happen in the browser, with no new requests.
  • Templates. Markup stays in PHP templates rendered with wp.template. results-table.php becomes results-group.php. results-row.php is rewritten but keeps the AI badge, reasoning and recommendation. results-complete.php is removed because the summary is now static markup in admin-page.php. The footer registers the templates in a loop, and the old inline <style> block moved into plugin-check-admin.css.
  • Translations. New strings in JS use wp.i18n (__, _n, sprintf) with the plugin-check domain, which the script already loads. Template strings use PHP __().
  • Form markup. Input IDs, names and values are unchanged, so saved category preferences keep working and the Admin_Page_Tests markup assertions pass without changes.
  • Accessibility. The check picker is an ARIA combobox (role="combobox", aria-expanded, aria-activedescendant, a listbox of options). It works with ↑ / ↓ / Enter / Esc / Tab. Toggle buttons use aria-pressed, and copying a check code is announced through wp.a11y.speak.
  • Layout. The page uses logical CSS properties so it lays out correctly in RTL, and below 960px it stacks into one column.
  • "Development file" is a path check: dot-files and folders, plus tests/, test/, bin/, scripts/, node_modules/ and releases/. It only adds a tag and powers the Hide development files toggle. Nothing is excluded from the run or the exports.

Commits

  1. Restyle the check form as a card with collapsible options: form and Options row only. The results still render the old way.
  2. Rebuild the results view with a summary, filters and grouping: the new results view and templates.

Each commit leaves the page working.

Relation to #1560

This PR is based on trunk and does not depend on #1560 (.distignore exclusions). Whichever merges second needs a small rebase. If this one merges first, the .distignore checkbox from #1560 moves into the new Custom Exclusions group and shows up as a chip, and I'll do that rebase on #1560.

Testing Instructions

  1. Go to Tools › Plugin Check and pick a plugin with a fair number of issues.
  2. The settings are folded into Options, which shows the active categories and types as chips. Click it or Edit to change them.
  3. Click Check it!. Options closes, the report appears, and "N of M checks finished" counts up while groups fill in.
  4. When the run finishes, the summary line, tiles and Checks sidebar show the totals.
  5. Click Errors (tile or filter button), then a check in the sidebar. The "Showing X of Y" bar lists the active filters, and Clear filters resets them.
  6. In the check picker type part of a code, e.g. escape. Use ↑ / ↓ and Enter to pick one, and the × to clear it.
  7. Switch By file / By check, open a group, click Show N more, and try Expand all / Collapse all.
  8. Type in the search box and tick Hide development files.
  9. Click a check code chip. It copies to the clipboard.
  10. Run each export (CSV, JSON, CTRF, Markdown). They contain all results whatever the filters, same as before.
  11. Optional: with AI analysis turned on, possible false positives appear in their own collapsible section under the report.

Testing done

  • Linters. npm run lint-js, composer lint, composer phpstan, composer phpmd, PHPCS and typos pass on the branch. Commit 1 was also checked on its own with lint-js, PHPCS and Admin_Page_Tests.
  • PHPUnit. npm run test-php passes: 600 tests, 1,724 assertions. npm run test-php-multisite passes: 601 tests, 1,726 assertions.
  • In the browser. Tested by hand in Firefox on WordPress 7.1.5 with WooCommerce, against two plugins. FluentSMTP: 198 issues in 36 files. A larger plugin: 340 issues in 39 files. Covered: every filter, the picker with mouse and keyboard, both group modes, Show more, Expand / Collapse all, CSV export, and phone width (390px, no horizontal scroll).
  • Not tested. The AI false positives section, because AI analysis wasn't set up in my test site; its rendering path reuses the same group and row templates. I also didn't test with a screen reader beyond checking the ARIA attributes.

Out of scope

  • Changing which results the checks produce, or what the exports contain.
  • Excluding development files from the run. That's what .pcpignore and Add opt-in .distignore exclusions #1560 are for.
  • Absolute paths from PHPCS when a plugin directory is a symlink (common in local dev setups): Check_Result strips only the non-resolved plugin path, so those files show their full path. This happens today as well and is unrelated to this UI.

AI Usage Disclosure

  • This PR was created without the help of AI tools
  • This PR includes AI-assisted code or content

If AI tools were used, please describe how they were used:
I used Claude Code to prototype the layout, write the code and draft this description. I reviewed every change, tested it by hand in the admin and ran the linters and the full PHPUnit suite.

Screenshots or screencast

Before After
Before: settings spread out above the results, then one table per file per check After: form card, summary, count tiles, checks sidebar and collapsible file groups

A file opened. Errors first, check code under each message, links in their own column.

An expanded file group listing issues by line

Grouped by check, with the check picker open.

Results grouped by check code with the searchable check picker filtering on curl

Options expanded.

The Options row expanded into Categories, Types, AI Settings and Custom Exclusions

Phone width.

The report stacked in one column at 390px wide

Open WordPress Playground Preview

Group the plugin picker and the Check it! button in one card and fold
the category, type, AI and exclusion settings into an Options row. When
collapsed, the row lists the active settings as chips, and it closes
when a check starts so the results move up the page.

Input IDs, names and values are unchanged.
Long reports were one table per file with no way to find a check, filter
by type or see the totals, so a plugin with a few hundred issues meant a
lot of scrolling.

The results now open with a summary line and the export buttons, count
tiles that filter by type, and a sidebar listing each check that
reported issues. The list itself can be searched, filtered by type or by
a searchable check picker, have development files hidden, and be grouped
by file or by check. Groups are collapsible and show ten issues before a
Show more button.

Results still stream in one check at a time and the AJAX flow, exports,
AI analysis and the possible false positives section are unchanged.
results-table.php becomes results-group.php, and results-complete.php is
removed because the summary is now part of the page markup.

Closes WordPress#1334
@github-actions

Copy link
Copy Markdown
Contributor

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: jakaria-istauk <jakariaistauk@git.wordpress.org>
Co-authored-by: davidperezgar <davidperez@git.wordpress.org>
Co-authored-by: Tsjippy <tsjippy@git.wordpress.org>
Co-authored-by: mahdialikhanusiya <mahdiali@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@davidperezgar

Copy link
Copy Markdown
Member

This is awesome! The information is much clearer, and the organisation is much better.

@jakaria-istauk

Copy link
Copy Markdown
Author

This is awesome! The information is much clearer, and the organisation is much better.

Thank you @davidperezgar for your valuable comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Add “Collapse” and “Expand” Controls to Results Page

2 participants