Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#54882 closed defect (bug) (fixed)

Allow to install/activate themes/plugin which require the next WordPress version

Reported by: ocean90's profile ocean90 Owned by: ocean90's profile ocean90
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.9
Component: Plugins Keywords: has-patch has-unit-tests dev-reviewed commit
Focuses: administration Cc:

Description

I have noticed this while creating a plugin to disable the login language switcher. As it's a feature introduced in 5.9 I have set the minimum required WP version to 5.9. Unfortunately with that setup it's not possible to test the plugin with any a beta or RC release, see attached screenshot.
The same came up after the version was bumped for Twenty Twenty-Two in [52614]. The "fix" was to skip the tests in [52617].

Im proposing to change is_wp_version_compatible() to remove any custom suffixes to ensure version_compare() can do its job right.
While is_wp_version_compatible() was introduced in 5.2, the use of the function in the list tables was added in [51678].

Note: If you think "why not set the required version to 5.9-alpha", this isn't supported, see [meta7874].

Set the milestone to 5.9.1 since it's probably too late for 5.9 although it would allow us to revert [52617].

Attachments (3)

54882.png (186.2 KB) - added by ocean90 2 years ago.
2022-01-23 18.53.23.png (200.3 KB) - added by ixkaito 2 years ago.
54882-before-after-5.9branch.png (1.5 MB) - added by hellofromTonya 2 years ago.
Test Report: before and after PR 2212 on 5.9 branch with TT2. PR resolves the issue ✅

Download all attachments as: .zip

Change History (20)

This ticket was mentioned in PR #2211 on WordPress/wordpress-develop by ocean90.


2 years ago
#1

  • Keywords has-patch added

Strip off any -alpha, -RC, -beta, -src suffixes before using version_compare(). Also, replace get_bloginfo() call with the global to ensure that plugins filtering the version for "security purposes" don't let the compatibility check fail.

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

@ocean90
2 years ago

This ticket was mentioned in Slack in #core by ocean90. View the logs.


2 years ago

This ticket was mentioned in PR #2212 on WordPress/wordpress-develop by ocean90.


2 years ago
#3

  • Keywords has-unit-tests added

#4 @desrosj
2 years ago

This makes sense to me and would prevent situations like [52617] in the future.

#5 @SergeyBiryukov
2 years ago

Makes sense to me too :) Good catch!

This ticket was mentioned in Slack in #core-themes by costdev. View the logs.


2 years ago

#7 @ixkaito
2 years ago

When I was testing with 5.9-RC3, I was also troubled because once I deactivated TT2, I couldn't reactivate it. The patches work fine for me.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


2 years ago

dd32 commented on PR #2211:


2 years ago
#9

LGTM too, I don't think unit tests are really needed for this specific change.

dd32 commented on PR #2211:


2 years ago
#10

LGTM too, I don't think unit tests are really needed for this specific change.

#11 @ocean90
2 years ago

  • Owner set to ocean90
  • Resolution set to fixed
  • Status changed from new to closed

In 52628:

Plugins/Themes: Allow to install/activate plugins/themes which require the WordPress version currently in development.

Twenty Twenty-Two requires WordPress 5.9 but currently can't be (re)activated in the 5.9 branch because version_compare( '5.9-RC3-52627', '5.9', '>=' ) as used by is_wp_version_compatible() returns false. To appreciate the testing of upcoming versions any -alpha, -RC, -beta suffixes are now stripped off from the WordPress version before checking for compatibility.

Fixes #54882.

#12 @ocean90
2 years ago

  • Keywords dev-feedback added
  • Milestone changed from 5.9.1 to 5.9
  • Resolution fixed deleted
  • Status changed from closed to reopened

It appears a RC4 is planned so I'm proposing to revert [52617] and backport [52628] to 5.9. See https://github.com/WordPress/wordpress-develop/pull/2212 for passing 5.9 tests.

#13 @SergeyBiryukov
2 years ago

  • Keywords dev-reviewed added; dev-feedback removed

Reverting [52617] and backporting [52628] sounds good to me.

@hellofromTonya
2 years ago

Test Report: before and after PR 2212 on 5.9 branch with TT2. PR resolves the issue ✅

#14 @hellofromTonya
2 years ago

  • Keywords commit added

Ran a test to view TT2 before and after the patch. Yes, [52628] resolves the issue.

I agree with @SergeyBiryukov:

#15 @ocean90
2 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 52629:

Plugins/Themes: Allow to install/activate plugins/themes which require the WordPress version currently in development.

Twenty Twenty-Two requires WordPress 5.9 but currently can't be (re)activated in the 5.9 branch because version_compare( '5.9-RC3-52627', '5.9', '>=' ) as used by is_wp_version_compatible() returns false. To appreciate the testing of upcoming versions any -alpha, -RC, -beta suffixes are now stripped off from the WordPress version before checking for compatibility.

Merges [52628] to the 5.9 branch.

Fixes #54882.

#16 @ocean90
2 years ago

In 52630:

Tests: Revert [52617].

Following [52629], the tests no longer throw an exception.

See #54318.
See #54882.

This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.


2 years ago

Note: See TracTickets for help on using tickets.