WordPress.org

Making WordPress.org

Opened 4 months ago

Closed 4 months ago

#4468 closed defect (fixed)

Plugin Update Check API returns tested field without patch version

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

Description

When plugins specify Tested up to: in their readme.txt, the Plugin Directory will append the current patch version number as there should be no breaking changes. This seems not to be reflected in the Plugin Update Check API, causing WordPress Core to show incorrect compatibility info.

For example the plugin Contact Form 7:
The readme.txt of the stable tag has set Tested up to: 5.2
Plugin Directory page shows Tested up to: 5.2.1
Plugins Info API 1.0 returns tested: 5.2.1
Plugins Info API 1.2 returns tested: 5.2.1

Result from the Update Check API (https://api.wordpress.org/plugins/update-check/1.1/) (trimmed):

{
  "plugins": {
    "contact-form-7/wp-contact-form-7.php": {
      "id": "w.org/plugins/contact-form-7",
      "slug": "contact-form-7",
      "plugin": "contact-form-7/wp-contact-form-7.php",
      "new_version": "5.1.3",
      "url": "https://wordpress.org/plugins/contact-form-7/",
      "package": "https://downloads.wordpress.org/plugin/contact-form-7.5.1.3.zip",
      "icons": {
        "2x": "https://ps.w.org/contact-form-7/assets/icon-256x256.png?rev=984007",
        "1x": "https://ps.w.org/contact-form-7/assets/icon-128x128.png?rev=984007"
      },
      "banners": {
        "2x": "https://ps.w.org/contact-form-7/assets/banner-1544x500.png?rev=860901",
        "1x": "https://ps.w.org/contact-form-7/assets/banner-772x250.png?rev=880427"
      },
      "banners_rtl": [],
      "tested": "5.2",
      "requires_php": false,
      "compatibility": []
    }
  },
  "translations": [],
  "no_update": {}
}

Here, only 5.2 is returned for tested. This causes the WordPress Core update screen to show Compatibility with WordPress 5.2.1: Unknown.

Given that the respective check in Core hasn't been touched in 9 months, it seems that the Plugin Check API changed its behaviour.

Attachments (1)

update-screen.png (47.6 KB) - added by abrain 4 months ago.
Update Screen showing incorrect compatibility info

Download all attachments as: .zip

Change History (6)

@abrain
4 months ago

Update Screen showing incorrect compatibility info

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


4 months ago

#2 @dd32
4 months ago

  • Component changed from API to Plugin Directory
  • Owner set to dd32
  • Status changed from new to accepted

This is caused by a few different things:

  • Every hour the tested fields get updated if a new version becomes available. This needs to happen a little bit more often than hourly I think (or triggered by seeing $wp_version change)
  • Every hour (and following a commit) the plugin data gets sync'd over to the source-data of the Update API, which attempts to clear the caches for the API endpoints. Unfortunately it only checks the last_updated field and the automatic increase of the tested field doesn't trigger that.

I think the job that bumps the tested versions also needs to trigger the API tasks, which I'll take a look into

#3 @dd32
4 months ago

Also just a note, I've refreshed the plugin update results for 5.2.1 - and it should be fixed by 5.2.2 happens.

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


4 months ago

#5 @dd32
4 months ago

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

In 8918:

Plugin Directory: Jobs: Update the Tested-up-to version in the API update-check endpoints when the plugin directory automatically bumps the tested-up-to value for plugins.

This also runs the 'Meta Sync' cron task whenever a new WordPress release is made, to help speed up the rate at which Plugins show the latest version in their 'tested' fields.

Fixes #4468.

Note: See TracTickets for help on using tickets.