当前位置: 首页>>代码示例>>PHP>>正文


PHP wordfence::hitID方法代码示例

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


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

示例1: doEarlyAccessLogging

 private static function doEarlyAccessLogging()
 {
     $wfLog = self::getLog();
     if ($wfLog->logHitOK()) {
         if (empty($wfFunc) && is_404()) {
             $wfLog->logLeechAndBlock('404');
         } else {
             $wfLog->logLeechAndBlock('hit');
         }
         if (wfConfig::liveTrafficEnabled()) {
             self::$hitID = $wfLog->logHit();
             add_action('wp_head', 'wordfence::wfLogHumanHeader');
         }
         /*
         if(wfConfig::get('perfLoggingEnabled', false)){
         	add_action('wp_head', 'wordfence::wfLogPerfHeader');
         }
         */
     }
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:20,代码来源:wordfenceClass.php

示例2: wfLogHumanHeader

    public static function wfLogHumanHeader()
    {
        self::$hitID = self::getLog()->logHit();
        if (self::$hitID) {
            $URL = home_url('/?wordfence_logHuman=1&hid=' . wfUtils::encrypt(self::$hitID));
            $URL = addslashes(preg_replace('/^https?:/i', '', $URL));
            #Load as external script async so we don't slow page down.
            echo <<<HTML
<script type="text/javascript">
(function(url){
\tif(/(?:Chrome\\/26\\.0\\.1410\\.63 Safari\\/537\\.31|WordfenceTestMonBot)/.test(navigator.userAgent)){ return; }
\tvar addEvent = function(evt, handler) {
\t\tif (window.addEventListener) {
\t\t\tdocument.addEventListener(evt, handler, false);
\t\t} else if (window.attachEvent) {
\t\t\tdocument.attachEvent('on' + evt, handler);
\t\t}
\t};
\tvar removeEvent = function(evt, handler) {
\t\tif (window.removeEventListener) {
\t\t\tdocument.removeEventListener(evt, handler, false);
\t\t} else if (window.detachEvent) {
\t\t\tdocument.detachEvent('on' + evt, handler);
\t\t}
\t};
\tvar evts = 'contextmenu dblclick drag dragend dragenter dragleave dragover dragstart drop keydown keypress keyup mousedown mousemove mouseout mouseover mouseup mousewheel scroll'.split(' ');
\tvar logHuman = function() {
\t\tvar wfscr = document.createElement('script');
\t\twfscr.type = 'text/javascript';
\t\twfscr.async = true;
\t\twfscr.src = url + '&r=' + Math.random();
\t\t(document.getElementsByTagName('head')[0]||document.getElementsByTagName('body')[0]).appendChild(wfscr);
\t\tfor (var i = 0; i < evts.length; i++) {
\t\t\tremoveEvent(evts[i], logHuman);
\t\t}
\t};
\tfor (var i = 0; i < evts.length; i++) {
\t\taddEvent(evts[i], logHuman);
\t}
})('{$URL}');
</script>
HTML;
        }
    }
开发者ID:ashenkar,项目名称:sanga,代码行数:44,代码来源:wordfenceClass.php

示例3: templateRedir

 public static function templateRedir()
 {
     $wfFunc = get_query_var('_wfsf');
     $wfLog = self::getLog();
     if ($wfLog->logHitOK()) {
         if (empty($wfFunc) && is_404()) {
             $wfLog->logLeechAndBlock('404');
         } else {
             $wfLog->logLeechAndBlock('hit');
         }
         if (wfConfig::get('liveTrafficEnabled')) {
             self::$hitID = $wfLog->logHit();
             add_action('wp_head', 'wordfence::wp_head');
         }
     }
     if (!($wfFunc == 'diff' || $wfFunc == 'view' || $wfFunc == 'sysinfo' || $wfFunc == 'conntest' || $wfFunc == 'unknownFiles' || $wfFunc == 'IPTraf' || $wfFunc == 'viewActivityLog' || $wfFunc == 'testmem' || $wfFunc == 'testtime')) {
         return;
     }
     if (!wfUtils::isAdmin()) {
         return;
     }
     $nonce = $_GET['nonce'];
     if (!wp_verify_nonce($nonce, 'wp-ajax')) {
         echo "Bad security token. It may have been more than 12 hours since you reloaded the page you came from. Try reloading the page you came from. If that doesn't work, please sign out and sign-in again.";
         exit(0);
     }
     if ($wfFunc == 'diff') {
         self::wfFunc_diff();
     } else {
         if ($wfFunc == 'view') {
             self::wfFunc_view();
         } else {
             if ($wfFunc == 'sysinfo') {
                 require 'sysinfo.php';
             } else {
                 if ($wfFunc == 'conntest') {
                     require 'conntest.php';
                 } else {
                     if ($wfFunc == 'unknownFiles') {
                         require 'unknownFiles.php';
                     } else {
                         if ($wfFunc == 'IPTraf') {
                             self::wfFunc_IPTraf();
                         } else {
                             if ($wfFunc == 'viewActivityLog') {
                                 self::wfFunc_viewActivityLog();
                             } else {
                                 if ($wfFunc == 'testmem') {
                                     self::wfFunc_testmem();
                                 } else {
                                     if ($wfFunc == 'testtime') {
                                         self::wfFunc_testtime();
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     exit(0);
 }
开发者ID:verbazend,项目名称:AWFA,代码行数:63,代码来源:wordfenceClass.php


注:本文中的wordfence::hitID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。