Make WordPress Core

Opened 2 years ago

Last modified 7 weeks ago

#61211 new enhancement

List minimum version required when showing plugins that are "Incompatible with your version of WordPress"

Reported by: JeffPaul Owned by:
Priority: low Milestone: Awaiting Review
Component: Plugins Version:
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description

I happened to be testing something using WordPress 5.9.9 and went to add a plugin, in the example screenshot Gutenberg is the example here, and saw the standard "This plugin doesn’t work with your version of WordPress. Please update WordPress." and "Incompatible with your version of WordPress" error messaging on the plugin card (I'll leave aside the fact that double messaging here is probably not necessary).

The item that would be helpful alongside the error messaging is the minimum version of the plugin that is required. In the case of the Gutenberg example I have to click "More Details" to get the plugin modal overlay showing that at the current day Gutenberg "Requires WordPress Version: 6.4 or higher". Having that 6.4 version noted within the plugin card would be helpful context. Perhaps updating the first error message to something more like "This plugin doesn’t work with your version of WordPress. Please update WordPress 6.4 or newer." would be a more helpful error message.

Attachments (1)

Gutenberg-plugin-card.png​ (73.2 KB ) - added by JeffPaul 2 years ago.
Gutenberg plugin card on WordPress version 5.9.9

Download all attachments as: .zip

Change History (5)

@JeffPaul
2 years ago

Gutenberg plugin card on WordPress version 5.9.9

#1 @jorbin
2 years ago

As it's possible for a plugin to have its minimum set to a version that is not supported by WordPress, I worry that this could come across as WordPress encouraging a user to update from one unsupported version to another.

#2 @JeffPaul
2 years ago

@jorbin fair; presumably we could have a lower and upper bounds for what is presented and if the plugin reports outside that range then we show the more generic non-version noted text?

This ticket was mentioned in ​PR #12691 on ​WordPress/wordpress-develop by ​@mikekipruto.


2 months ago
#3

  • Keywords has-patch has-unit-tests added; needs-patch removed

### Description
When a plugin is incompatible with the user's current version of WordPress, the plugin card notice and details modal footer notice previously displayed a generic message (*"This plugin does not work with your version of WordPress"*).

This PR updates WP_Plugin_Install_List_Table::display_rows() and install_plugin_information() to output the required minimum version string directly when $requires_wp is available (e.g., *"This plugin requires WordPress 6.5 or higher"*).

### Testing Instructions

#### 1. Automated PHPUnit Test
Run the test suite for WP_Plugin_Install_List_Table:

vendor/bin/phpunit tests/phpunit/tests/admin/wpPluginInstallListTable.php

Verify that test_display_rows_incompatible_wp_displays_required_version passes.

#### 2. Manual Verification

  1. Open wp-admin/plugin-install.php in your browser.
  2. Filter or mock a plugin API response where requires is set to a future version (e.g., 99.0).
  3. Verify that the plugin card notice displays:

    *"This plugin requires WordPress 99.0 or higher. Please update WordPress."*

  4. Click More Details on the card and verify the modal footer notice displays:

    *"Error: This plugin requires WordPress 99.0 or higher."*

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

## Use of AI Tools

AI assistance: Yes
Tool(s): Visual Studio Code
Model(s): Claude Opus 5
Used for: Identifying the ticket, writing unit tests, and verifying WordPress Coding Standards (PHPCS) compliance.

---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See ​GitHub Pull Requests for Code Review in the Core Handbook for more details.
`

​@JeffPaul commented on ​PR #12691:


7 weeks ago
#4

@aaronjorbin tagging you here as you had some concerns on the source trac ticket: https://core.trac.wordpress.org/ticket/61211

Note: See TracTickets for help on using tickets.