WordPress.org

Make WordPress Core

Opened 2 weeks ago

Last modified 3 days ago

#43987 new task (blessed)

Block plugins from updating if required PHP version is not supported

Reported by: schlessera Owned by:
Milestone: 5.0 Priority: normal
Severity: normal Version:
Component: Plugins Keywords: needs-unit-tests servehappy has-patch
Focuses: Cc:

Description

Note: This ticket is a subtask for the overarching #40934 ticket.

When a plugin states it requires a specific minimum PHP version through its "Requires PHP" header information and the server does not support this PHP version, WordPress should block any possibility to update the plugin. This way, plugins will stay at the latest release that still supports the server's PHP version.

Some initial observations:

  • The plugin infrastructure might need to be changed to allow querying for "the latest release that still supports a given PHP version".
  • Plugin authors should have a way to push security updates for older releases prior to a PHP version bump, to not leave sites behind on vulnerable plugin versions.

Attachments (12)

WHIP core - updates page.png (129.8 KB) - added by schlessera 2 weeks ago.
Mockup by @hedgefield: Rather than not showing the incompatible plugins in the Updates page at all or splitting it out somehow (you wouldn't be able to use the selection box because you wouldn't be allowed to update it), I put a message above the list to indicate there are plugins that cannot be updated.
43987.diff (4.6 KB) - added by afragen 9 days ago.
screenshot_02.png (64.7 KB) - added by afragen 9 days ago.
screenshot_03.png (107.0 KB) - added by afragen 9 days ago.
43987-1.diff (4.6 KB) - added by afragen 9 days ago.
Update notice to use 'newer' not 'higher'
43987-2.diff (4.6 KB) - added by afragen 9 days ago.
Adds jQuery removal of update class so bottom row border displays
43987-3.diff (4.6 KB) - added by afragen 7 days ago.
Use jQuery to remove update row instead of using CSS and display:none to hide
screenshot_01.png (63.7 KB) - added by afragen 7 days ago.
Latest screenshot
screenshot_02.2.png (97.2 KB) - added by afragen 7 days ago.
Latest screenshot
43986v2-1.diff (2.8 KB) - added by afragen 3 days ago.
This patch removes the extra stuff from the plugin action links and adds it to the bottom of the plugin card via a new action hook.
43987-4.diff (4.7 KB) - added by afragen 3 days ago.
Adds required PHP version info to nag on plugins.php
screenshot_02.3.png (61.3 KB) - added by afragen 3 days ago.
Shows nag with required PHP version

Download all attachments as: .zip

Change History (18)

@schlessera
2 weeks ago

Mockup by @hedgefield: Rather than not showing the incompatible plugins in the Updates page at all or splitting it out somehow (you wouldn't be able to use the selection box because you wouldn't be allowed to update it), I put a message above the list to indicate there are plugins that cannot be updated.

#1 @flixos90
2 weeks ago

  • Keywords needs-patch needs-unit-tests servehappy added
  • Milestone changed from Awaiting Review to 5.0

#2 @afragen
10 days ago

A new filter would be required to display the notice in that particular location, otherwise it displays at the top as an admin notice.

@afragen
9 days ago

#3 @afragen
9 days ago

  • Keywords has-patch added; needs-patch removed

The above patch is an initial pass.

It also address the plugins.php page by hiding the plugin row update message and adding a link element with an indication of an update.

It could be improved by having the ability to remove the update class from the parent row. This would show the bottom border.

@afragen
9 days ago

@afragen
9 days ago

This ticket was mentioned in Slack in #core-php by afragen. View the logs.


9 days ago

@afragen
9 days ago

Update notice to use 'newer' not 'higher'

@afragen
9 days ago

Adds jQuery removal of update class so bottom row border displays

@afragen
7 days ago

Use jQuery to remove update row instead of using CSS and display:none to hide

@afragen
7 days ago

Latest screenshot

@afragen
7 days ago

Latest screenshot

This ticket was mentioned in Slack in #core-php by afragen. View the logs.


3 days ago

@afragen
3 days ago

This patch removes the extra stuff from the plugin action links and adds it to the bottom of the plugin card via a new action hook.

#6 @afragen
3 days ago

Oops, attached to wrong trac ticket.

@afragen
3 days ago

Adds required PHP version info to nag on plugins.php

@afragen
3 days ago

Shows nag with required PHP version

Note: See TracTickets for help on using tickets.