<?php
/**
 * Plugin Name: Tarot and Horoscope
 * Description: Integrate our Tarot and Horoscope games with our free and paid WordPress plugin. For support, please go to our websites support section.
 * Version: 1.0.4
 * Author: Tarot and Horoscope
 * Author URI: https://www.tarotandhoroscope.com
 * License: GPL v2 or later
 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
 * Text Domain: tarot-and-horoscope
 */
defined('ABSPATH') or die('No!');

// Define plugin constants
define('TAROTXHOROSCOPE_PLUGIN_FILE', __FILE__);
define('TAROTXHOROSCOPE_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('TAROTXHOROSCOPE_PLUGIN_URL', plugin_dir_url(__FILE__));

// Register admin menu and settings
add_action('admin_menu', 'tarotxhoroscope_menu');
add_action('admin_init', 'tarotxhoroscope_register_settings');
add_action('admin_init', 'tarotxhoroscope_redirect_to_settings');
add_action('admin_enqueue_scripts', 'tarotxhoroscope_admin_styles');

// Define constants
define('TAROTXHOROSCOPE_GAME_IMG_URL', TAROTXHOROSCOPE_PLUGIN_URL . 'games/images/');

// Include shortcode and API handler files
include_once TAROTXHOROSCOPE_PLUGIN_DIR . 'shortcodes/onecard.php';
include_once TAROTXHOROSCOPE_PLUGIN_DIR . 'shortcodes/dailytarot.php';
include_once TAROTXHOROSCOPE_PLUGIN_DIR . 'shortcodes/threecard.php';
include_once TAROTXHOROSCOPE_PLUGIN_DIR . 'api/api-handler.php';
include_once TAROTXHOROSCOPE_PLUGIN_DIR . 'shortcodes/monthly_horoscope.php';
include_once TAROTXHOROSCOPE_PLUGIN_DIR . 'admin/gamestyles/horoscope.php';

function tarotxhoroscope_admin_styles($hook) {
    $allowed_pages = [
        'toplevel_page_tarotxhoroscope',
        'tarot-and-horoscope_page_tarotxhoroscope_settings'
    ];

    if (in_array($hook, $allowed_pages)) {
        wp_enqueue_style(
            'tarotxhoroscope-admin-css',
            TAROTXHOROSCOPE_PLUGIN_URL . 'admin/admin-styles.css',
            array(),
            '1.0.4'
        );
    }

    $all_pages = array_merge($allowed_pages, [
        'tarot-and-horoscope_page_tarotxhoroscope_games'
    ]);

    if (in_array($hook, $all_pages)) {
        wp_enqueue_script(
            'tarotxhoroscope-admin-js',
            TAROTXHOROSCOPE_PLUGIN_URL . 'admin/admin-scripts.js',
            ['jquery'],
            '1.0.4',
            true
        );
    }
}
// Add admin menu pages
function tarotxhoroscope_menu() {
    add_menu_page(
        __('Tarot and Horoscope', 'tarot-and-horoscope'),
        __('Tarot and Horoscope', 'tarot-and-horoscope'),
        'manage_options',
        'tarotxhoroscope',
        'tarotxhoroscope_page',
        'dashicons-star-filled'
    );
    add_submenu_page(
        'tarotxhoroscope',
        __('Settings', 'tarot-and-horoscope'),
        __('Settings', 'tarot-and-horoscope'),
        'manage_options',
        'tarotxhoroscope_settings',
        'tarotxhoroscope_settings_page'
    );
    add_submenu_page(
        'tarotxhoroscope',
        __('Games', 'tarot-and-horoscope'),
        __('Games', 'tarot-and-horoscope'),
        'manage_options',
        'tarotxhoroscope_games',
        'tarotxhoroscope_games_page'
    );
}

// Register plugin settings
function tarotxhoroscope_register_settings() {
    register_setting(
        'tarotxhoroscope_settings_group',
        'tarotxhoroscope_api_key',
        'sanitize_text_field'
    );
    register_setting(
        'tarotxhoroscope_settings_group',
        'tarotxhoroscope_domain',
        'sanitize_text_field'
    );
    register_setting(
        'tarotxhoroscope_settings_group',
        'tarotxhoroscope_remove_data_on_uninstall',
        'tarotxhoroscope_sanitize_checkbox'
    );
}

function tarotxhoroscope_sanitize_checkbox($input) {
    return isset($input) && $input === 'on' ? 'on' : '';
}

// Main plugin page
function tarotxhoroscope_page() {
?>
    <div class="tarot-horoscope-container">
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopeplugin.png'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope Logo', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <h1 style="clear: both;"><?php esc_html_e('Welcome to the Official Tarot and Horoscope Plugin', 'tarot-and-horoscope'); ?></h1>
        <p><?php esc_html_e('This is the FREE version of the plugin. If you have purchased a pro license or subscription, please remove this plugin and install the pro version from your member area here -', 'tarot-and-horoscope'); ?> <a href="https://app.tarotandhoroscope.com/downloadandsetup/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Download Pro version', 'tarot-and-horoscope'); ?></a></p>
        <h2><?php esc_html_e('API Key Required', 'tarot-and-horoscope'); ?></h2>
        <p><?php esc_html_e('You need a FREE or a PRO API key in order to use this plugin. Please sign up for free and get your API key here -', 'tarot-and-horoscope'); ?> <a href="https://app.tarotandhoroscope.com/join/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Get API Key', 'tarot-and-horoscope'); ?></a></p>
        <h3><?php esc_html_e('1) Configure the plugin', 'tarot-and-horoscope'); ?></h3>
        <p><?php esc_html_e('Set your API key, and basic plugin configuration in the settings menu. Please ensure that your domain name and API key match those you set in the member area, or the games and chats will not work.', 'tarot-and-horoscope'); ?></p>
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopepluginsettings.JPG'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope Plugin Settings', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopepluginmoresettings.JPG'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope More Plugin Settings', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <p style="clear: both;"></p>
        <h3><?php esc_html_e('2) Configure the games', 'tarot-and-horoscope'); ?></h3>
        <p><?php esc_html_e('You can configure and style each game individually in the games menus. This is also where you will find the tarot readers chat box styling and configuration.', 'tarot-and-horoscope'); ?></p>
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopegamesettings.JPG'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope Plugin Settings', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopemoregamesettings.JPG'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope More Plugin Settings', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <p style="clear: both;"></p>
        <h3><?php esc_html_e('3) Using the shortcode', 'tarot-and-horoscope'); ?></h3>
        <p><?php esc_html_e('Copy the shortcode from the game settings page, for example, [tarotxhoroscope_onecard] will render the One Card Tarot game, and place it wherever you like on your website.', 'tarot-and-horoscope'); ?></p>
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopeshortcodes.JPG'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope Shortcodes', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <p class="api-key-warning" style="clear: both;"><?php esc_html_e('Please ensure that your API key is set before adding the games and tarot readers to your site. This will avoid live errors!', 'tarot-and-horoscope'); ?></p>
    </div>
<?php
}

// Settings page with API key and domain validation
function tarotxhoroscope_settings_page() {
    $api_key = get_option('tarotxhoroscope_api_key');
    $domain = get_option('tarotxhoroscope_domain');
?>
    <div class="tarot-horoscope-container" style="max-width: 800px;">
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopeplugin.png'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope Logo', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <h1 style="clear: both;"><?php esc_html_e('Tarot and Horoscope Plugin Settings', 'tarot-and-horoscope'); ?></h1>
        <form method="post" action="options.php">
            <?php
            settings_fields('tarotxhoroscope_settings_group');
            do_settings_sections('tarotxhoroscope_settings_group');
            wp_nonce_field('tarotxhoroscope_settings_save', 'tarotxhoroscope_settings_nonce');
            ?>
            <table class="form-table">
                <tr valign="top">
                    <th scope="row"><?php esc_html_e('API Key and Domain', 'tarot-and-horoscope'); ?></th>
                    <td>
                        <?php if ($api_key && $domain): ?>
                            <p><?php esc_html_e('API Key and Domain are saved. Click here to edit.', 'tarot-and-horoscope'); ?></p>
                            <button type="button" id="change_api_key_domain"><?php esc_html_e('Change', 'tarot-and-horoscope'); ?></button>
                            <div style="display: none;" id="edit_fields">
                                <input type="text" name="tarotxhoroscope_api_key" value="" class="widefat" size="50" placeholder="Enter API Key" />
                                <input type="text" name="tarotxhoroscope_domain" value="" class="widefat" size="50" placeholder="Enter Domain (e.g., example.com)" />
                                <?php submit_button(__('Save', 'tarot-and-horoscope'), 'primary', 'save_api_key_domain'); ?>
                            </div>
                        <?php else: ?>
                            <div style="display: flex; flex-direction: column; gap: 10px;">
                                <input type="text" name="tarotxhoroscope_api_key" value="" class="widefat" size="50" placeholder="Enter API Key" />
                                <input type="text" name="tarotxhoroscope_domain" value="" class="widefat" size="50" placeholder="Enter Domain (e.g., example.com)" />
                                <?php submit_button(__('Save', 'tarot-and-horoscope'), 'primary', 'submit'); ?>
                            </div>
                        <?php endif; ?>
                        <?php
                        $errors = get_settings_errors();
                        if (!empty($errors)) {
                            echo '<div class="settings-error-container" style="margin-top: 10px;">';
                            foreach ($errors as $error) {
                                $class = ($error['type'] === 'error') ? 'error' : 'notice notice-' . $error['type'];
                                echo '<div class="' . esc_attr($class) . '"><p>' . esc_html($error['message']) . '</p></div>';
                            }
                            echo '</div>';
                        }
                        ?>
                    </td>
                </tr>
                <tr valign="top">
                    <th scope="row"><?php esc_html_e('Remove all data on uninstall', 'tarot-and-horoscope'); ?></th>
                    <td>
                        <label>
                            <input type="checkbox" name="tarotxhoroscope_remove_data_on_uninstall" <?php checked(get_option('tarotxhoroscope_remove_data_on_uninstall'), 'on'); ?> />
                            <?php esc_html_e('This will ensure that all plugin settings, custom configs and game setups are removed if you uninstall the plugin.', 'tarot-and-horoscope'); ?>
                        </label>
                    </td>
                </tr>
            </table>
        </form>
    </div>
<?php
}

// Games settings pages
function tarotxhoroscope_games_page() {
    $allowed_games = ['one-card', 'daily-tarot', 'three-card', 'chatbox', 'horoscope'];

    add_action('admin_notices', function () {
        if (empty(get_option('tarotxhoroscope_api_key'))) {
            echo '<div class="error"><p>' . esc_html__('Please set your API key in the Tarot and Horoscope settings.', 'tarot-and-horoscope') . '</p></div>';
        }
    });

    $selected_game = 'one-card'; // Default
    if (isset($_POST['tarotxhoroscope_games_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['tarotxhoroscope_games_nonce'])), 'tarotxhoroscope_games_save')) {
        $selected_game = isset($_POST['selected_game']) ? sanitize_text_field(wp_unslash($_POST['selected_game'])) : 'one-card';
        $selected_game = in_array($selected_game, $allowed_games) ? $selected_game : 'one-card';
    } elseif (isset($_POST['selected_game'])) {
        
        $nonce_checks = [
            'tarotxhoroscope_daily_tarot_nonce' => 'tarotxhoroscope_daily_tarot_settings_nonce',
            'tarotxhoroscope_one_card_nonce' => 'tarotxhoroscope_one_card_settings_nonce',
            'tarotxhoroscope_three_card_nonce' => 'tarotxhoroscope_three_card_settings_nonce',
            'tarotxhoroscope_chatbox_nonce' => 'tarotxhoroscope_chatbox_settings_nonce',
            'tarotxhoroscope_horoscope_nonce' => 'tarotxhoroscope_horoscope_settings_nonce'
        ];

        $valid_nonce = false;
        foreach ($nonce_checks as $nonce_field => $nonce_action) {
            if (isset($_POST[$nonce_field]) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST[$nonce_field])), $nonce_action)) {
                $valid_nonce = true;
                break;
            }
        }

        if ($valid_nonce) {
            $selected_game = sanitize_text_field(wp_unslash($_POST['selected_game']));
            $selected_game = in_array($selected_game, $allowed_games) ? $selected_game : 'one-card';
        }
    }

?>
    <div class="wrap">
        <img src="<?php echo esc_url(TAROTXHOROSCOPE_GAME_IMG_URL . 'tarotandhoroscopeplugin.png'); ?>" alt="<?php esc_attr_e('Tarot and Horoscope Logo', 'tarot-and-horoscope'); ?>" class="tarot-logo">
        <h1 style="clear: both;"><?php esc_html_e('Tarot and Horoscope Games', 'tarot-and-horoscope'); ?></h1>
        <h3><?php esc_html_e('Select the game you want to customize. Remember to "Save all settings".', 'tarot-and-horoscope'); ?></h3>

        <form method="post" action="">
            <?php wp_nonce_field('tarotxhoroscope_games_save', 'tarotxhoroscope_games_nonce'); ?>
            <label for="selected_game" style="display: inline-block; width: 160px;"><strong><?php esc_html_e('Select Game:', 'tarot-and-horoscope'); ?></strong></label>
            <select name="selected_game" id="selected_game">
                <option value="one-card" <?php selected($selected_game, 'one-card'); ?>><?php esc_html_e('One Card Game', 'tarot-and-horoscope'); ?></option>
                <option value="daily-tarot" <?php selected($selected_game, 'daily-tarot'); ?>><?php esc_html_e('Daily Tarot Game', 'tarot-and-horoscope'); ?></option>
                <option value="three-card" <?php selected($selected_game, 'three-card'); ?>><?php esc_html_e('Three Card Game', 'tarot-and-horoscope'); ?></option>
                <option value="horoscope" <?php selected($selected_game, 'horoscope'); ?>><?php esc_html_e('Monthly Horoscope', 'tarot-and-horoscope'); ?></option>
                <option value="chatbox" <?php selected($selected_game, 'chatbox'); ?>><?php esc_html_e('Chatbox', 'tarot-and-horoscope'); ?></option>
            </select>
        </form>

        <?php
        $valid_files = [
            'one-card' => 'onecard.php',
            'daily-tarot' => 'dailytarot.php',
            'three-card' => 'threecard.php',
            'chatbox' => 'chatbox.php',
            'horoscope' => 'horoscope.php'
        ];

        if (array_key_exists($selected_game, $valid_files)) {
            $admin_file_path = plugin_dir_path(__FILE__) . 'admin/gamestyles/' . $valid_files[$selected_game];
            if (file_exists($admin_file_path)) {
                include_once $admin_file_path;
                $save_function = 'tarotxhoroscope_' . str_replace('-', '_', $selected_game) . '_admin_save';
                $form_function = 'tarotxhoroscope_' . str_replace('-', '_', $selected_game) . '_admin_form';
                if (function_exists($save_function)) {
                    call_user_func($save_function);
                }
                if (function_exists($form_function)) {
                    call_user_func($form_function, $selected_game);
                }
            }
        }
        ?>
    </div>
<?php
}

