<?php
/**
 * Deactivator — unschedule cron events. Data is preserved.
 *
 * @package WPNest_Returns_For_WooCommerce
 */

if ( ! defined( 'ABSPATH' ) ) {
    exit;
}

class WPNest_RFW_Deactivator {

    public static function deactivate() {
        $timestamp = wp_next_scheduled( 'wpnest_rfw_daily_cleanup' );
        if ( $timestamp ) {
            wp_unschedule_event( $timestamp, 'wpnest_rfw_daily_cleanup' );
        }
        flush_rewrite_rules();
    }
}
