add_option(UBConfig::UB_PROXY_ERROR_MESSAGE_KEY); }); register_deactivation_hook(__FILE__, function () { foreach (UBConfig::ub_option_keys() as $key) { delete_option($key); } }); add_action('init', function () { UBLogger::setup_logger(); $domain = UBConfig::domain(); if (!UBConfig::is_authorized_domain($domain)) { UBLogger::info("Domain: {$domain} has not been authorized"); return; } $start = microtime(true); $ps_domain = UBConfig::page_server_domain(); $http_method = UBUtil::array_fetch($_SERVER, 'REQUEST_METHOD'); $referer = UBUtil::array_fetch($_SERVER, 'HTTP_REFERER'); $user_agent = UBUtil::array_fetch($_SERVER, 'HTTP_USER_AGENT'); $protocol = UBHTTP::determine_protocol($_SERVER, is_ssl()); $current_path = UBUtil::array_fetch($_SERVER, 'REQUEST_URI'); $raw_url = $protocol . $ps_domain . $current_path; $current_url = $protocol . $domain . $current_path; $domain_info = UBConfig::read_unbounce_domain_info($domain, false); $proxyable_url_set = UBUtil::array_fetch($domain_info, 'proxyable_url_set', array()); UBLogger::debug_var('ps_domain', $ps_domain); UBLogger::debug_var('http_method', $http_method); UBLogger::debug_var('referer', $referer); UBLogger::debug_var('user_agent', $user_agent); UBLogger::debug_var('protocol', $protocol); UBLogger::debug_var('domain', $domain);