WordPress / plugin-check

A repository for the new Plugin Check plugin from the WordPress Performance and Plugins Team.
https://wordpress.org/plugins/plugin-check/
GNU General Public License v2.0
266 stars 53 forks source link

Incorrect Tested up to comparison #778

Open ernilambar opened 2 weeks ago

ernilambar commented 2 weeks ago

Current WP version: 6.6

In readme:

Tested up to: 6.7.0

nonexistent_tested_upto_header is triggered which is not correct. This error should be triggered for two major versions up.

swissspidy commented 2 weeks ago

FWIW Tested up to: 6.7.0 is incorrect too, should be Tested up to: 6.7

ernilambar commented 2 weeks ago

Ideally, yes I agree. Non existent tested up to Error should be triggered for >=6.8 in above example. May be trimming down patch part in the version string given by Parser should solve the problem. WDYT?

ernilambar commented 2 weeks ago
var_dump( version_compare( '6.7', '6.7', '>' ) );  // Output false.
var_dump( version_compare( '6.7.0', '6.7', '>' ) ); // Output true.
swissspidy commented 2 weeks ago

Question is whether you want to throw a warning/error for x.x.x or not.

ernilambar commented 2 weeks ago

In the directory, I believe third part is simply ignored.

CC @dd32 Can you please confirm? Should trimming down third part would be good (and in sync with the directory)?

Zodiac1978 commented 1 week ago

I have this line in my plugin:

Tested up to: 6.6

And still get this nonexistent_tested_upto_header error, saying:

Tested up to: 6.6.
The "Tested up to" value in your plugin is not valid. This version of WordPress does not exist (yet). 

Tested on WP 6.7 RC 4, running PCP 1.2.0

ernilambar commented 1 week ago

May be this will fix ? https://github.com/WordPress/plugin-check/pull/779 Would you be able to check it?

ernilambar commented 1 week ago

@Zodiac1978 I checked with WP 6.7 RC4 and PCP 1.2( and also with trunk) but could not reproduce the error mentioned. Please create separate issue with steps to reproduce the issue. We will discuss the matter in new issue.

Zodiac1978 commented 1 week ago

@ernilambar I couldn't reproduce it with a fresh local install too, but it stays there (with the same setup) on my testserver. This makes me think why it happens and what causes this. Maybe some transient I need to delete?