<?php
/**
 * Plugin Deactivator
 * 
 * Fired during plugin deactivation
 * 
 * @package VariationHub
 * @since 1.0.0
 */

namespace VariationHub;

defined('ABSPATH') || exit;

class Deactivator {
    
    /**
     * Deactivation hook
     */
    public static function deactivate() {
        // Cancel scheduled sync jobs
        if (function_exists('as_unschedule_all_actions')) {
            as_unschedule_all_actions('varihu_cache_sync_batch');
        }
        
        // Unschedule daily license validation
        Core\License_Manager::unschedule_validation();
        
        // Clear sync status
        delete_option('varihu_cache_sync_status');
        
        // NOTE: We DON'T drop the cache table or remove license data on deactivation
        // Only on uninstall (see uninstall.php)
        
        // Flush rewrite rules
        flush_rewrite_rules();
    }
}
