PluginProbe
Patchstack – WordPress & Plugins Security / 2.2.0
Patchstack – WordPress & Plugins Security v2.2.0
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 / ExtensionInterface.php

ExtensionInterface.php in Patchstack – WordPress & Plugins Security 2.2.0, at lib/patchstack/src/Extensions/ExtensionInterface.php

80 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;
4
5 /**
6 * Any extension must implement the methods of the interface.
7 * Some CMS systems might implement some of the logic completely different than others.
8 */
9 interface ExtensionInterface
10 {
11 /**
12 * Log the request, this can be of type BLOCK, LOG or REDIRECT.
13 *
14 * @param int $ruleId
15 * @param string $bodyData
16 * @param string $blockType
17 * @return void
18 */
19 public function logRequest($ruleId, $bodyData, $blockType);
20
21 /**
22 * Determine if the current visitor can bypass the firewall.
23 * If $isMuCall is true, we MUST avoid any function calls that checks the current authorization of the user,
24 * this includes current_user_can. Otherwise, a fatal error is thrown.
25 *
26 * @param bool $isMuCall
27 * @return bool
28 */
29 public function canBypass($isMuCall);
30
31 /**
32 * Determine if the visitor is blocked from the website.
33 *
34 * @param int $minutes
35 * @param int $blockTime
36 * @param int $attempts
37 * @return bool
38 */
39 public function isBlocked($minutes, $blockTime, $attempts);
40
41 /**
42 * Force exit the page when a request has been blocked.
43 *
44 * @param int $ruleId
45 * @return void
46 */
47 public function forceExit($ruleId);
48
49 /**
50 * Get the IP address of the request.
51 * Do NOT blindly rely on IP address headers which can be spoofed, such as X-Forwarded-For.
52 *
53 * @return string
54 */
55 public function getIpAddress();
56
57 /**
58 * Get the hostname of the environment.
59 * This is only used for open redirect vulnerabilities.
60 *
61 * @return string
62 */
63 public function getHostName();
64
65 /**
66 * Determine if the request should be passed without going through the firewall.
67 *
68 * @param array $whitelistRules
69 * @param array $request
70 */
71 public function isWhitelisted($whitelistRules, $request);
72
73 /**
74 * Determine if the current request is a file upload request.
75 *
76 * @return boolean
77 */
78 public function isFileUploadRequest();
79 }
80