當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。