Skip to content

Plugins: Replace the plugin card dependency notice with a line of text. - #16164

Open
jasmussen wants to merge 2 commits into
WordPress:trunkfrom
jasmussen:try/plugin-dependencies-inline-text
Open

jasmussen wants to merge 2 commits into
WordPress:trunkfrom
jasmussen:try/plugin-dependencies-inline-text

Conversation

@jasmussen

Copy link
Copy Markdown

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

What

On the Add Plugins screen, a plugin's dependencies were listed in a <div class="plugin-dependencies notice notice-alt notice-info inline"> block rendered between .plugin-card-top and .plugin-card-bottom. The block occupied about 100px. Because the cards in a row share a height, one card with dependencies stretched every neighbour in its row.

This replaces the notice with a single line of text: Requires: followed by the dependency names, rendered inside .plugin-card-top after <p class="authors">, so it inherits the card's normal text flow and gutters.

  • The wording is "Requires", not "Also installs": core does not auto-install dependencies, the user installs them manually.
  • Each dependency's name is 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() keeps its more-details-link, thickbox and open-plugin-details-modal classes and its aria-label and data-title attributes; it takes an optional $link_text parameter so the name can be used as the link text.
  • Multiple dependencies are separated with wp_get_list_item_separator().
  • The existing unit tests for get_dependencies_notice() are updated to the new markup. 13 tests, 20 assertions, passing.

Backwards compatibility

.plugin-card .notice.plugin-dependencies, .plugin-dependency and .plugin-dependency-name no longer render, and their styles are removed from list-tables.css. Plugins may be styling or querying those selectors, and those rules will stop matching. The generic .plugin-card .notice rule is untouched, since other notices on the card use it.

Measurements

Measured at 1440px, two cards per row, card width 611px.

before after delta
Card with 1 dependency (WooCommerce Stripe Payment Gateway) 400px 318px −82px
Card with 2 dependencies (WCFM Marketplace) 431px 337px −94px
.plugin-card-top, 1 dependency 218px 238px +20px
.plugin-card-top, 2 dependencies 218px 257px +39px
36-card list, "woocommerce stripe" 6984px 5582px −1402px (−20%)

The card's text column does grow, by exactly one 20px line per rendered line. .plugin-card-top's min-height: 135px never absorbs it: across all 36 cards in both searches, .plugin-card-top ranged from 175px to 265px, so no card was ever at the min-height with slack to spare. The extra line is not free — it just costs 20px where the notice cost 101px.

The row effect is reduced but not eliminated. The neighbouring WooCommerce card (natural height 255px) is still stretched to 318px; 20px of that is the new line and the rest is the dependency card's longer description, which is out of scope here.

Screenshots

Desktop width (1440px), search "woocommerce stripe". The first row has a card with a dependency next to one without, so the shared row height is visible.

Before

before-row

After

after-row

A card with two dependencies (WCFM Marketplace, search "multivendor marketplace"):

Before

before-two-deps

After

after-two-deps

Testing instructions

  1. Apply the branch and run npm run build:dev.
  2. Visit Plugins → Add Plugin and search for woocommerce stripe.
  3. WooCommerce Stripe Payment Gateway, WooPayments and Payment Plugins for Stripe each show Requires: WooCommerce under the author line.
  4. Confirm the row containing a dependency card is no longer taller than it needs to be.
  5. Click a dependency name and confirm its plugin details modal opens.
  6. Search multivendor marketplace and confirm WCFM Marketplace lists two comma-separated dependencies, each linked.

Use of AI Tools

Claude Opus 5.

On the Add Plugins screen, a plugin's dependencies were listed in a
`notice notice-alt notice-info inline` block rendered between
`.plugin-card-top` and `.plugin-card-bottom`. The block occupied around
100px, and because the cards in a row share a height, one card with
dependencies stretched its neighbours.

The dependencies are now listed in a single line of text, `Requires:`
followed by the dependency names, rendered inside `.plugin-card-top`
after the authors line so it inherits the card's text flow and gutters.
Each dependency's name is the link to its own details modal, replacing
the separate 'More Details' link that duplicated the card's own link.

`.plugin-card .notice.plugin-dependencies`, `.plugin-dependency` and
`.plugin-dependency-name` are no longer rendered, and their styles are
removed.

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

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.

* Creates a 'More details' link for the plugin.
*
* @since 6.5.0
* @since 7.2.0 Added the `$link_text` parameter.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it will be 7.3

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, my mistake, thanks for the correction! Done.

Trunk is in the 7.2 release candidate phase, so these changes land in
7.3.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@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, mukesh27.

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.

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.

2 participants