<?php
/**
 * Sets default wp_options on plugin activation.
 * Uses add_option() so existing values are never overwritten.
 *
 * @package FENSE_BPVT
 */

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

function FENSE_BPVT_activate(): void
{
	$k = FENSE_BPVT_PLUGIN::DB_KEY;
	
	// General.
	add_option( $k . 'enable_dtg', false );
	add_option( $k . 'licence_key', 'YOUR_LICENCE_KEY' );
	add_option( $k . 'enable_on_custom', 'all' );
	add_option( $k . 'enable_on_logged_users', true );
	add_option( $k . 'enable_on_posts', true );
	add_option( $k . 'enable_on_pages', true );
	add_option( $k . 'enable_on_login', true );
	add_option( $k . 'enable_cache', 1 );
	
	// Links.
	add_option( $k . 'show_link', 'yes' );
	add_option( $k . 'show_link_val', 'https://fense.in/how-it-works' );
	
	// Protection.
	add_option( $k . 'protection_mode', 'message' );
	add_option( $k . 'restrict_message', 'Proxy or VPN detected - Please disable to access this website!' );
	add_option( $k . 'redirect_to_url', 'https://google.com' );
	add_option( $k . 'block_vpn', true );
	add_option( $k . 'block_proxy', true );
	add_option( $k . 'block_vps', true );
	
	// Crawlers.
	add_option( $k . 'crawlers_bots', 'yes' );
	add_option( $k . 'crawlers_bots_data',
		'Googlebot,Bingbot,Slurp,DuckDuckBot,Baiduspider,YandexBot,YandexImages,' .
		'YandexMobileBot,Twitterbot,LinkedInBot,Applebot,Pinterestbot,Sogou spider,' .
		'SemrushBot,AhrefsBot,MJ12bot,facebot,ia_archiver,Embedly,PetalBot,Discordbot,TelegramBot'
	);
	
	// IP lists.
	add_option( $k . 'ip_whitelisting_enable', false );
	add_option( $k . 'ip_blacklisting_enable', false );
	
	// Cache-Safe Mode.
	add_option( $k . 'cache_safe_mode', false );
	
	// Pages & URLs.
	add_option( $k . 'url_mode', 'exclude' );
	add_option( $k . 'specific_pages', [] );
	add_option( $k . 'url_prefixes', '' );
	add_option( $k . 'excluded_urls', '' );
}
