| @@ -43,10 +43,18 @@ | ||
| 43 | 43 | foreach (Metasync_Activator::$cron_hooks as $hook) { |
| 44 | 44 | wp_unschedule_hook($hook); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - 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); | |
| 48 | 56 | |
| 49 | - // Reset WP-299 one-time cleanup flag so it re-runs on next activation/update | |
| 57 | + // Reset one-time cleanup flag so it re-runs on next activation/update | |
| 50 | 58 | delete_option('metasync_wp299_cron_cleanup_done'); |
| 51 | 59 | } |
| 52 | 60 | } |