// Initialize default settings
function tarotxhoroscope_initialize_settings() {
    $default_settings = [
        'enable_card_meaning' => true,
        'enable_chat' => false,
        'button_bg_color' => '#0074bc',
        'button_text_color' => '#ffffff',
        'button_font_size' => '20px',
        'card_back_image' => TAROTXHOROSCOPE_PLUGIN_URL . 'games/images/cardbacks/TarotandHoroscope-cardbg1.png',
        'number_of_cards' => 8,
        'round_edges' => 6,
        'card_name_font_family' => 'Tahoma',
        'card_name_font_size' => '26px',
        'card_name_text_color' => '#0074bc',
        'card_meaning_font_family' => 'Tahoma',
        'card_meaning_font_size' => '16px',
        'card_meaning_text_color' => '#333333',
        'game_width' => '800px',
    ];

    $chatbox_default_settings = [
        'message_cap' => '1',
        'tah_user_message_bg_color' => '#1f61d3',
        'tah_bot_message_bg_color' => '#b20068',
        'user_message_font_color' => '#ffffff',
        'bot_message_font_color' => '#ffffff',
        'user_message_font_size' => '16px',
        'bot_message_font_size' => '16px',
        'user_message_font_family' => 'Tahoma',
        'bot_message_font_family' => 'Tahoma',
        'input_text_color' => '#707070',
        'submit_button_color' => '#006cb5',
        'submit_button_text' => 'Submit',
        'input_placeholder_text' => 'Type your message here...',
        'submit_button_text_color' => '#ffffff',
        'input_and_button_font_family' => 'Tahoma',
        'tah_chat_border_enable' => true,
        'tah_chat_border_color' => '#919191',
        'tah_chat_border_width' => '1px',
        'tah_chat_border_radius' => '8px',
        'tah_chat_welcome_message' => 'Hello, please ask me your question.',
    ];

    $horoscope_default_settings = [
        'font_family' => 'Tahoma',
        'font_size' => '16px',
        'text_color' => '#000000',
        'image_shown' => 1,
        'image_position' => 'top',
        'show_date' => 1,
        'border_enabled' => 1,
        'border_color' => '#b7b7b7',
        'border_width' => 3,
        'border_radius' => 15,
        'width' => 800
    ];

    add_option('tarotxhoroscope_chatbox_settings', $chatbox_default_settings);
    add_option('tarotxhoroscope_one_card_settings', $default_settings);
    add_option('tarotxhoroscope_daily_tarot_settings', $default_settings);
    add_option('tarotxhoroscope_three_card_settings', $default_settings);
    add_option('tarotxhoroscope_horoscope_settings', $horoscope_default_settings);
}
register_activation_hook(__FILE__, 'tarotxhoroscope_initialize_settings');

