File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,6 +480,7 @@ protected function cleanup() {
480480 $ this ->drop_tables ();
481481 $ this ->cleanup_options ();
482482 $ this ->cleanup_cron ();
483+ $ this ->cleanup_legacy_cron ();
483484
484485 // If we got this far, let's remove the cron event.
485486 wp_clear_scheduled_hook ( 'cloudinary_cleanup_event ' );
@@ -625,4 +626,27 @@ protected function cleanup_cron() {
625626 // Delete the cron schedule option saved in database.
626627 delete_option ( Cron::CRON_META_KEY );
627628 }
629+
630+ /**
631+ * Cleanup legacy cron jobs.
632+ *
633+ * @return void
634+ */
635+ protected function cleanup_legacy_cron () {
636+ wp_clear_scheduled_hook ( 'cloudinary_status ' );
637+
638+ $ jobs = array (
639+ 'cloudinary_rest_api_connectivity ' ,
640+ 'cloudinary_resume_queue ' ,
641+ 'cloudinary_resume_upgrade ' ,
642+ 'cloudinary_sync_items ' ,
643+ );
644+
645+ foreach ( $ jobs as $ job ) {
646+ $ time = wp_next_scheduled ( $ job );
647+ if ( false !== $ time ) {
648+ wp_clear_scheduled_hook ( $ job );
649+ }
650+ }
651+ }
628652}
You can’t perform that action at this time.
0 commit comments