#61055 closed defect (bug) (fixed)
wp_update_plugins irregular transient handling.
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.8 | Priority: | normal |
| Severity: | normal | Version: | 6.6 |
| Component: | Plugins | Keywords: | has-patch needs-testing needs-test-info |
| Focuses: | Cc: |
Description
When creating $updates in wp_update_plugins(), its properties are populated immediately.
However, one property is missing, which is used later: checked.
When hooking into pre_set_site_transient_update_plugins, the checked property will be available sporadically because of this, depending on whether the $time_not_changed && ! $extra_stats branch is executed or not.
Another noteworthy issue with this function is that its implementation of set_site_transient( 'update_plugins', ... ); uses both the values $current and $updates. They store different objects at different times (1, 2).
Prepopulating both values with the same object properties would help prevent object-typing issues.
Change History (20)
#2
@
20 months ago
- Component changed from General to Plugins
- Milestone changed from Awaiting Review to 6.6
This ticket was mentioned in PR #6736 on WordPress/wordpress-develop by @snehapatil02.
18 months ago
#3
- Keywords has-patch added
### Ticket: https://core.trac.wordpress.org/ticket/61055
## Description
Ensure consistent handling of 'checked' property in wp_update_plugins() function.
- This PR addresses the irregular handling of the transient in the
wp_update_plugins()function, ensuring that the 'checked' property is always available when hooking intopre_set_site_transient_update_plugins. - It also ensures consistency between the
$currentand$updatesobjects, preventing potential issues caused by different object properties at different times.
## Changes Made
- Initialize the 'checked' property in the
$currentobject if it is not already set. - Ensure that the 'checked' property is always assigned to the
$updatesobject. - Prepopulate both
$currentand$updateswith the same 'checked' property to prevent object-typing issues. - Update the
set_site_transient('update_plugins', $updates)to store the$updatesobject consistently.
siliconforks commented on PR #6736:
18 months ago
#4
Note that there is already an existing patch (which is intended to address this problem) in this ticket:
#5
follow-up:
↓ 6
@
18 months ago
This might be a duplicate of #44118; though addressing a different issue, its resolution appears to be the same.
This ticket was mentioned in Slack in #core by nhrrob. View the logs.
18 months ago
This ticket was mentioned in Slack in #core by nhrrob. View the logs.
18 months ago
#10
@
18 months ago
- Milestone changed from 6.6 to 6.7
We are very close to RC1.
Looks like it still needs testing.
Punting to 6.7
This ticket was mentioned in Slack in #core by chaion07. View the logs.
14 months ago
#12
follow-up:
↓ 13
@
14 months ago
- Keywords needs-testing-info added
Thanks @Cybr for reporting this. We reviewed this Ticket during a recent bug-scrub session. Based on the feedback received we are adding the nedds-testing-info keyword to help with anyone hoping to run the tests. Thanks.
Props to @pratiklondhe
Cheers!
#13
in reply to:
↑ 12
@
14 months ago
Replying to chaion07:
Thanks @Cybr for reporting this. We reviewed this Ticket during a recent bug-scrub session. Based on the feedback received we are adding the nedds-testing-info keyword to help with anyone hoping to run the tests. Thanks.
Have you looked at #44118 ? There are fairly detailed steps for reproducing this issue there. Basically, to test a patch, you would need to run steps 1 and 2 before and after applying the patch. (You could also look directly at the update_plugins transient before running step 2. Without any patch, you will see that it is missing a checked property. A working patch should fix this so that it always has the checked property.)
#14
@
14 months ago
- Milestone changed from 6.7 to 6.8
With 6.7 RC1 due out any moment, this one unfortunately missed out. I've gone and moved #44118 to the 6.8 milestone along with this one to get these resolved.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
10 months ago
This ticket was mentioned in Slack in #core-test by krupajnanda. View the logs.
9 months ago
@johnbillion commented on PR #6736:
9 months ago
#19
This was fixed in r59926 with a slightly different approach. Cheers!
Related: #44118