本文整理汇总了PHP中wordfence::getLog方法的典型用法代码示例。如果您正苦于以下问题:PHP wordfence::getLog方法的具体用法?PHP wordfence::getLog怎么用?PHP wordfence::getLog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wordfence
的用法示例。
在下文中一共展示了wordfence::getLog方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBlockedIPWhitelistWhereClause
/**
* Generate SQL from the whitelist. Uses the return format from wfLog::getWhitelistedIPs
*
* @see wfLog::getWhitelistedIPs
* @param array $whitelisted_ips
* @return string
*/
public function getBlockedIPWhitelistWhereClause($whitelisted_ips = null)
{
if ($whitelisted_ips === null) {
$whitelisted_ips = wordfence::getLog()->getWhitelistedIPs();
}
if (!is_array($whitelisted_ips)) {
return false;
}
$where = '';
/** @var array|wfUserIPRange|string $ip_range */
foreach ($whitelisted_ips as $ip_range) {
if (is_array($ip_range) && count($ip_range) == 2) {
$where .= $this->db->prepare('IP BETWEEN %s AND %s', $ip_range[0], $ip_range[1]) . ' OR ';
} elseif (is_a($ip_range, 'wfUserIPRange')) {
$where .= $ip_range->toSQL('IP') . ' OR ';
} elseif (is_string($ip_range) || is_numeric($ip_range)) {
$where .= $this->db->prepare('IP = %s', $ip_range) . ' OR ';
}
}
if ($where) {
// remove the extra ' OR '
$where = substr($where, 0, -4);
}
return $where;
}
示例2: isVerifiedGoogleCrawler
/**
* Has correct user agent and PTR record points to .googlebot.com domain.
*
* @param string|null $ip
* @param string|null $ua
* @return bool
*/
public static function isVerifiedGoogleCrawler($ip = null, $ua = null)
{
static $verified;
if (!isset($verified)) {
$verified = array();
}
if ($ip === null) {
$ip = wfUtils::getIP();
}
if (array_key_exists($ip, $verified)) {
return $verified[$ip];
}
if (self::isGoogleCrawler($ua)) {
if (self::verifyCrawlerPTR(wordfence::getLog()->getGooglePattern(), $ip)) {
$verified[$ip] = true;
return $verified[$ip];
}
if (self::verifyGooglebotViaNOC1($ip)) {
$verified[$ip] = true;
return $verified[$ip];
}
}
$verified[$ip] = false;
return $verified[$ip];
}
示例3: array
$newestItem = 0;
$sumEvents = array();
$timeOffset = 3600 * get_option('gmt_offset');
foreach ($events as $e) {
if (strpos($e['msg'], 'SUM_') !== 0) {
if ($debugOn || $e['level'] < 4) {
$typeClass = '';
if ($debugOn) {
$typeClass = ' wf' . $e['type'];
}
echo '<div class="wfActivityLine' . $typeClass . '">[' . date('M d H:i:s', $e['ctime'] + $timeOffset) . '] ' . $e['msg'] . '</div>';
}
}
$newestItem = $e['ctime'];
}
echo '<script type="text/javascript">WFAD.lastALogCtime = ' . $newestItem . '; WFAD.processActArray(' . json_encode(wordfence::getLog()->getSummaryEvents()) . ');</script>';
} else {
?>
A live stream of what Wordfence is busy with right now will appear in this box.
<?php
}
?>
</div></div></div>
<div style="position: relative; width: 803px;">
<a href="#" target="_blank" class="wfALogViewLink" id="wfALogViewLink">View activity log</a>
</div>
<div style="margin: 0 0 20px 5px; width: 795px;">
<strong>Docs:</strong> Our <a href="http://support.wordfence.com/" target="_blank">Support Site</a> can answer many common (and some less common) questions. It also includes our priority support ticketing system for Premium Wordfence users.
<?php
示例4: isVerifiedGoogleCrawler
/**
* Has correct user agent and PTR record points to .googlebot.com domain.
*
* @return bool
*/
public static function isVerifiedGoogleCrawler()
{
return self::isGoogleCrawler() && self::verifyCrawlerPTR(wordfence::getLog()->getGooglePattern(), wfUtils::getIP());
}