Opened 4 years ago
Closed 4 years ago
#51609 closed defect (bug) (fixed)
Auto update remove custom API data from plugin endpoint.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | normal | Version: | 5.5.1 |
Component: | Upgrade/Install | Keywords: | has-patch |
Focuses: | administration | Cc: |
Description
I was testing some of the plugins for AwesomeMotive when I noticed that [48669] in WordPress 5.5.0 breaks backwards compatibility due to a flaw in an intended fix that WordPress had done in the point release.
The change was originally intended to ensure PHP notices would not be thrown by third party plugin updaters if any of the standard plugin update info keys were not set (by then setting that to a default) but instead it has the unintended purpose of stripping additional plugin keys.
In class-wp-plugins-list-table.php and class-wp-debug-data.php the plugins auto-update routine uses array_intersect_key()
instead of wp_parse_args()
to merge API response data with the default values.
This removes any custom values from the plugin's update API response when displaying the enable/disable link and displaying debug data in the site health check.
Many plugin updates add additional plugin data keys to the response this can cause issues. Further, this also breaks the ability for testing of patches for WordPress core/meta, as, for example, the patch to add a requires_wp
header (to allow plugins to declare a minimum WP version) can no longer be fully tested since its stripped out.
With this patch, I've changed it from using an array_intersect_key()
to the standard WordPress function for ensuring default array keys are present wp_parse_args()
which both preserves the originally intended protection from missing keys while fixing the breakage caused by the patch that was merged.
Attachments (1)
Change History (8)
#1
@
4 years ago
- Focuses administration added
- Keywords has-patch added
- Milestone changed from Awaiting Review to 5.5.3
#2
@
4 years ago
- Milestone changed from 5.5.3 to 5.6
5.5.3 shipped last week. Not planning another 5.5 minor release. Instead, moving this ticket into 5.6.
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
4 years ago
#4
@
4 years ago
Indeed, the patch makes sense to me.
It applies cleanly and the is no change on the current behavior.
Good to go on my side :)
Tested the patch and it works for me.