Skip to content

Plugins: Display required WordPress version for incompatible plugins#12691

Open
kipmyk wants to merge 8 commits into
WordPress:trunkfrom
kipmyk:fix/61211
Open

Plugins: Display required WordPress version for incompatible plugins#12691
kipmyk wants to merge 8 commits into
WordPress:trunkfrom
kipmyk:fix/61211

Conversation

@kipmyk

@kipmyk kipmyk commented Jul 25, 2026

Copy link
Copy Markdown

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.

westonruter and others added 7 commits July 4, 2026 16:52
Derive the `Disallow` and `Allow` directives in `do_robots()` from `admin_url()` and `admin_url( 'admin-ajax.php' )` rather than from a hardcoded `/wp-admin/` path built off `site_url()`. Only the URL path portion is emitted, as before, so installs that relocate or filter their admin URL now produce a correct default `robots.txt`.

Also guard the `Content-Type` header with a `headers_sent()` check to avoid a warning when the headers have already been sent.

Developed in WordPress#11998.
Follow-up to r34985.

Props masteradhoc, yogeshbhutkar, hrohh, westonruter, mukeshpanchal27, 1ucay.
Fixes #63467.


git-svn-id: https://develop.svn.wordpress.org/trunk@62633 602fd350-edb4-49c9-b593-d223f7449a82
The `ini_get()` function is called unconditionally early in the bootstrap process, so there is no need for subsequent `function_exists( 'ini_get' )` checks.

Follow-up to [44986], [45104].

Props siliconforks, shreyasikhar26, ankitkumarshah, westonruter, SergeyBiryukov.
Fixes #65423.

git-svn-id: https://develop.svn.wordpress.org/trunk@62634 602fd350-edb4-49c9-b593-d223f7449a82
This brings the `WP_Error` class to full PHPStan rule level 10 compliance.

Also make use of null coalescing operator where appropriate, and simplify `has_errors()` method.

Developed in WordPress#12405.
Follow-up to r42761, r49115, r49116.

See #64898, #64897.


git-svn-id: https://develop.svn.wordpress.org/trunk@62635 602fd350-edb4-49c9-b593-d223f7449a82
…p()` and `::chown()`.

This applies the equivalent fix which had previously been done to `::chmod()`. Tests are added for all three methods.

Developed in subset of WordPress#11593.
Follow-up to r12997.

Fixes #65584.
See #65409, WordPress#11261.


git-svn-id: https://develop.svn.wordpress.org/trunk@62636 602fd350-edb4-49c9-b593-d223f7449a82
Change the optional constructor argument of `WP_Filesystem_FTPext`, `WP_Filesystem_ftpsockets`, and `WP_Filesystem_SSH2` from an empty string default to an empty `array`, matching how the argument is actually consumed, and improve the associated DocBlocks.

These classes were also brought to adherence with PHPStan rule level 10:

* Add `FileListing` and `Options` array shapes, and initialize each transport's `$options` to a complete default array before any early return.
* Correct several inaccurate `@return` descriptions, including the `group()` methods that had been describing the owner.
* Allow `WP_Filesystem_SSH2::connect()` to be retried after a failed connection attempt.
* Stop `WP_Filesystem_FTPext::parselisting()` from leaking its intermediate date-parsing keys into the returned listing.
* Add `ext-ftp` and `ext-ssh2` to the suggested extensions in `composer.json`.

Developed in WordPress#11593.
Follow-up to r62635, r62636.

Props soean, westonruter, mukesh27.
See #65584, #64898.
Fixes #65409.


git-svn-id: https://develop.svn.wordpress.org/trunk@62637 602fd350-edb4-49c9-b593-d223f7449a82
Copilot AI review requested due to automatic review settings July 25, 2026 05:41
@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. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @SergeyBiryukov602fd350-edb4-49c9-b593-d223f7449a82.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

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

Props westonruter, mikekipruto.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the plugin installation UI to show a plugin’s minimum required WordPress version when the current site is running an incompatible WordPress version, improving the specificity of both the plugin card notice and the plugin details modal notice.

Changes:

  • Update WP_Plugin_Install_List_Table::display_rows() to display “requires WordPress X or higher” when requires is present.
  • Update install_plugin_information() to include the required minimum WordPress version in the modal footer error notice when available.
  • Add a PHPUnit test covering the updated list-table incompatible-WordPress notice output.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/phpunit/tests/admin/wpPluginInstallListTable.php Adds a test asserting the plugin card notice includes the required WP version for incompatible plugins.
src/wp-admin/includes/plugin-install.php Updates the plugin information modal notice to include the minimum required WP version when present.
src/wp-admin/includes/class-wp-plugin-install-list-table.php Updates the plugin card notice to include the minimum required WP version when present.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +640 to +645
$incompatible_notice_message .= sprintf(
/* translators: %s: Minimum required WordPress version. */
__( 'This plugin requires WordPress %s or higher.' ),
$requires_wp
);
} else {
Comment on lines +840 to +844
$compatible_wp_notice_message = sprintf(
/* translators: %s: Minimum required WordPress version. */
__( '<strong>Error:</strong> This plugin <strong>requires WordPress %s or higher</strong>.' ),
$requires_wp
);
Comment thread src/wp-admin/includes/plugin-install.php
@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.

Copilot AI review requested due to automatic review settings July 25, 2026 05:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

src/wp-admin/includes/plugin-install.php:847

  • The PR updates install_plugin_information() to include the minimum required WordPress version in the incompatibility notice, but there doesn’t appear to be any PHPUnit coverage asserting this new output. The only added test covers WP_Plugin_Install_List_Table::display_rows(), and a repo-wide search doesn’t find any tests exercising install_plugin_information().
		if ( ! empty( $requires_wp ) ) {
			$compatible_wp_notice_message = sprintf(
				/* translators: %s: Minimum required WordPress version. */
				__( '<strong>Error:</strong> This plugin <strong>requires WordPress %s or higher</strong>.' ),
				esc_html( $requires_wp )
			);
		} else {
			$compatible_wp_notice_message = __( '<strong>Error:</strong> This plugin <strong>requires a newer version of WordPress</strong>.' );
		}

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.

3 participants