-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing $item
properties within auto_update_plugin
filter
#7086
Comments
aaemnnosttv
changed the title
Missing slug parameter on auto_update_plugin filter
Missing May 25, 2023
$item
properties within auto_update_plugin
filter
IB ✔️ |
18 tasks
QA Update: ✅Verified:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
This is related to #6624 where I have identified that a plugin called wp fail2ban (https://wordpress.org/plugins/wp-fail2ban/) throws errors when this plugin is enabled. It appears related to issue 6624 in that it is related to the object that is passed into the hook.
It appears that the object that is passed in is missing the "slug" parameter.
Steps to reproduce
Install both google sitekit and wp-fail2ban in Wordpress. In wp-admin, errors appear at the top of the page which are:
The line of code referenced there is a comparison with $item->slug
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
$item
) passed towp_is_auto_update_forced_for_item
should be an object including all of the keys that are expected to be present in core. See examples: plugins page, site healthExample object from plugins page
Implementation Brief
includes/Core/Util/Auto_Updates.php
get_sitekit_update_data
, to fetch data from site transient or resort to fallback data when transient data is unavailable:$sitekit_update_data
slug
andplugin
keys utilizedirname( GOOGLESITEKIT_PLUGIN_BASENAME )
'w.org/plugins/' . $slug
for theid
key$plugin_updates = get_site_transient('update_plugins');
$plugin_updates->response[GOOGLESITEKIT_PLUGIN_BASENAME]
and$plugin_updates->no_update[GOOGLESITEKIT_PLUGIN_BASENAME]
for data.array
). Otherwise, use the fallback data from$sitekit_update_data
sitekit_forced_autoupdates_status
methodget_sitekit_update_data
method$sitekit_plugin_data
prior to it being included as param in thewp_is_auto_update_forced_for_item
functionTest Coverage
QA Brief
/wp-cron.php?doing_wp_cron
to the end of your test site URL in the address bar of the browser. E.g.http://sitekit.10uplabs.com/wp-cron.php?doing_wp_cron
Changelog entry
The text was updated successfully, but these errors were encountered: