PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / 2.7.2
Search Atlas SEO – OTTO AI SEO Automation for WordPress v2.7.2
2.7.1 2.7.2 2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 All 141 releases
← All changes | includes/class-metasync-deactivator.php +16 -10 2.6.6 → 2.7.2 View file →
@@ -35,20 +35,26 @@
35 35 // add_filter('wp_sitemaps_enabled', '__return_true');
36 36 //delete_option( "metasync_options" );
37 37 //delete_option( "metasync_options_instant_indexing" );
38 38
39 - // Clean up announce ping counter and cron
39 + // Clean up announce ping counter
40 40 delete_option('metasync_announce_attempt_count');
41 - $timestamp = wp_next_scheduled('metasync_announce_cron');
42 - if ($timestamp) {
43 - wp_unschedule_event($timestamp, 'metasync_announce_cron');
41 +
42 + // Unschedule every MetaSync cron hook so no orphaned events remain after deactivation
43 + foreach (Metasync_Activator::$cron_hooks as $hook) {
44 + wp_unschedule_hook($hook);
44 45 }
45 46
46 - flush_rewrite_rules();
47 + // Soft flush only (no .htaccess rewrite). A hard flush calls
48 + // save_mod_rewrite_rules(), which opens the site's root .htaccess with an
49 + // exclusive flock(). On hosts whose cache/optimizer layer also holds that
50 + // lock (e.g. SiteGround + SG Optimizer), the deactivation request blocks on
51 + // the lock until max_execution_time and the host returns a 500 — so the
52 + // plugin never deactivates. MetaSync registers its rewrite rules via
53 + // add_rewrite_rule (stored in the `rewrite_rules` option, NOT in .htaccess),
54 + // so a soft flush fully clears them without ever touching the file.
55 + flush_rewrite_rules(false);
47 56
48 - // Unschedule DB cleanup cron so no orphaned events remain after deactivation
49 - $timestamp = wp_next_scheduled('metasync_db_cleanup');
50 - if ($timestamp) {
51 - wp_unschedule_event($timestamp, 'metasync_db_cleanup');
52 - }
57 + // Reset one-time cleanup flag so it re-runs on next activation/update
58 + delete_option('metasync_wp299_cron_cleanup_done');
53 59 }
54 60 }