• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wfConfig类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wfConfig的典型用法代码示例。如果您正苦于以下问题:PHP wfConfig类的具体用法?PHP wfConfig怎么用?PHP wfConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了wfConfig类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: call

 public function call($action, $getParams = array(), $postParams = array(), $forceSSL = false)
 {
     $apiURL = $this->getAPIURL();
     //Sanity check. Developer should call wfAPI::SSLEnabled() to check if SSL is enabled before forcing SSL and return a user friendly msg if it's not.
     if ($forceSSL && !preg_match('/^https:/i', $apiURL)) {
         //User's should never see this message unless we aren't calling SSLEnabled() to check if SSL is enabled before using call() with forceSSL
         throw new Exception("SSL is not supported by your web server and is required to use this function. Please ask your hosting provider or site admin to install cURL with openSSL to use this feature.");
     }
     $json = $this->getURL($apiURL . '/v' . WORDFENCE_API_VERSION . '/?' . $this->makeAPIQueryString() . '&' . self::buildQuery(array_merge(array('action' => $action), $getParams)), $postParams);
     if (!$json) {
         throw new Exception("We received an empty data response from the Wordfence scanning servers when calling the '{$action}' function.");
     }
     $dat = json_decode($json, true);
     if (isset($dat['_isPaidKey'])) {
         wfConfig::set('keyExpDays', $dat['_keyExpDays']);
         if ($dat['_keyExpDays'] > -1) {
             wfConfig::set('isPaid', 1);
         } else {
             if ($dat['_keyExpDays'] < 0) {
                 wfConfig::set('isPaid', '');
             }
         }
     }
     if (!is_array($dat)) {
         throw new Exception("We received a data structure that is not the expected array when contacting the Wordfence scanning servers and calling the '{$action}' function.");
     }
     if (is_array($dat) && isset($dat['errorMsg'])) {
         throw new Exception($dat['errorMsg']);
     }
     return $dat;
 }
开发者ID:adams0917,项目名称:woocommerce_eht,代码行数:31,代码来源:wfAPI.php


示例2: getURL

 protected function getURL($url, $postParams = array())
 {
     wordfence::status(4, 'info', "Calling Wordfence API v" . WORDFENCE_API_VERSION . ":" . $url);
     if (!function_exists('wp_remote_post')) {
         require_once ABSPATH . WPINC . 'http.php';
     }
     $ssl_verify = (bool) wfConfig::get('ssl_verify');
     $args = array('timeout' => 900, 'user-agent' => "Wordfence.com UA " . (defined('WORDFENCE_VERSION') ? WORDFENCE_VERSION : '[Unknown version]'), 'body' => $postParams, 'sslverify' => $ssl_verify);
     if (!$ssl_verify) {
         // Some versions of cURL will complain that SSL verification is disabled but the CA bundle was supplied.
         $args['sslcertificates'] = false;
     }
     $response = wp_remote_post($url, $args);
     $this->lastHTTPStatus = (int) wp_remote_retrieve_response_code($response);
     if (is_wp_error($response)) {
         $error_message = $response->get_error_message();
         throw new Exception("There was an " . ($error_message ? '' : 'unknown ') . "error connecting to the the Wordfence scanning servers" . ($error_message ? ": {$error_message}" : '.'));
     }
     if (!empty($response['response']['code'])) {
         $this->lastHTTPStatus = (int) $response['response']['code'];
     }
     if (200 != $this->lastHTTPStatus) {
         throw new Exception("We received an error response when trying to contact the Wordfence scanning servers. The HTTP status code was [{$this->lastHTTPStatus}]");
     }
     $this->curlContent = wp_remote_retrieve_body($response);
     return $this->curlContent;
 }
开发者ID:rootwork,项目名称:friendsoffifth,代码行数:27,代码来源:wfAPI.php


示例3: call

 public function call($action, $getParams = array(), $postParams = array())
 {
     $json = $this->getURL($this->getAPIURL() . '/v' . WORDFENCE_API_VERSION . '/?' . $this->makeAPIQueryString() . '&' . self::buildQuery(array_merge(array('action' => $action), $getParams)), $postParams);
     if (!$json) {
         throw new Exception("We received an empty data response from the Wordfence scanning servers when calling the '{$action}' function.");
     }
     $dat = json_decode($json, true);
     if (isset($dat['_isPaidKey'])) {
         wfConfig::set('keyExpDays', $dat['_keyExpDays']);
         if ($dat['_keyExpDays'] > -1) {
             wfConfig::set('isPaid', 1);
         } else {
             if ($dat['_keyExpDays'] < 0) {
                 wfConfig::set('isPaid', '');
             }
         }
     }
     if (!is_array($dat)) {
         throw new Exception("We received a data structure that is not the expected array when contacting the Wordfence scanning servers and calling the '{$action}' function.");
     }
     if (is_array($dat) && isset($dat['errorMsg'])) {
         throw new Exception($dat['errorMsg']);
     }
     return $dat;
 }
