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


PHP wordfence::statusEndErr方法代码示例

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


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

示例1: run

 public function run($engine)
 {
     //base path and 'only' is a list of files and dirs in the bast that are the only ones that should be processed. Everything else in base is ignored. If only is empty then everything is processed.
     if ($this->totalForks > 1000) {
         throw new Exception("Wordfence file scanner detected a possible infinite loop. Exiting on file: " . $this->stoppedOnFile);
     }
     $this->engine = $engine;
     $files = scandir($this->path);
     foreach ($files as $file) {
         if ($file == '.' || $file == '..') {
             continue;
         }
         if (sizeof($this->only) > 0 && !in_array($file, $this->only)) {
             continue;
         }
         $file = $this->path . $file;
         wordfence::status(4, 'info', "Hashing item in base dir: {$file}");
         $this->_dirHash($file);
     }
     wordfence::status(2, 'info', "Analyzed " . $this->totalFiles . " files containing " . wfUtils::formatBytes($this->totalData) . " of data.");
     if ($this->coreEnabled) {
         wordfence::statusEnd($this->status['core'], $this->haveIssues['core']);
     }
     if ($this->themesEnabled) {
         wordfence::statusEnd($this->status['themes'], $this->haveIssues['themes']);
     }
     if ($this->pluginsEnabled) {
         wordfence::statusEnd($this->status['plugins'], $this->haveIssues['plugins']);
     }
     if (sizeof($this->possibleMalware) > 0) {
         $malwareResp = $engine->api->binCall('check_possible_malware', json_encode($this->possibleMalware));
         if ($malwareResp['code'] != 200) {
             wordfence::statusEndErr();
             throw new Exception("Invalid response from Wordfence API during check_possible_malware");
         }
         $malwareList = json_decode($malwareResp['data'], true);
         if (is_array($malwareList) && sizeof($malwareList) > 0) {
             for ($i = 0; $i < sizeof($malwareList); $i++) {
                 $file = $malwareList[$i][0];
                 $md5 = $malwareList[$i][1];
                 $name = $malwareList[$i][2];
                 $this->haveIssues['malware'] = true;
                 $this->engine->addIssue('file', 1, $this->path . $file, $md5, 'This file is suspected malware: ' . $file, "This file's signature matches a known malware file. The title of the malware is '" . $name . "'. Immediately inspect this file using the 'View' option below and consider deleting it from your server.", array('file' => $file, 'cType' => 'unknown', 'canDiff' => false, 'canFix' => false, 'canDelete' => true));
             }
         }
     }
     if ($this->malwareEnabled) {
         wordfence::statusEnd($this->status['malware'], $this->haveIssues['malware']);
     }
 }
开发者ID:adams0917,项目名称:woocommerce_eht,代码行数:50,代码来源:wordfenceHash.php

示例2: scan_comments_finish

 private function scan_comments_finish()
 {
     $hooverResults = $this->hoover->getBaddies();
     if ($this->hoover->errorMsg) {
         wordfence::statusEndErr();
         throw new Exception($this->hoover->errorMsg);
     }
     $this->hoover->cleanup();
     $haveIssues = false;
     foreach ($hooverResults as $idString => $hresults) {
         $arr = explode('-', $idString);
         $blogID = $arr[0];
         $commentID = $arr[1];
         $uctype = ucfirst($this->scanData[$idString]['type']);
         $type = $this->scanData[$idString]['type'];
         foreach ($hresults as $result) {
             if ($result['badList'] == 'goog-malware-shavar') {
                 $shortMsg = "{$uctype} with author " . $this->scanData[$idString]['author'] . " contains a suspected malware URL.";
                 $longMsg = "This {$type} contains a suspected malware URL listed on Google's list of malware sites. The URL is: " . $result['URL'] . " - More info available at <a href=\"http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=" . urlencode($result['URL']) . "&client=googlechrome&hl=en-US\" target=\"_blank\">Google Safe Browsing diagnostic page</a>.";
             } else {
                 if ($result['badList'] == 'googpub-phish-shavar') {
                     $shortMsg = "{$uctype} contains a suspected phishing site URL.";
                     $longMsg = "This {$type} contains a URL that is a suspected phishing site that is currently listed on Google's list of known phishing sites. The URL is: " . $result['URL'];
                 } else {
                     //A list type that may be new and the plugin has not been upgraded yet.
                     continue;
                 }
             }
             if (is_multisite()) {
                 switch_to_blog($blogID);
             }
             $ignoreP = $idString;
             $ignoreC = $idString . '-' . $this->scanData[$idString]['contentMD5'];
             if ($this->addIssue('commentBadURL', 1, $ignoreP, $ignoreC, $shortMsg, $longMsg, array('commentID' => $commentID, 'badURL' => $result['URL'], 'author' => $this->scanData[$idString]['author'], 'type' => $type, 'uctype' => $uctype, 'editCommentLink' => get_edit_comment_link($commentID), 'commentDate' => $this->scanData[$idString]['date'], 'isMultisite' => $this->scanData[$idString]['isMultisite'], 'domain' => $this->scanData[$idString]['domain'], 'path' => $this->scanData[$idString]['path'], 'blog_id' => $blogID))) {
                 $haveIssues = true;
             }
             if (is_multisite()) {
                 restore_current_blog();
             }
         }
     }
     wordfence::statusEnd($this->statusIDX['comments'], $haveIssues);
 }
开发者ID:rinodung,项目名称:myfreetheme,代码行数:43,代码来源:wfScanEngine.php


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