本文整理汇总了PHP中wfConfig::liveTrafficEnabled方法的典型用法代码示例。如果您正苦于以下问题:PHP wfConfig::liveTrafficEnabled方法的具体用法?PHP wfConfig::liveTrafficEnabled怎么用?PHP wfConfig::liveTrafficEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wfConfig
的用法示例。
在下文中一共展示了wfConfig::liveTrafficEnabled方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupAdminVars
private static function setupAdminVars()
{
$updateInt = wfConfig::get('actUpdateInterval', 2);
if (!preg_match('/^\\d+$/', $updateInt)) {
$updateInt = 2;
}
$updateInt *= 1000;
wp_localize_script('wordfenceAdminjs', 'WordfenceAdminVars', array('ajaxURL' => admin_url('admin-ajax.php'), 'firstNonce' => wp_create_nonce('wp-ajax'), 'siteBaseURL' => wfUtils::getSiteBaseURL(), 'debugOn' => wfConfig::get('debugOn', 0), 'actUpdateInterval' => $updateInt, 'tourClosed' => wfConfig::get('tourClosed', 0), 'welcomeClosed' => wfConfig::get('welcomeClosed', 0), 'cacheType' => wfConfig::get('cacheType'), 'liveTrafficEnabled' => wfConfig::liveTrafficEnabled()));
}
示例2: wfView
<td id="wfLiveStatus"></td>
</tr>
</table>
</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">
示例3: logHit
public function logHit()
{
if (!wfConfig::liveTrafficEnabled()) {
return;
}
$headers = array();
foreach ($_SERVER as $h => $v) {
if (preg_match('/^HTTP_(.+)$/', $h, $matches)) {
$headers[$matches[1]] = $v;
}
}
$ua = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$this->getDB()->queryWrite("insert into " . $this->hitsTable . " (ctime, is404, isGoogle, IP, userID, newVisit, URL, referer, UA, jsRun) values (%f, %d, %d, %s, %s, %d, '%s', '%s', '%s', %d)", sprintf('%.6f', microtime(true)), is_404() ? 1 : 0, wfCrawl::isGoogleCrawler() ? 1 : 0, wfUtils::inet_pton(wfUtils::getIP()), $this->getCurrentUserID(), wordfence::$newVisit ? 1 : 0, wfUtils::getRequestedURL(), isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', $ua, (int) (isset($_COOKIE['wordfence_verifiedHuman']) && wp_verify_nonce($_COOKIE['wordfence_verifiedHuman'], 'wordfence_verifiedHuman' . $ua . wfUtils::getIP())));
return $this->getDB()->querySingle("select last_insert_id()");
}
示例4: logHit
/**
* @return bool|int
*/
public function logHit()
{
$liveTrafficEnabled = wfConfig::liveTrafficEnabled();
$action = $this->currentRequest->action;
$logHitOK = $this->logHitOK();
if (!$logHitOK) {
return false;
}
if (!$liveTrafficEnabled && !$action) {
return false;
}
if ($this->currentRequest !== null) {
if ($this->currentRequest->save()) {
return $this->currentRequest->getPrimaryKey();
}
}
return false;
}