开发者ID:vegardvelle,项目名称:radikalportal,代码行数:25,代码来源:wfAPI.php


示例4: verifyCrawlerPTR

 public static function verifyCrawlerPTR($hostPattern, $IP)
 {
     global $wpdb;
     $table = $wpdb->base_prefix . 'wfCrawlers';
     $db = new wfDB();
     $IPn = wfUtils::inet_aton($IP);
     $status = $db->querySingle("select status from {$table} where IP=%s and patternSig=UNHEX(MD5('%s')) and lastUpdate > unix_timestamp() - %d", $IPn, $hostPattern, WORDFENCE_CRAWLER_VERIFY_CACHE_TIME);
     if ($status) {
         if ($status == 'verified') {
             return true;
         } else {
             return false;
         }
     }
     $wfLog = new wfLog(wfConfig::get('apiKey'), wfUtils::getWPVersion());
     $host = wfUtils::reverseLookup($IP);
     if (!$host) {
         $db->queryWrite("insert into {$table} (IP, patternSig, status, lastUpdate, PTR) values (%s, UNHEX(MD5('%s')), '%s', unix_timestamp(), '%s') ON DUPLICATE KEY UPDATE status='%s', lastUpdate=unix_timestamp(), PTR='%s'", $IPn, $hostPattern, 'noPTR', '', 'noPTR', '');
         return false;
     }
     if (preg_match($hostPattern, $host)) {
         $resultIPs = gethostbynamel($host);
         $addrsMatch = false;
         foreach ($resultIPs as $resultIP) {
             if ($resultIP == $IP) {
                 $addrsMatch = true;
                 break;
             }
         }
         if ($addrsMatch) {
             $db->queryWrite("insert into {$table} (IP, patternSig, status, lastUpdate, PTR) values (%s, UNHEX(MD5('%s')), '%s', unix_timestamp(), '%s') ON DUPLICATE KEY UPDATE status='%s', lastUpdate=unix_timestamp(), PTR='%s'", $IPn, $hostPattern, 'verified', $host, 'verified', $host);
             return true;
         } else {
             $db->queryWrite("insert into {$table} (IP, patternSig, status, lastUpdate, PTR) values (%s, UNHEX(MD5('%s')), '%s', unix_timestamp(), '%s') ON DUPLICATE KEY UPDATE status='%s', lastUpdate=unix_timestamp(), PTR='%s'", $IPn, $hostPattern, 'fwdFail', $host, 'fwdFail', $host);
             return false;
         }
     } else {
         $db->queryWrite("insert into {$table} (IP, patternSig, status, lastUpdate, PTR) values (%s, UNHEX(MD5('%s')), '%s', unix_timestamp(), '%s') ON DUPLICATE KEY UPDATE status='%s', lastUpdate=unix_timestamp(), PTR='%s'", $IPn, $hostPattern, 'badPTR', $host, 'badPTR', $host);
         return false;
     }
 }
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:41,代码来源:wfCrawl.php


示例5: wfDiagnostic

<?php

$diagnostic = new wfDiagnostic();
$plugins = get_plugins();
$activePlugins = array_flip(get_option('active_plugins'));
$activeNetworkPlugins = is_multisite() ? array_flip(wp_get_active_network_plugins()) : array();
$muPlugins = get_mu_plugins();
$themes = wp_get_themes();
$currentTheme = wp_get_theme();
$cols = 3;
$w = new wfConfig();
?>

<div class="wrap wordfence">
	<?php 
require 'menuHeader.php';
?>
	<h2 id="wfHeading">
		Diagnostics
	</h2>
	<br clear="both"/>
	
	<?php 
$rightRail = new wfView('marketing/rightrail', array('additionalClasses' => 'wordfenceRightRailDiagnostics'));
echo $rightRail;
?>

	<form id="wfConfigForm">
		<table class="wf-table"<?php 
echo !empty($inEmail) ? ' border=1' : '';
?>
开发者ID:GafaMX,项目名称:operaciondespierta.org,代码行数:31,代码来源:menu_diagnostic.php


