[wp-trac] [WordPress Trac] #60540: Plugin dependencies: guard against unexpected responses to the `plugin_information` API endpoint

WordPress Trac noreply at wordpress.org
Wed Feb 14 18:03:05 UTC 2024


#60540: Plugin dependencies: guard against unexpected responses to the
`plugin_information` API endpoint
--------------------------+---------------------
 Reporter:  pbiron        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.5
Component:  Plugins       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+---------------------

Comment (by pbiron):

 For instance, suppose a "site-specific" plugin adds a `Required Plugins:
 gravityforms` header.  Gravity Forms is one such plugin that hooks in the
 Plugins API and returns a response to the `plugin_information` endpibnt.

 However, it's response does not contain the `slug` property.  The existing
 6.5 Beta 1 code expects `slug` to be populated in the response...and a
 `Undefined property: $slug` PHP run-time error is generated in this case.
 While that is a bug in GF to not populate that field in the response, we
 should account for missing properties in the API responses.

 Note: I realize that no plugin will be allowed in the .org repo that would
 have a `Required Plugins` header with slugs of plugins that are not in the
 .org repo, there is nothing stopping "site-specific" plugins from doing
 so.  Hence, we should make sure that doing so does not cause run-time PHP
 errors.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60540#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list