<?php
/**
 * Uninstall Script
 * 
 * Fired when the plugin is uninstalled
 */

// If uninstall not called from WordPress, exit
if (!defined('WP_UNINSTALL_PLUGIN')) {
    exit;
}

// Delete options
delete_option('seazonify_settings');

// Delete transients
delete_transient('seazonify_effects_cache');

// For multisite
if (is_multisite()) {
    global $wpdb;
    
    $seazonify_blog_ids = get_sites( array( 'fields' => 'ids', 'number' => 0 ) );
    
    foreach ($seazonify_blog_ids as $blog_id) {
        switch_to_blog($blog_id);
        
        delete_option('seazonify_settings');
        delete_transient('seazonify_effects_cache');
        
        restore_current_blog();
    }
}