// Redirect to settings page on activation
function tarotxhoroscope_activate() {
    update_option('tarotxhoroscope_remove_data_on_uninstall', 'on');
    set_transient('tarotxhoroscope_redirect_to_settings', true, 30);
}
register_activation_hook(__FILE__, 'tarotxhoroscope_activate');

// Redirect to settings page
function tarotxhoroscope_redirect_to_settings() {
    if (get_transient('tarotxhoroscope_redirect_to_settings')) {
        delete_transient('tarotxhoroscope_redirect_to_settings');
        wp_safe_redirect(admin_url('admin.php?page=tarotxhoroscope'));
        exit;
    }
}

// Validation logic for API key and domain
add_filter('pre_update_option_tarotxhoroscope_api_key', 'tarotxhoroscope_validate_api_key_before_save', 10, 2);
add_filter('pre_update_option_tarotxhoroscope_domain', 'tarotxhoroscope_validate_domain_before_save', 10, 2);

function tarotxhoroscope_validate_api_key_before_save($new_value, $old_value) {
    if (!isset($_POST['tarotxhoroscope_settings_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['tarotxhoroscope_settings_nonce'])), 'tarotxhoroscope_settings_save')) {
        add_settings_error(
            'tarotxhoroscope_api_key',
            'invalid_nonce',
            __('Invalid security token.', 'tarot-and-horoscope'),
            'error'
        );
        return $old_value;
    }

    $domain = isset($_POST['tarotxhoroscope_domain']) ? sanitize_text_field(wp_unslash($_POST['tarotxhoroscope_domain'])) : '';
    if (empty($domain)) {
        add_settings_error(
            'tarotxhoroscope_api_key',
            'missing_domain',
            __('Domain is required.', 'tarot-and-horoscope'),
            'error'
        );
        return $old_value;
    }
    $sanitized_domain = tarotxhoroscope_sanitize_domain($domain);
    return tarotxhoroscope_validate_with_api($new_value, $sanitized_domain, $old_value);
}

function tarotxhoroscope_validate_domain_before_save($new_value, $old_value) {
    if (!isset($_POST['tarotxhoroscope_settings_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['tarotxhoroscope_settings_nonce'])), 'tarotxhoroscope_settings_save')) {
        add_settings_error(
            'tarotxhoroscope_domain',
            'invalid_nonce',
            __('Invalid security token.', 'tarot-and-horoscope'),
            'error'
        );
        return $old_value;
    }

    $api_key = isset($_POST['tarotxhoroscope_api_key']) ? sanitize_text_field(wp_unslash($_POST['tarotxhoroscope_api_key'])) : '';
    if (empty($api_key)) {
        add_settings_error(
            'tarotxhoroscope_domain',
            'missing_api_key',
            __('API Key is required.', 'tarot-and-horoscope'),
            'error'
        );
        return $old_value;
    }
    return tarotxhoroscope_sanitize_domain($new_value);
}

function tarotxhoroscope_sanitize_domain($domain) {
    $domain = strtolower(trim($domain));
    $domain = preg_replace('#^https?://#i', '', $domain);
    $domain = preg_replace('#^www\.#i', '', $domain);
    $domain = explode('/', $domain)[0];
    return sanitize_text_field($domain);
}

function tarotxhoroscope_validate_with_api($api_key, $domain, $old_value) {
    $response = wp_remote_post('https://api.tarotandhoroscope.com/validate-api-key/', [
        'method' => 'POST',
        'headers' => [
            'Content-Type' => 'application/json',
            'Authorization' => 'api-key ' . $api_key,
        ],
        'body' => wp_json_encode([
            'api_key' => $api_key,
            'domain' => $domain,
        ]),
        'timeout' => 15
    ]);

    if (is_wp_error($response)) {
        $error_message = $response->get_error_message();
        add_settings_error(
            'tarotxhoroscope_api_key',
            'api_error',
            sprintf(
                // translators: %s is the error message returned by the API.
                __('Failed to validate API key: %s', 'tarot-and-horoscope'),
                esc_html($error_message)
            ),
            'error'
        );
        return $old_value;
    }

    $body = json_decode(wp_remote_retrieve_body($response), true);
    if (isset($body['error'])) {
        add_settings_error(
            'tarotxhoroscope_api_key',
            'invalid_key',
            __('Invalid API key or domain: ', 'tarot-and-horoscope') . esc_html($body['error']),
            'error'
        );
        return $old_value;
    }

    if (isset($body['success']) && $body['success']) {
        return $api_key;
    } else {
        add_settings_error(
            'tarotxhoroscope_api_key',
            'invalid_key',
            __('Invalid API key or domain.', 'tarot-and-horoscope'),
            'error'
        );
        return $old_value;
    }
}

// Cleanup on uninstall if enabled
function tarotxhoroscope_uninstall() {
    if (get_option('tarotxhoroscope_remove_data_on_uninstall') === 'on') {
        delete_option('tarotxhoroscope_api_key');
        delete_option('tarotxhoroscope_domain');
        delete_option('tarotxhoroscope_remove_data_on_uninstall');
        delete_option('tarotxhoroscope_chatbox_settings');
        delete_option('tarotxhoroscope_one_card_settings');
        delete_option('tarotxhoroscope_daily_tarot_settings');
        delete_option('tarotxhoroscope_three_card_settings');
        delete_option('tarotxhoroscope_horoscope_settings');
    }
}
register_uninstall_hook(__FILE__, 'tarotxhoroscope_uninstall');