Passed
Push — 2.x ( 4a9b6a...b78933 )
by Terry
02:02
created
src/Firewall/Component/Rdns.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     public function isDenied(): bool
46 46
     {
47 47
         if (!empty($this->deniedList)) {
48
-            if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $this->rdns)) {
48
+            if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $this->rdns)) {
49 49
                 return true;
50 50
             }
51 51
         }
Please login to merge, or discard this patch.
src/Firewall/Component/UserAgent.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
         $this->deniedList = [
50 50
 
51 51
             // Backlink crawlers
52
-            'Ahrefs',     // http://ahrefs.com/robot/
53
-            'roger',      // rogerbot (SEOMOZ)
54
-            'moz.com',    // SEOMOZ crawlers
55
-            'MJ12bot',    // Majestic crawlers
56
-            'findlinks',  // http://wortschatz.uni-leipzig.de/findlinks
57
-            'Semrush',    // http://www.semrush.com/bot.html
52
+            'Ahrefs', // http://ahrefs.com/robot/
53
+            'roger', // rogerbot (SEOMOZ)
54
+            'moz.com', // SEOMOZ crawlers
55
+            'MJ12bot', // Majestic crawlers
56
+            'findlinks', // http://wortschatz.uni-leipzig.de/findlinks
57
+            'Semrush', // http://www.semrush.com/bot.html
58 58
     
59 59
             // Web information crawlers
60
-            'domain',     // Domain name information crawlers.
61
-            'copyright',  // Copyright information crawlers.
60
+            'domain', // Domain name information crawlers.
61
+            'copyright', // Copyright information crawlers.
62 62
     
63 63
             // Others
64
-            'archive',    // Wayback machine
64
+            'archive', // Wayback machine
65 65
         ];
66 66
     }
67 67
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function isDenied(): bool
72 72
     {
73 73
         if (!empty($this->deniedList)) {
74
-            if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $this->userAgent)) {
74
+            if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $this->userAgent)) {
75 75
                 return true;
76 76
             }
77 77
         }
Please login to merge, or discard this patch.
templates/panel/overview.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                 <div class="filter-status">
204 204
                     <div class="heading"><?php _e('panel', 'overview_label_action_logger', 'Action Logger'); ?></div>
205 205
                     <div class="nums">
