WordPress.org

Making WordPress.org

Opened 2 months ago

Closed 2 months ago

#4380 closed defect (fixed)

Plugin Directory: Be more flexible with the detected current major WP version

Reported by: Ipstenu Owned by: dd32
Milestone: Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

Looking at the code for get_current_major_wp_version, it does the following checks:

1) Is there a define set
2) If not, what version is WP.org running
3) If that version is NOT a stable release (i.e. has a - in the name), drop it down

The problem here is that value is checked when seeing if a plugin is tested up to the current stable version, and some developers want to update their code once they've tested against Beta releases. This is a good practice, and should be encouraged, however as it stands today, their plugins will throw an error if the version is higher.

This should be changed to factor in a +1 version or to allow for RCs... Or be something we can edit without messing with the define WP_CORE_LATEST_RELEASE

Change History (8)

#1 @joyously
2 months ago

But really, if plugins are testing with betas, that's not the same as a release. I don't think they should be able to say that it's tested with a release unless it actually is (more than a beta).

#2 in reply to: ↑ description @SergeyBiryukov
2 months ago

Replying to Ipstenu:

The problem here is that value is checked when seeing if a plugin is tested up to the current stable version, and some developers want to update their code once they've tested against Beta releases. This is a good practice, and should be encouraged, however as it stands today, their plugins will throw an error if the version is higher.

Related: [7874], #3936.

This should be changed to factor in a +1 version or to allow for RCs...

I haven't tested yet, but looking at the (float)$version > (float)WP_CORE_STABLE_BRANCH+0.1 condition, that seems to be the case.

Does Tested up to: 5.2 currently cause a warning? Is it a warning in the readme validator, or the "has not been tested with the latest 3 major releases" plugin banner?

#3 @Ipstenu
2 months ago

But really, if plugins are testing with betas, that's not the same as a release. I don't think they should be able to say that it's tested with a release unless it actually is (more than a beta).

Yes that's why I said to allow for RC. Not betas :)

Does Tested up to: 5.2 currently cause a warning? Is it a warning in the readme validator, or the "has not been tested with the latest 3 major releases" plugin banner?

It causes the 'has not been tested...' banner.

This ticket was mentioned in Slack in #meta by ipstenu. View the logs.


2 months ago

#5 @dd32
2 months ago

  • Owner set to dd32
  • Status changed from new to accepted

Yay PHP, or rather, Yay Floats! :)

This is because (float)'5.2' > ((float)'5.1'+0.1) is true, in other words (float)'5.2' !== (float)'5.1'+0.1 - even though the human readable version are the same when you look at the underlying values you eventually come to a 0.000000000000000000000000000000[1-9] value that trips up the calculations.

#6 @dd32
2 months ago

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

In 8626:

Plugin Directory: Readme: Fix the comparisons to allow plugins to mark their plugins as compatible with 5.2.

Fixes #4380.

#7 follow-up: @SergeyBiryukov
2 months ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The ticket was about the "has not been tested..." banner though, not the readme validator. That's why I asked in comment:2 :)

#8 in reply to: ↑ 7 @dd32
2 months ago

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

Replying to SergeyBiryukov:

The ticket was about the "has not been tested..." banner though, not the readme validator. That's why I asked in comment:2 :)

Same thing :)

The readme parser was ignoring the 5.2 value. That caused the readme validator to throw a warning, but also caused the plugin to have no tested up to value, which subsequently causes the banner to show up (stupidly IMHO, when the 'Requres at least' header was set to 5.0).

Template::is_plugin_outdated() used version_compare() already, so not a problem there

Note: See TracTickets for help on using tickets.