<?php
/**
 * Uninstall: remove all plugin options.
 *
 * @package BOOSAIAS_For_WooCommerce
 */

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

$boosaias_options = array(
	'boosaias_version',
	'boosaias_license_key',
	'boosaias_language',
	'boosaias_telegram_chat_id',
	'boosaias_welcome_message',
	'boosaias_store_info',
	'boosaias_widget_color',
	'boosaias_store_id',
);

foreach ( $boosaias_options as $boosaias_option ) {
	delete_option( $boosaias_option );
}

delete_transient( 'boosaias_license_data' );

global $wpdb;
$boosaias_patterns = array(
	'_transient_boosaias_rl_%',
	'_transient_timeout_boosaias_rl_%',
	'_transient_boosaias_debounce_%',
	'_transient_timeout_boosaias_debounce_%',
);
foreach ( $boosaias_patterns as $boosaias_pattern ) {
	$wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s", $boosaias_pattern ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery
}
