-
Notifications
You must be signed in to change notification settings - Fork 293
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
Remove scheduled events upon deactivation or uninstall #6992
Comments
@aaemnnosttv tagging you here for visibility. |
@aaemnnosttv Are you still planning to work on this soon? If not, could you please unassign yourself so someone else can pick it up? Thank you! |
Closing in favor of #8988 |
I will comment on #8988 as well but I do not agree that this should be closed in favour of that issue. As per WordPress WP Cron recommendations, tasks should be unscheduled when they are no-longer required and doing so on a deactivation hook (as recommended by WordPress) cannot have a detrimental effect because the plugin is no longer active! Should the plugin be re-activated, the missing / required tasks will be added again by the plugin anyway. |
Thanks @webd-uk, I agree, this issue is still valid 👍 |
@zutigrm it should be done in the
The same here, we should do it in the |
@eugene-manuilov Thanks! Didn't see we have that file. IB Updated |
Thanks. IB ✔️ |
…ed-events Clear all scheduled events on deactivation/reset.
QA Update
|
Hi @kelvinballoo. This is expected because the |
QA Update ✅Thanks for the confirmation @nfmohit.
Note that for 'Reset' scenario, there will be one event left and that is expected.
Reset (tested reset from SK admin settings and also Tools > Available Tools):
reset.site.kit.cron.-.1.remaining.movDeactivation: Plugin.deactivation.-.all.sk.events.gone.movDeletion: Plugin.deletion.-.all.events.are.gone.mov |
Bug Description
As suggested by a user in the forums, consider allowing users to remove any cron events upon via a hook, or an option to remove such events upon uninstall or deactivation.
The cron event highlighted by the user is
googlesitekit_cron_update_remote_features
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
OAuth_Client::CRON_REFRESH_PROFILE_DATA
Remote_Features_Cron:CRON_ACTION
Synchronize_AdSenseLinked::CRON_SYNCHRONIZE_ADSENSE_LINKED
Synchronize_AdsLinked:CRON_SYNCHRONIZE_ADS_LINKED
Synchronize_Property:CRON_SYNCHRONIZE_PROPERTY
includes/Core/Util/Uninstallation.php
register
method, hook intogooglesitekit_deactivation
andgooglesitekit_reset
and remove all listed CRON events. You can usewp_clear_scheduled_hook
.googlesitekit_uninstallation
hook as wellTest Coverage
QA Brief
conversionReporting
feature flag (as that includes one of the cron events).Changelog entry
The text was updated successfully, but these errors were encountered: