PluginProbe
Patchstack – WordPress & Plugins Security / trunk
Patchstack – WordPress & Plugins Security vtrunk
2.3.7 trunk 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.16 2.1.17 2.1.18 2.1.19 2.1.2 2.1.20 2.1.21 2.1.22 2.1.23 2.1.24 2.1.25 2.1.3 2.1.4 2.1.5 2.1.6 All 49 releases
patchstack / lib / patchstack / src / Extensions / Test / Extension.php

Extension.php in Patchstack – WordPress & Plugins Security trunk, at lib/patchstack/src/Extensions/Test/Extension.php

101 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Patchstack\Extensions\Test;
4
5 use Patchstack\Extensions\ExtensionInterface;
6
7 class Extension implements ExtensionInterface
8 {
9 /**
10 * Log the request, this can be of type BLOCK, LOG or REDIRECT.
11 *
12 * @param int $ruleId
13 * @param string $bodyData
14 * @param string $blockType
15 * @return void
16 */
17 public function logRequest($ruleId, $bodyData, $blockType)
18 {
19 return true;
20 }
21
22 /**
23 * Determine if the current visitor can bypass the firewall.
24 * If $isMuCall is true, we MUST avoid any function calls that checks the current authorization of the user,
25 * this includes current_user_can. Otherwise, a fatal error is thrown.
26 *
27 * @param bool $isMuCall
28 * @return bool
29 */
30 public function canBypass($isMuCall)
31 {
32 return false;
33 }
34
35 /**
36 * Determine if the visitor is blocked from the website.
37 *
38 * @param int $minutes
39 * @param int $blockTime
40 * @param int $attempts
41 * @return bool
42 */
43 public function isBlocked($minutes, $blockTime, $attempts)
44 {
45 return false;
46 }
47
48 /**
49 * Force exit the page when a request has been blocked.
50 *
51 * @param int $ruleId
52 * @return void
53 */
54 public function forceExit($ruleId)
55 {
56 exit;
57 }
58
59 /**
60 * Get the IP address of the request.
61 *
62 * @return string
63 */
64 public function getIpAddress()
65 {
66 return '127.0.0.1';
67 }
68
69 /**
70 * Determine if the request should not go through the firewall.
71 *
72 * @param array $whitelistRules
73 * @param array $request
74 */
75 public function isWhitelisted($whitelistRules, $request)
76 {
77 return false;
78 }
79
80 /**
81 * Get the hostname of the environment.
82 * This is only used for open redirect vulnerabilities.
83 *
84 * @return string
85 */
86 public function getHostName()
87 {
88 return 'wordpress.test';
89 }
90
91 /**
92 * Determine if the current request is a file upload request.
93 *
94 * @return boolean
95 */
96 public function isFileUploadRequest()
97 {
98 return false;
99 }
100 }
101