示例6: getIPsGeo

 public static function getIPsGeo($IPs)
 {
     //works with int or dotted. Outputs same format it receives.
     $IPs = array_unique($IPs);
     $toResolve = array();
     $db = new wfDB();
     global $wpdb;
     $locsTable = $wpdb->base_prefix . 'wfLocs';
     $IPLocs = array();
     foreach ($IPs as $IP) {
         $isBinaryIP = !self::isValidIP($IP);
         if ($isBinaryIP) {
             $ip_printable = wfUtils::inet_ntop($IP);
             $ip_bin = $IP;
         } else {
             $ip_printable = $IP;
             $ip_bin = wfUtils::inet_pton($IP);
         }
         $row = $db->querySingleRec("select IP, ctime, failed, city, region, countryName, countryCode, lat, lon, unix_timestamp() - ctime as age from " . $locsTable . " where IP=%s", $ip_bin);
         if ($row) {
             if ($row['age'] > WORDFENCE_MAX_IPLOC_AGE) {
                 $db->queryWrite("delete from " . $locsTable . " where IP=%s", $row['IP']);
             } else {
                 if ($row['failed'] == 1) {
                     $IPLocs[$ip_printable] = false;
                 } else {
                     $row['IP'] = self::inet_ntop($row['IP']);
                     $IPLocs[$ip_printable] = $row;
                 }
             }
         }
         if (!isset($IPLocs[$ip_printable])) {
             $toResolve[] = $ip_printable;
         }
     }
     if (sizeof($toResolve) > 0) {
         $api = new wfAPI(wfConfig::get('apiKey'), wfUtils::getWPVersion());
         try {
             $freshIPs = $api->call('resolve_ips', array(), array('ips' => implode(',', $toResolve)));
             if (is_array($freshIPs)) {
                 foreach ($freshIPs as $IP => $value) {
                     $IP_bin = wfUtils::inet_pton($IP);
                     if ($value == 'failed') {
                         $db->queryWrite("insert IGNORE into " . $locsTable . " (IP, ctime, failed) values (%s, unix_timestamp(), 1)", $IP_bin);
                         $IPLocs[$IP] = false;
                     } else {
                         if (is_array($value)) {
                             for ($i = 0; $i <= 5; $i++) {
                                 //Prevent warnings in debug mode about uninitialized values
                                 if (!isset($value[$i])) {
                                     $value[$i] = '';
                                 }
                             }
                             $db->queryWrite("insert IGNORE into " . $locsTable . " (IP, ctime, failed, city, region, countryName, countryCode, lat, lon) values (%s, unix_timestamp(), 0, '%s', '%s', '%s', '%s', %s, %s)", $IP_bin, $value[3], $value[2], $value[1], $value[0], $value[4], $value[5]);
                             $IPLocs[$IP] = array('IP' => $IP, 'city' => $value[3], 'region' => $value[2], 'countryName' => $value[1], 'countryCode' => $value[0], 'lat' => $value[4], 'lon' => $value[5]);
                         }
                     }
                 }
             }
         } catch (Exception $e) {
             wordfence::status(2, 'error', "Call to Wordfence API to resolve IPs failed: " . $e->getMessage());
             return array();
         }
     }
     return $IPLocs;
 }
开发者ID:VizualAbstract,项目名称:Marilyn,代码行数:66,代码来源:wfUtils.php


