<?php
/**
 * Fired during plugin deactivation.
 *
 * @package    WPFMJ
 * @subpackage WPFMJ/includes
 */

class WPFMJ_Deactivator {

    /**
     * Deactivate the plugin.
     */
    public static function deactivate() {
        // Clear scheduled cron jobs
        $timestamp = wp_next_scheduled('wpfmj_cleanup_error_logs');
        if ($timestamp) {
            wp_unschedule_event($timestamp, 'wpfmj_cleanup_error_logs');
        }

        // Flush rewrite rules
        flush_rewrite_rules();

        // Note: We don't delete data on deactivation.
        // Data is only removed if the user explicitly uninstalls the plugin.
    }
}
