PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / trunk
Search Atlas SEO – OTTO AI SEO Automation for WordPress vtrunk
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 2.6.4 2.6.3 2.5.23 All 138 releases
metasync / includes / class-metasync-deactivator.php

class-metasync-deactivator.php in Search Atlas SEO – OTTO AI SEO Automation for WordPress trunk, at includes/class-metasync-deactivator.php

61 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Fired during plugin deactivation
5 *
6 * @link https://searchatlas.com
7 * @since 1.0.0
8 *
9 * @package Metasync
10 * @subpackage Metasync/includes
11 */
12
13 /**
14 * Fired during plugin deactivation.
15 *
16 * This class defines all code necessary to run during the plugin's deactivation.
17 *
18 * @since 1.0.0
19 * @package Metasync
20 * @subpackage Metasync/includes
21 * @author Engineering Team <support@searchatlas.com>
22 */
23 class Metasync_Deactivator
24 {
25
26 /**
27 * Short Description. (use period)
28 *
29 * Long Description.
30 *
31 * @since 1.0.0
32 */
33 public static function deactivate()
34 {
35 // add_filter('wp_sitemaps_enabled', '__return_true');
36 //delete_option( "metasync_options" );
37 //delete_option( "metasync_options_instant_indexing" );
38
39 // Clean up announce ping counter
40 delete_option('metasync_announce_attempt_count');
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);
45 }
46
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);
56
57 // Reset one-time cleanup flag so it re-runs on next activation/update
58 delete_option('metasync_wp299_cron_cleanup_done');
59 }
60 }
61