$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); UBLogger::debug_var('current_path', $current_path); UBLogger::debug_var('raw_url', $raw_url); UBLogger::debug_var('current_url', $current_url); //////////////////// $url_purpose = UBHTTP::get_url_purpose($proxyable_url_set, $http_method, $current_url); if ($url_purpose == null) { UBLogger::debug("ignoring request to URL " . $current_url); } elseif ($url_purpose == 'HealthCheck') { if (UBConfig::domain_with_port() !== UBUtil::array_fetch($_SERVER, 'HTTP_HOST')) { http_response_code(412); } header('Content-Type: application/json'); $version = UBConfig::UB_VERSION; echo "{\"ub_wordpress\":{\"version\":\"{$version}\"}}"; exit(0); } else { // Disable caching plugins. This should take care of: // - W3 Total Cache // - WP Super Cache // - ZenCache (Previously QuickCache)