WordPress.org

Making WordPress.org

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#2338 closed defect (fixed)

API regression on return value for missing plugin

Reported by: tellyworth Owned by: dd32
Milestone: Plugin Directory v3.0 Priority: normal
Component: Plugin Directory Keywords:
Cc:

Description

There's a mismatch between the old API and new when fetching info for a plugin that doesn't exist:

https://api.wordpress.org/plugins/info/1.0/user-switching-not-a-plugin.json
null

vs

https://api.wordpress.org/plugins/info/1.0/user-switching-not-a-plugin.json?wp=1
{"error":"Plugin not found.","contributors":[]}

This trips up some clients. See https://wordpress.slack.com/archives/meta/p1482353516001438.

Change History (2)

#1 @dd32
3 years ago

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

In 4566:

Plugin Directory: Handle API failures better, and output 'null' when an individual plugin API call fails, for backwards compatibility.

Fixes #2338

#2 @dd32
3 years ago

In 4570:

Plugin Directory: Follow up to [4566]; in the event that a falsey value is sent to the client, do not convert it to an object for the PHP serialized output handler.

See #2338

Note: See TracTickets for help on using tickets.