206
-                        <?php echo $data['action_logger']  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
206
+                        <?php echo $data['action_logger'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
207 207
                     </div>
208 208
                     <div class="note"><?php _e('panel', 'overview_note_action_logger', 'Record every visitor’s behavior.'); ?></div>
209 209
                 </div>
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 <div class="filter-status">
223 223
                     <div class="heading"><?php _e('panel', 'overview_label_recaptcha', 'reCAPTCHA'); ?></div>
224 224
                     <div class="nums">
225
-                        <?php echo $captcha['recaptcha']  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
225
+                        <?php echo $captcha['recaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
226 226
                     </div>
227 227
                     <div class="note"><?php _e('panel', 'overview_note_recaptcha', 'Provided by Google.'); ?></div>
228 228
                 </div>
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                 <div class="filter-status">
232 232
                     <div class="heading"><?php _e('panel', 'overview_label_image_captcha', 'Image Captcha'); ?></div>
233 233
                     <div class="nums">
234
-                        <?php echo $captcha['imagecaptcha']  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
234
+                        <?php echo $captcha['imagecaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
235 235
                     </div>
236 236
                     <div class="note"><?php _e('panel', 'overview_note_image_captcha', 'A simple text-in-image Captcha.'); ?></div>
237 237
                 </div>
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                 <div class="filter-status">
252 252
                     <div class="heading"><?php _e('panel', 'overview_label_' . $k, ''); ?></div>
253 253
                     <div class="nums">
254
-                        <?php echo $messengers[$k]  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
254
+                        <?php echo $messengers[$k] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
255 255
                     </div>
256 256
                     <div class="note"><?php _e('panel', 'overview_note_' . $k, ''); ?></div>
257 257
                 </div>
Please login to merge, or discard this patch.
src/Firewall/Panel/Home.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -236,11 +236,11 @@
 block discarded – undo
236 236
     private function overviewTemplateVarsOfComponents(array $data = []): array
237 237
     {
238 238
         $data['components'] = [
239
-            'Ip'         => (!empty($this->kernel->component['Ip']))         ? true : false,
239
+            'Ip'         => (!empty($this->kernel->component['Ip'])) ? true : false,
240 240
             'TrustedBot' => (!empty($this->kernel->component['TrustedBot'])) ? true : false,
241
-            'Header'     => (!empty($this->kernel->component['Header']))     ? true : false,
242
-            'Rdns'       => (!empty($this->kernel->component['Rdns']))       ? true : false,
243
-            'UserAgent'  => (!empty($this->kernel->component['UserAgent']))  ? true : false,
241
+            'Header'     => (!empty($this->kernel->component['Header'])) ? true : false,
242
+            'Rdns'       => (!empty($this->kernel->component['Rdns'])) ? true : false,
243
+            'UserAgent'  => (!empty($this->kernel->component['UserAgent'])) ? true : false,
244 244
         ];
245 245
 
246 246
         return $data;
Please login to merge, or discard this patch.
templates/panel/table_filter_logs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,20 +58,20 @@
 block discarded – undo
58 58
             </thead>
59 59
             <tbody>
60 60
                 <?php foreach ($ip_log_list as $ipInfo) : ?>
61
-                    <?php $logData = is_array($ipInfo['log_data']) ? $ipInfo['log_data'] : json_decode($ipInfo['log_data'], true ); ?>
61
+                    <?php $logData = is_array($ipInfo['log_data']) ? $ipInfo['log_data'] : json_decode($ipInfo['log_data'], true); ?>
62 62
                     <?php
63 63
 
64 64
                         $text_warning = '';
65 65
 
66
-                        if ($logData['pageviews_m'] > 6 || $logData['pageviews_h'] > 50 || $logData['pageviews_d'] > 100 ) {
66
+                        if ($logData['pageviews_m'] > 6 || $logData['pageviews_h'] > 50 || $logData['pageviews_d'] > 100) {
67 67
                             $text_warning = '<span class="so-text-warning"><i class="fas fa-exclamation-triangle"></i></span>';
68 68
                         }
69 69
 
70
-                        if ($logData['flag_js_cookie'] > 2 || $logData['flag_multi_session'] > 2 || $logData['flag_empty_referer'] > 2 ) {
70
+                        if ($logData['flag_js_cookie'] > 2 || $logData['flag_multi_session'] > 2 || $logData['flag_empty_referer'] > 2) {
71 71
                             $text_warning = '<span class="so-text-warning"><i class="fas fa-exclamation-triangle"></i></span>';
72 72
                         }
73 73
 
74
-                        if ($logData['flag_js_cookie'] > 3 || $logData['flag_multi_session'] > 3 || $logData['flag_empty_referer'] > 3 ) {
74
+                        if ($logData['flag_js_cookie'] > 3 || $logData['flag_multi_session'] > 3 || $logData['flag_empty_referer'] > 3) {
75 75
                             $text_warning = '<span class="so-text-danger"><i class="fas fa-exclamation-triangle"></i></span>';
76 76
                         }
77 77
                     ?>
Please login to merge, or discard this patch.
src/Firewall/Firewall/Messenger/ItemSlack.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     public static function get(array $setting): MessengerInterface
31 31
     {
32 32
         $botToken = $setting['config']['bot_token'] ?? '';
33
-        $channel  = $setting['config']['channel']   ?? '';
33
+        $channel  = $setting['config']['channel'] ?? '';
34 34
 
35 35
         return new Slack($botToken, $channel);
36 36
     }
Please login to merge, or discard this patch.
src/Firewall/Firewall/Messenger/ItemMailgun.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@
 block discarded – undo
30 30
      */
31 31
     public static function get(array $setting): MessengerInterface
32 32
     {
33
-        $apiKey     = $setting['config']['api_key']     ?? '';
33
+        $apiKey     = $setting['config']['api_key'] ?? '';
34 34
         $domain     = $setting['config']['domain_name'] ?? '';
35
-        $sender     = $setting['config']['sender']      ?? '';
36
-        $recipients = $setting['config']['recipients']  ?? [];
35
+        $sender     = $setting['config']['sender'] ?? '';
36
+        $recipients = $setting['config']['recipients'] ?? [];
37 37
 
38 38
         $instance = new Mailgun($apiKey, $domain);
39 39
         $instance->setSubject(__('core', 'messenger_text_mail_subject'));
Please login to merge, or discard this patch.
src/Firewall/Firewall/Messenger/ItemRocketChat.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
      */
30 30
     public static function get(array $setting): MessengerInterface
31 31
     {
32
-        $serverUrl   = $setting['config']['server_url']   ?? '';
33
-        $userId      = $setting['config']['user_id']      ?? '';
32
+        $serverUrl   = $setting['config']['server_url'] ?? '';
33
+        $userId      = $setting['config']['user_id'] ?? '';
34 34
         $accessToken = $setting['config']['access_token'] ?? '';
35
-        $channel     = $setting['config']['channel']      ?? '';
35
+        $channel     = $setting['config']['channel'] ?? '';
36 36
 
37 37
         return new RocketChat($accessToken, $userId, $serverUrl, $channel);
38 38
     }
Please login to merge, or discard this patch.
src/Firewall/Kernel.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -614,9 +614,9 @@
 block discarded – undo
614 614
         $this->initComponents();
615 615
 
616 616
         $processMethods = [
617
-            'isRuleExist',   // Stage 1 - Looking for rule table.
618
-            'isTrustedBot',  // Stage 2 - Detect popular search engine.
619
-            'isFakeRobot',   // Stage 3 - Reject fake search engine crawlers.
617
+            'isRuleExist', // Stage 1 - Looking for rule table.
618
+            'isTrustedBot', // Stage 2 - Detect popular search engine.
619
+            'isFakeRobot', // Stage 3 - Reject fake search engine crawlers.
620 620
             'isIpComponent', // Stage 4 - IP manager.
621 621
             'isComponents'   // Stage 5 - Check other components.
622 622
         ];
Please login to merge, or discard this patch.