<?php
/**
 * Uninstall handler for ID Business Listing.
 *
 * Fired when the plugin is deleted via the WordPress admin.
 *
 * @package ID_Business_Listing
 * @license GPL-2.0-or-later
 */

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

// Remove plugin options.
delete_option( 'blm_business_data' );
delete_option( 'blm_connection_status' );
delete_option( 'blm_last_updated' );
delete_transient( 'blm_activation_redirect' );

// Clean up Freemius SDK data.
if ( file_exists( dirname( __FILE__ ) . '/vendor/freemius/wordpress-sdk/start.php' ) ) {
    require_once dirname( __FILE__ ) . '/id-business-listing.php';

    if ( function_exists( 'idblm_fs' ) ) {
        idblm_fs()->add_action( 'after_uninstall', function () {
            // Plugin-specific cleanup already handled above.
        } );
    }
}
