Skip to content

Plugins: Reduce the height of the plugin card dependency notice. - #16165

Open
jasmussen wants to merge 1 commit into
WordPress:trunkfrom
jasmussen:try/plugin-dependencies-standard-notice
Open

jasmussen wants to merge 1 commit into
WordPress:trunkfrom
jasmussen:try/plugin-dependencies-standard-notice

Conversation

@jasmussen

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/66781

The dependency notice in the Add Plugins cards is ~96px tall, and the height is structural rather than padding: a title row (Additional plugins are required) plus one row per dependency, inside a box the card pads to 15px where the standard .notice uses 8px 12px.

This keeps the notice and makes it a standard one.

What changed

  • WP_Plugin_Install_List_Table::get_dependencies_notice() drops the title row and renders a single description line instead, "Requires: WooCommerce", comma-separated for several dependencies, which matches the design system's documented description-only notice. The wording is "Requires", not "Also installs": core does not auto-install dependencies.
  • The dependency's name is now the link to its details modal. The separate "More Details" link is gone; it duplicated the card's own link and opened a different modal. get_more_details_link() takes an optional link text and keeps its classes and attributes exactly (more-details-link thickbox open-plugin-details-modal, aria-label, data-title).
  • list-tables.css loses padding: 15px from .plugin-card .notice.plugin-dependencies, so the notice inherits the standard notice padding of 8px 12px, and loses the flex-row rules that laid out each dependency as its own row now that the names are inline. margin: auto 20px 20px is unchanged: that is card layout, not notice styling — 20px is the card's own gutter, matching .plugin-card .plugin-icon { left: 20px } and .plugin-card .action-links { right: 20px }.

No CSS is added: the change to list-tables.css is a net deletion of 37 lines of card-specific CSS. The .plugin-dependencies wrapper and the .plugin-dependency / .plugin-dependency-name classes are kept, since plugins may be styling them — not removing them is the point of this patch. The only class that goes with the deleted title row is .plugin-dependencies-explainer-text, which had no purpose without that row.

Notice colour, border and border-radius are untouched; #16129 handles notice paint, on https://core.trac.wordpress.org/ticket/66781 and in a different file.

Height

Measured at 1440px, one dependency:

Notice box Card row
Before 81px 400px
After 49px 368px

32px saved per card (the notice box and the row it sits in both shrink by the same amount). With two dependencies the saving is larger, 112px → 49px, because the second dependency no longer gets its own row; below roughly 1150px the line wraps to two lines and the notice is 69px.

This reduces the notice's height only. Its alignment with the card's More Details link is already correct but invisible; wordpress-develop#16129 is what makes it visible.

Screenshots

Desktop width, a row where the left card has a dependency and the right card does not.

Before:

01-before-desktop

After:

02-after-desktop

Two dependencies, before and after:

03-before-two-deps 04-after-two-deps

Two dependencies wrapping at a narrower window:

05-after-two-deps-wrapped-1100px

With #16129 applied, so the notice has a visible border (not part of this branch):

06-after-with-16129-applied

Testing

  • npm run build:dev, then Add Plugins → search "woocommerce stripe". WooCommerce Stripe Payment Gateway, WooPayments and Payment Plugins for Stripe all have dependencies; WooCommerce itself does not, so the row shows both states side by side.
  • Search "events widgets for elementor" for a card with two dependencies.
  • phpcbf and phpcs are clean on the changed PHP.
  • The unit tests for get_dependencies_notice() assert the markup exactly, so their expectations are updated with the markup: 13 tests, 20 assertions, passing.

Use of AI Tools

This patch was written with Claude Code (Claude Opus 5), including the markup and CSS changes, the test updates and the measurements above. All of it was reviewed by hand.

The dependency notice in the Add Plugins cards was built as a title row
("Additional plugins are required") followed by one row per dependency,
in a box padded to `15px` instead of the standard notice padding.

Render a single description line instead, "Requires: <plugin name>", with
the dependency's name as the link to its details modal, and let the notice
inherit the standard `.notice` padding of `8px 12px`. The wrapper, the
`.plugin-dependency` and `.plugin-dependency-name` classes, and the
attributes of the details link are unchanged.

This is a net deletion of card-specific CSS: no new rules are added.

See #66781.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jasmussen jasmussen self-assigned this Nov 23, 2026
@github-actions

Copy link
Copy Markdown

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

Core Committers: Use this line as a base for the props when committing in SVN:

Props joen.

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.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant