| @@ -29,8 +29,18 @@ | ||
| 29 | 29 | if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { |
| 30 | 30 | exit; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | +// Consent-gated churn signal. Sent first, while the consent option still | |
| 34 | +// exists below; sends nothing when the site never opted in. The plugin main | |
| 35 | +// file is not loaded during uninstall, so the key constant it normally | |
| 36 | +// defines must be defined here or track() is a silent no-op. | |
| 37 | +if ( ! defined( 'METASYNC_POSTHOG_API_KEY' ) ) { | |
| 38 | + define( 'METASYNC_POSTHOG_API_KEY', getenv('METASYNC_POSTHOG_API_KEY') !== false ? getenv('METASYNC_POSTHOG_API_KEY') : 'phc_ntSayCJE7Ad9eBHRG6ygBaY4BJMa8rFjXcXESun9ftkh' ); // gitleaks:allow -- public write-only PostHog project key | |
| 39 | +} | |
| 40 | +require_once plugin_dir_path( __FILE__ ) . 'includes/class-metasync-posthog.php'; | |
| 41 | +Metasync_PostHog::get_instance()->track( 'plugin_uninstalled', array() ); | |
| 42 | + | |
| 33 | 43 | /** |
| 34 | 44 | * Remove plugin data for the current site. |
| 35 | 45 | * |
| 36 | 46 | * @return void |
| @@ -62,8 +72,9 @@ | ||
| 62 | 72 | 'metasync_media_batch_optimize_cron', |
| 63 | 73 | 'metasync_check_debug_limits', |
| 64 | 74 | 'metasync_speed_cache_cleanup', |
| 65 | 75 | 'metasync_bing_indexnow_submit_event', |
| 76 | + 'metasync_ph_flush_rollups', | |
| 66 | 77 | ); |
| 67 | 78 | foreach ( $cron_hooks as $cron_hook ) { |
| 68 | 79 | wp_clear_scheduled_hook( $cron_hook ); |
| 69 | 80 | } |