示例7: scan

 public function scan($forkObj)
 {
     if (!$this->startTime) {
         $this->startTime = microtime(true);
     }
     if (!$this->lastStatusTime) {
         $this->lastStatusTime = microtime(true);
     }
     $db = new wfDB();
     $lastCount = 'whatever';
     $excludePattern = false;
     if (wfConfig::get('scan_exclude', false)) {
         $exParts = explode(',', wfConfig::get('scan_exclude'));
         foreach ($exParts as &$exPart) {
             $exPart = preg_quote($exPart);
             $exPart = preg_replace('/\\\\\\*/', '.*', $exPart);
         }
         $excludePattern = '/^(?:' . implode('|', $exParts) . ')$/i';
     }
     while (true) {
         $thisCount = $db->querySingle("select count(*) from " . $db->prefix() . "wfFileMods where oldMD5 != newMD5 and knownFile=0");
         if ($thisCount == $lastCount) {
             //count should always be decreasing. If not, we're in an infinite loop so lets catch it early
             break;
         }
         $lastCount = $thisCount;
         $res1 = $db->querySelect("select filename, filenameMD5, hex(newMD5) as newMD5 from " . $db->prefix() . "wfFileMods where oldMD5 != newMD5 and knownFile=0 limit 500");
         if (sizeof($res1) < 1) {
             break;
         }
         foreach ($res1 as $rec1) {
             $db->queryWrite("update " . $db->prefix() . "wfFileMods set oldMD5 = newMD5 where filenameMD5='%s'", $rec1['filenameMD5']);
             //A way to mark as scanned so that if we come back from a sleep we don't rescan this one.
             $file = $rec1['filename'];
             if ($excludePattern && preg_match($excludePattern, $file)) {
                 continue;
             }
             $fileSum = $rec1['newMD5'];
             if (!file_exists($this->path . $file)) {
                 continue;
             }
             $fileExt = '';
             if (preg_match('/\\.([a-zA-Z\\d\\-]{1,7})$/', $file, $matches)) {
                 $fileExt = strtolower($matches[1]);
             }
             $isPHP = false;
             if (preg_match('/^(?:php|phtml|php\\d+)$/', $fileExt)) {
                 $isPHP = true;
             }
             $dontScanForURLs = false;
             if (!wfConfig::get('scansEnabled_highSense') && (preg_match('/^(?:\\.htaccess|wp\\-config\\.php)$/', $file) || preg_match('/^(?:sql|tbz|tgz|gz|tar|log|err\\d+)$/', $fileExt))) {
                 $dontScanForURLs = true;
             }
             if (preg_match('/^(?:jpg|jpeg|mp3|avi|m4v|gif|png)$/', $fileExt) && !wfConfig::get('scansEnabled_scanImages')) {
                 continue;
             }
             if (!wfConfig::get('scansEnabled_highSense') && strtolower($fileExt) == 'sql') {
                 //
                 continue;
             }
             if (wfUtils::fileTooBig($this->path . $file)) {
                 //We can't use filesize on 32 bit systems for files > 2 gigs
                 //We should not need this check because files > 2 gigs are not hashed and therefore won't be received back as unknowns from the API server
                 //But we do it anyway to be safe.
                 wordfence::status(2, 'error', "Encountered file that is too large: {$file} - Skipping.");
                 continue;
             }
             $fsize = filesize($this->path . $file);
             //Checked if too big above
             if ($fsize > 1000000) {
                 $fsize = sprintf('%.2f', $fsize / 1000000) . "M";
             } else {
                 $fsize = $fsize . "B";
             }
             if (function_exists('memory_get_usage')) {
                 wordfence::status(4, 'info', "Scanning contents: {$file} (Size:{$fsize} Mem:" . sprintf('%.1f', memory_get_usage(true) / (1024 * 1024)) . "M)");
             } else {
                 wordfence::status(4, 'info', "Scanning contents: {$file} (Size: {$fsize})");
             }
             $stime = microtime(true);
             $fh = @fopen($this->path . $file, 'r');
             if (!$fh) {
                 continue;
             }
             $totalRead = 0;
             while (!feof($fh)) {
                 $data = fread($fh, 1 * 1024 * 1024);
                 //read 1 megs max per chunk
                 $totalRead += strlen($data);
                 if ($totalRead < 1) {
                     break;
                 }
                 if ($isPHP || wfConfig::get('scansEnabled_scanImages')) {
                     if (strpos($data, '$allowed' . 'Sites') !== false && strpos($data, "define ('VER" . "SION', '1.") !== false && strpos($data, "TimThum" . "b script created by") !== false) {
                         if (!$this->isSafeFile($this->path . $file)) {
                             $this->addResult(array('type' => 'file', 'severity' => 1, 'ignoreP' => $this->path . $file, 'ignoreC' => $fileSum, 'shortMsg' => "File is an old version of TimThumb which is vulnerable.", 'longMsg' => "This file appears to be an old version of the TimThumb script which makes your system vulnerable to attackers. Please upgrade the theme or plugin that uses this or remove it.", 'data' => array('file' => $file, 'canDiff' => false, 'canFix' => false, 'canDelete' => true)));
                             break;
                         }
                     } else {
                         if (strpos($file, 'lib/wordfenceScanner.php') === false && preg_match($this->patterns['sigPattern'], $data, $matches)) {
//.........这里部分代码省略.........
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:101,代码来源:wordfenceScanner.php


示例8: wfConfig

<?php

$w = new wfConfig();
?>
<div class="wordfenceModeElem" id="wordfenceMode_options"></div>
<div class="wrap">
	<?php 
require 'menuHeader.php';
?>
	<?php 
$helpLink = "http://docs.wordfence.com/en/Wordfence_options";
$helpLabel = "Learn more about Wordfence Options";
$pageTitle = "Wordfence Options";
include 'pageTitle.php';
?>
	<div class="wordfenceLive">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td><h2>Wordfence Live Activity:</h2></td>
				<td id="wfLiveStatus"></td>
			</tr>
		</table>
	</div>
	<?php 
$rightRail = new wfView('marketing/rightrail', array('additionalClasses' => 'wordfenceRightRailOptions'));
echo $rightRail;
?>
	<form id="wfConfigForm">
		<table class="wfConfigForm">
			<tr>
				<td colspan="2"><h2>License</h2></td>
开发者ID:GafaMX,项目名称:operaciondespierta.org,代码行数:31,代码来源:menu_options.php


示例9:

				                     href="https://www.wordfence.com/gnl1scanGetHelp/wordfence-site-cleanings/">
						Get Help</a></p>
			</div>


		</div>
		<div style="margin-top: 20px;">
			<div id="wfTabs">
				<a href="#" id="wfNewIssuesTab" class="wfTab2 wfTabSwitch selected" onclick="wordfenceAdmin.switchIssuesTab(this, 'new'); return false;">New Issues</a>
				<a href="#" class="wfTab2 wfTabSwitch"          onclick="wordfenceAdmin.switchIssuesTab(this, 'ignored'); return false;">Ignored Issues</a>
			</div>
			<div class="wfTabsContainer">
				<div id="wfIssues_new" class="wfIssuesContainer">
					<h2>New Issues</h2>
					<?php 
if (wfConfig::get('scansEnabled_highSense')) {
    ?>
					<div class="wf-notice">
						<em>HIGH SENSITIVITY scanning is enabled, it may produce false positives</em>
					</div>
					<?php 
}
?>
					<p>
						The list below shows new problems or warnings that Wordfence found with your site.
						If you have fixed all the issues below, you can <a href="#" onclick="WFAD.updateAllIssues('deleteNew'); return false;">click here to mark all new issues as fixed</a>.
						You can also <a href="#" onclick="WFAD.updateAllIssues('ignoreAllNew'); return false;">ignore all new issues</a> which will exclude all issues listed below from future scans.
					</p>
					<p>
						<a href="#" onclick="jQuery('#wfBulkOps').toggle(); return false;">Bulk operation&raquo;&raquo;</a>
						<div id="wfBulkOps" style="display: none;">
开发者ID:ashenkar,项目名称:sanga,代码行数:31,代码来源:menu_scan.php


示例10: scan

 /**
  * @param wfScanEngine $forkObj
  * @return array
  */
 public function scan($forkObj)
 {
     $this->scanEngine = $forkObj;
     $loader = $this->scanEngine->getKnownFilesLoader();
     if (!$this->startTime) {
         $this->startTime = microtime(true);
     }
     if (!$this->lastStatusTime) {
         $this->lastStatusTime = microtime(true);
     }
     $db = new wfDB();
     $lastCount = 'whatever';
     $excludePattern = self::getExcludeFilePattern(self::EXCLUSION_PATTERNS_USER & self::EXCLUSION_PATTERNS_MALWARE);
     while (true) {
         $thisCount = $db->querySingle("select count(*) from " . $db->prefix() . "wfFileMods where oldMD5 != newMD5 and knownFile=0");
         if ($thisCount == $lastCount) {
             //count should always be decreasing. If not, we're in an infinite loop so lets catch it early
             break;
         }
         $lastCount = $thisCount;
         $res1 = $db->querySelect("select filename, filenameMD5, hex(newMD5) as newMD5 from " . $db->prefix() . "wfFileMods where oldMD5 != newMD5 and knownFile=0 limit 500");
         if (sizeof($res1) < 1) {
             break;
         }
         foreach ($res1 as $rec1) {
             $db->queryWrite("update " . $db->prefix() . "wfFileMods set oldMD5 = newMD5 where filenameMD5='%s'", $rec1['filenameMD5']);
             //A way to mark as scanned so that if we come back from a sleep we don't rescan this one.
             $file = $rec1['filename'];
             if ($excludePattern && preg_match($excludePattern, $file)) {
                 continue;
             }
             $fileSum = $rec1['newMD5'];
             if (!file_exists($this->path . $file)) {
                 continue;
             }
             $fileExt = '';
             if (preg_match('/\\.([a-zA-Z\\d\\-]{1,7})$/', $file, $matches)) {
                 $fileExt = strtolower($matches[1]);
             }
             $isPHP = false;
             if (preg_match('/\\.(?:php(?:\\d+)?|phtml)(\\.|$)/i', $file)) {
                 $isPHP = true;
             }
             $dontScanForURLs = false;
             if (!wfConfig::get('scansEnabled_highSense') && (preg_match('/^(?:\\.htaccess|wp\\-config\\.php)$/', $file) || $file === ini_get('user_ini.filename'))) {
                 $dontScanForURLs = true;
             }
             $isScanImagesFile = false;
             if (!$isPHP && preg_match('/^(?:jpg|jpeg|mp3|avi|m4v|gif|png|sql|js|tbz2?|bz2?|xz|zip|tgz|gz|tar|log|err\\d+)$/', $fileExt)) {
                 if (wfConfig::get('scansEnabled_scanImages')) {
                     $isScanImagesFile = true;
                 } else {
                     continue;
                 }
             }
             $isHighSensitivityFile = false;
             if (strtolower($fileExt) == 'sql') {
                 if (wfConfig::get('scansEnabled_highSense')) {
                     $isHighSensitivityFile = true;
                 } else {
                     continue;
                 }
             }
             if (wfUtils::fileTooBig($this->path . $file)) {
                 //We can't use filesize on 32 bit systems for files > 2 gigs
                 //We should not need this check because files > 2 gigs are not hashed and therefore won't be received back as unknowns from the API server
                 //But we do it anyway to be safe.
                 wordfence::status(2, 'error', "Encountered file that is too large: {$file} - Skipping.");
                 continue;
             }
             wfUtils::beginProcessingFile($file);
             $fsize = filesize($this->path . $file);
             //Checked if too big above
             if ($fsize > 1000000) {
                 $fsize = sprintf('%.2f', $fsize / 1000000) . "M";
             } else {
                 $fsize = $fsize . "B";
             }
             if (function_exists('memory_get_usage')) {
                 wordfence::status(4, 'info', "Scanning contents: {$file} (Size:{$fsize} Mem:" . sprintf('%.1f', memory_get_usage(true) / (1024 * 1024)) . "M)");
             } else {
                 wordfence::status(4, 'info', "Scanning contents: {$file} (Size: {$fsize})");
             }
             $stime = microtime(true);
             $fh = @fopen($this->path . $file, 'r');
             if (!$fh) {
                 continue;
             }
             $totalRead = 0;
             $dataForFile = $this->dataForFile($file);
             while (!feof($fh)) {
                 $data = fread($fh, 1 * 1024 * 1024);
                 //read 1 megs max per chunk
                 $totalRead += strlen($data);
                 if ($totalRead < 1) {
                     break;
//.........这里部分代码省略.........
开发者ID:VizualAbstract,项目名称:Marilyn,代码行数:101,代码来源:wordfenceScanner.php


示例11: getMaxExecutionTime

 public static function getMaxExecutionTime()
 {
     $config = wfConfig::get('maxExecutionTime');
     wordfence::status(4, 'info', "Got value from wf config maxExecutionTime: {$config}");
     if (is_numeric($config) && $config >= 10) {
         wordfence::status(4, 'info', "getMaxExecutionTime() returning config value: {$config}");
         return $config;
     }
     $ini = @ini_get('max_execution_time');
     wordfence::status(4, 'info', "Got max_execution_time value from ini: {$ini}");
     if (is_numeric($ini) && $ini >= 10) {
         $ini = floor($ini / 2);
         wordfence::status(4, 'info', "getMaxExecutionTime() returning half ini value: {$ini}");
         return $ini;
     }
     wordfence::status(4, 'info', "getMaxExecutionTime() returning default of: 15");
     return 15;
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:18,代码来源:wfScanEngine.php


示例12: wfView

	</div>
	<div class="wordfenceWrap<?php 
if (!wfConfig::get('isPaid')) {
    echo " wordfence-community";
}
?>
">
		<?php 
$rightRail = new wfView('marketing/rightrail', array('additionalClasses' => 'wordfenceRightRailLiveTraffic'));
echo $rightRail;
?>
		<?php 
if (!wfConfig::liveTrafficEnabled()) {
    ?>
			<div id="wordfenceLiveActivityDisabled"><p><strong>Live activity is disabled.</strong> <?php 
    if (wfConfig::get('cacheType') == 'falcon') {
        ?>
This is done to improve performance because you have Wordfence Falcon Engine enabled.<?php 
    }
    ?>
 Login and firewall activity will still appear below.</p></div>
		<?php 
}
?>
		
		<div id="wf-live-traffic" class="wfTabsContainer">

				<div id="wf-live-traffic-legend">
					<ul>
						<li class="wfHuman">Human</li>
						<li class="wfBot">Bot</li>
开发者ID:GafaMX,项目名称:operaciondespierta.org,代码行数:31,代码来源:menu_activity.php


示例13: array

<div class="wordfenceModeElem" id="wordfenceMode_rangeBlocking"></div>
<div class="wrap" id="paidWrap">
	<?php 
require 'menuHeader.php';
?>
	<?php 
$helpLink = "http://docs.wordfence.com/en/Advanced_Blocking";
$helpLabel = "Learn more about Advanced Blocking";
$pageTitle = "Advanced Blocking";
include 'pageTitle.php';
?>
	<div class="wordfenceWrap" style="margin: 20px 20px 20px 30px;">
		<p>
			<?php 
if (!wfConfig::get('firewallEnabled')) {
    ?>
<div style="color: #F00; font-weight: bold;">Firewall is disabled. You can enable it on the <a href="admin.php?page=WordfenceSecOpt">Wordfence Options page</a> at the top.</div><br /><?php 
}
?>
			<table class="wfConfigForm">
				<tr><th>IP address range:</th><td><input id="ipRange" type="text" size="30" maxlength="255" value="<?php 
if (isset($_GET['wfBlockRange']) && preg_match('/^[\\da-f\\.\\s\\t\\-:]+$/i', $_GET['wfBlockRange'])) {
    echo wp_kses($_GET['wfBlockRange'], array());
}
?>
" onkeyup="WFAD.calcRangeTotal();">&nbsp;<span id="wfShowRangeTotal"></span></td></tr>
				<tr><td></td><td style="padding-bottom: 15px;"><strong>Examples:</strong> 192.168.200.200 - 192.168.200.220</td></tr>
				<tr><th>User-Agent (browser) that matches:</th><td><input id="uaRange" type="text" size="30" maxlength="255" >&nbsp;(Case insensitive)</td></tr>
				<tr><td></td><td style="padding-bottom: 15px;"><strong>Examples:</strong> *badRobot*, AnotherBadRobot*, *someBrowserSuffix</td></tr>
				<tr><th>Referer (website visitor arrived from) that matches:</th><td><input id="wfreferer" type="text" size="30" maxlength="255" >&nbsp;(Case insensitive)</td></tr>
				<tr><td></td><td style="padding-bottom: 15px;"><strong>Examples:</strong> *badWebsite*, AnotherBadWebsite*, *someWebsiteSuffix</td></tr>
开发者ID:rootwork,项目名称:friendsoffifth,代码行数:31,代码来源:menu_rangeBlocking.php


示例14: removeAdmin

 /**
  * @param int $userID
  */
 public function removeAdmin($userID)
 {
     $loggedAdmins = $this->getLoggedAdmins();
     if (array_key_exists($userID, $loggedAdmins) && !array_key_exists($userID, $this->getCurrentAdmins())) {
         unset($loggedAdmins[$userID]);
         wfConfig::set_ser('adminUserList', $loggedAdmins);
     }
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:11,代码来源:wfLog.php


示例15: esc_attr

" is available.
			</li>
		<?php 
    }
    ?>
	</ul>
<?php 
}
?>

<?php 
if ($updates_needed['core'] || $updates_needed['plugins'] || $updates_needed['themes']) {
    ?>
	<p><a class="button button-primary" href="<?php 
    echo esc_attr(network_admin_url('update-core.php'));
    ?>
">Update Now</a></p>
<?php 
} else {
    ?>
	<p>No updates are available at this time.</p>
<?php 
}
if (defined('WP_DEBUG') && WP_DEBUG || wfConfig::get('debugOn')) {
    ?>
	<p>Generated in <?php 
    printf('%.4f seconds', $microseconds);
    ?>
</p>
<?php 
}
开发者ID:arobbins,项目名称:davis,代码行数:31,代码来源:activity-report.php


示例16: makeAPIQueryString

 public function makeAPIQueryString()
 {
     $siteurl = '';
     if (function_exists('get_bloginfo')) {
         if (is_multisite()) {
             $siteurl = network_home_url();
             $siteurl = rtrim($siteurl, '/');
             //Because previously we used get_bloginfo and it returns http://example.com without a '/' char.
         } else {
             $siteurl = home_url();
         }
     }
     return self::buildQuery(array('v' => $this->wordpressVersion, 's' => $siteurl, 'k' => $this->APIKey, 'openssl' => function_exists('openssl_verify') && defined('OPENSSL_VERSION_NUMBER') ? OPENSSL_VERSION_NUMBER : '0.0.0', 'phpv' => phpversion(), 'betaFeed' => (int) wfConfig::get('betaThreatDefenseFeed')));
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:14,代码来源:wfAPI.php


示例17:

<script type="text/x-jquery-template" id="wfWelcomePasswd">
<div>
	<h3>Premium Feature: Audit your Password Strength</h3>
	<strong><p>Want to know how easily a hacker can crack your passwords?</p></strong>

	<p>
		Wordfence Premium includes password auditing. Using this feature
		we securely test your passwords against a cracking program that hackers use.
		The difference is that we use extremely fast servers in our data center which
		allow us to quickly simulate a complex password cracking attack. We then tell
		you which passwords on your system are weak and help you easily fix the problem.
	</p>

	<p>
		<?php 
if (wfConfig::get('isPaid')) {
    ?>
			You have upgraded to the premium version of Wordfence and have full access
			to this feature along with our other premium features and priority support.
		<?php 
} else {
    ?>
		If you would like access to this premium feature, please
		<a href="https://www.wordfence.com/gnl1pwAuditUp2/wordfence-signup/" target="_blank">upgrade to our premium version</a>.
	</p>
	<?php 
}
?>
</div>
</script>
开发者ID:pcuervo,项目名称:wp-carnival,代码行数:30,代码来源:menu_passwd.php


示例18: wfConfig

<?php

$w = new wfConfig();
?>
<script type="text/javascript">
	var WFSLevels = <?php 
echo json_encode(wfConfig::$securityLevels);
?>
;
</script>
<div class="wordfenceModeElem" id="wordfenceMode_options"></div>
<div class="wrap">
	<?php 
require 'menuHeader.php';
?>
	<?php 
$helpLink = "http://docs.wordfence.com/en/Wordfence_options";
$helpLabel = "Learn more about Wordfence Options";
$pageTitle = "Wordfence Options";
include 'pageTitle.php';
?>
	<div class="wordfenceLive">
		<table border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td><h2>Wordfence Live Activity:</h2></td>
				<td id="wfLiveStatus"></td>
			</tr>
		</table>
	</div>

	<form id="wfConfigForm">
开发者ID:rootwork,项目名称:friendsoffifth,代码行数:31,代码来源:menu_options.php


示例19: processAttackData

 /**
  *
  */
 public static function processAttackData()
 {
     global $wpdb;
     $waf = wfWAF::getInstance();
     if ($waf->getStorageEngine()->getConfig('attackDataKey', false) === false) {
         $waf->getStorageEngine()->setConfig('attackDataKey', mt_rand(0, 0xfff));
     }
     $limit = 500;
     $lastSendTime = wfConfig::get('lastAttackDataSendTime');
     $attackData = $wpdb->get_results($wpdb->prepare("SELECT SQL_CALC_FOUND_ROWS * FROM {$wpdb->base_prefix}wfHits\nWHERE action in ('blocked:waf', 'learned:waf')\nAND attackLogTime > %.6f\nLIMIT %d", $lastSendTime, $limit));
     $totalRows = $wpdb->get_var('SELECT FOUND_ROWS()');
     if ($attackData) {
         $response = wp_remote_get(sprintf(WFWAF_API_URL_SEC . "waf-rules/%d.txt", $waf->getStorageEngine()->getConfig('attackDataKey')));
         if (!is_wp_error($response)) {
             $okToSendBody = wp_remote_retrieve_body($response);
             if ($okToSendBody === 'ok') {
                 // Build JSON to send
                 $dataToSend = array();
                 $attackDataToUpdate = array();
                 foreach ($attackData as $attackDataRow) {
                     $actionData = (array) wfRequestModel::unserializeActionData($attackDataRow->actionData);
                     $dataToSend[] = array($attackDataRow->attackLogTime, $attackDataRow->ctime, wfUtils::inet_ntop($attackDataRow->IP), array_key_exists('learningMode', $actionData) ? $actionData['learningMode'] : 0, array_key_exists('paramKey', $actionData) ? base64_encode($actionData['paramKey']) : false, array_key_exists('paramValue', $actionData) ? base64_encode($actionData['paramValue']) : false, array_key_exists('failedRules', $actionData) ? $actionData['failedRules'] : '', strpos($attackDataRow->URL, 'https') === 0 ? 1 : 0, array_key_exists('fullRequest', $actionData) ? $actionData['fullRequest'] : '');
                     if (array_key_exists('fullRequest', $actionData)) {
                         unset($actionData['fullRequest']);
                         $attackDataToUpdate[$attackDataRow->id] = array('actionData' => wfRequestModel::serializeActionData($actionData));
                     }
                     if ($attackDataRow->attackLogTime > $lastSendTime) {
                         $lastSendTime = $attackDataRow->attackLogTime;
                     }
                 }
                 $response = wp_remote_post(WFWAF_API_URL_SEC . "?" . http_build_query(array('action' => 'send_waf_attack_data', 'k' => $waf->getStorageEngine()->getConfig('apiKey'), 's' => $waf->getStorageEngine()->getConfig('siteURL') ? $waf->getStorageEngine()->getConfig('siteURL') : sprintf('%s://%s/', $waf->getRequest()->getProtocol(), rawurlencode($waf->getRequest()->getHost())))), array('body' => json_encode($dataToSend), 'headers' => array('Content-Type' => 'application/json'), 'timeout' => 30));
                 if (!is_wp_error($response) && ($body = wp_remote_retrieve_body($response))) {
                     $jsonData = json_decode($body, true);
                     if (is_array($jsonData) && array_key_exists('success', $jsonData)) {
                         // Successfully sent data, remove the full request from the table to reduce storage size
                         foreach ($attackDataToUpdate as $hitID => $dataToUpdate) {
                             $wpdb->update($wpdb->base_prefix . 'wfHits', $dataToUpdate, array('id' => $hitID));
                         }
                         wfConfig::set('lastAttackDataSendTime', $lastSendTime);
                         if ($totalRows > $limit) {
                             self::scheduleSendAttackData();
                         }
                     }
                 }
             } else {
                 if (is_string($okToSendBody) && preg_match('/next check in: ([0-9]+)/', $okToSendBody, $matches)) {
                     self::scheduleSendAttackData(time() + $matches[1]);
                 }
             }
             // Could be that the server is down, so hold off on sending data for a little while.
         } else {
             self::scheduleSendAttackData(time() + 7200);
         }
     }
     self::trimWfHits();
 }
开发者ID:ashenkar,项目名称:sanga,代码行数:59,代码来源:wordfenceClass.php


示例20: __construct


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wfUtils类代码示例发布时间:2022-05-23
下一篇:
PHP wechatCallbackapiTest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap