<?php

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

class FENSE_BPVT_PLUGIN
{
	// INFO
	const VERSION = '3.0.2';
	const PREFIX = 'FENSE_BPVT_';
	
	// DIR PATHS
	const DIR = __DIR__;
	const PLUGIN_DIR = FENSE_BPVT_DIR;
	
	// API
	const SITE = 'https://fense.in/';
	const API = 'https://api.fense.in/';
	const RATE_LIMIT_MSG = 'rate limit exceeded';
	const RATE_LIMIT_CODE = '101';
	
	//DB
	const DB_KEY = 'FENSE_BPVT_DEVOZON_';
	
	// delete transient
	const TRANS_TO_DELETE = [
		'plugin_settings',
		'is_api_key_valid',
		'is_daily_limit_reached',
		'api_data',
		'api_data_time',
		'is_daily_limit_reached',
	];
	
	// delete transient
	const OPTIONS_TO_DELETE = [
		'api_data',
		'api_data_time',
		'tg_wp_version',
		'tg_wp_version_time',
	];
	
	public static function clean()
	{
		foreach ( FENSE_BPVT_PLUGIN::TRANS_TO_DELETE as $t ) {
			FENSE_BPVT_Cache::wp_delete( FENSE_BPVT_PLUGIN::DB_KEY . $t );
		}
		
		foreach ( FENSE_BPVT_PLUGIN::OPTIONS_TO_DELETE as $o ) {
			delete_option( FENSE_BPVT_PLUGIN::DB_KEY . $o );
		}
	}
}
