Passed
Push — master ( ec2a2d...e4ba4c )
by Joseph
02:46 queued 01:13
created
classes/subway-page-redirect.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 namespace Subway;
21 21
 
22
-if (! defined('ABSPATH') ) {
22
+if ( ! defined('ABSPATH')) {
23 23
     return;
24 24
 }
25 25
 
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
 
47 47
         // Only execute for non logged in users.
48
-        if (is_user_logged_in() ) {
48
+        if (is_user_logged_in()) {
49 49
             return;
50 50
         }
51 51
 
@@ -61,44 +61,44 @@  discard block
 block discarded – undo
61 61
         $redirect_page = Options::getRedirectPageUrl(); // WPCS XSS OK.
62 62
 
63 63
         // Turn off if is in 'wc-ajax' (woocommerce)
64
-        if ( function_exists( 'is_ajax') ) {
65
-            if ( is_ajax() ) {
64
+        if (function_exists('is_ajax')) {
65
+            if (is_ajax()) {
66 66
                return;
67 67
             }
68 68
         }
69 69
 
70 70
         // Same for normal ajax requests.
71
-        if ( is_admin() && defined( 'DOING_AJAX' ) && DOING_AJAX  ) {
71
+        if (is_admin() && defined('DOING_AJAX') && DOING_AJAX) {
72 72
             return;
73 73
         }
74 74
 
75 75
         // Exit if site is public.
76
-        if (Options::isPublicSite() ) {
76
+        if (Options::isPublicSite()) {
77 77
             return;
78 78
         }
79 79
 
80 80
         // Check if redirect page is empty or not.
81
-        if (empty($redirect_page) ) {
81
+        if (empty($redirect_page)) {
82 82
             return;
83 83
         }
84 84
 
85 85
         // Check if buddypress activate page.
86
-        if (function_exists('bp_is_activation_page') ) {
87
-            if (bp_is_activation_page() ) {
86
+        if (function_exists('bp_is_activation_page')) {
87
+            if (bp_is_activation_page()) {
88 88
                 return;
89 89
             }
90 90
         }
91 91
 
92 92
         // Check if buddypress registration page.
93
-        if (function_exists('bp_is_register_page') ) {
94
-            if (bp_is_register_page() ) {
93
+        if (function_exists('bp_is_register_page')) {
94
+            if (bp_is_register_page()) {
95 95
                 return;
96 96
             }
97 97
         }
98 98
 
99 99
         // Assign 0 value to empty $post->ID to prevent exception.
100 100
         // This applies to custom WordPress pages such as BP Members Page and Groups.
101
-        if (empty($current_post) ) {
101
+        if (empty($current_post)) {
102 102
             $current_post = new \stdclass;
103 103
             $current_post->ID = 0;
104 104
         }
@@ -110,22 +110,22 @@  discard block
 block discarded – undo
110 110
         // The ID of the first post object inside the loop is not correct.
111 111
         $blog_id = absint(get_option('page_for_posts'));
112 112
 
113
-        if (is_home() ) {
114
-            if ($blog_id === $login_page_id ) {
113
+        if (is_home()) {
114
+            if ($blog_id === $login_page_id) {
115 115
                 $current_page_id = $blog_id;
116 116
             }
117 117
         }
118 118
 
119 119
         // Only execute the script for non-loggedin visitors.
120
-        if (! is_user_logged_in() ) {
120
+        if ( ! is_user_logged_in()) {
121 121
 
122
-            if ($current_page_id !== $login_page_id ) {
122
+            if ($current_page_id !== $login_page_id) {
123 123
 
124
-                if (! in_array($current_page_id, $excluded_page, true) ) {
124
+                if ( ! in_array($current_page_id, $excluded_page, true)) {
125 125
 
126 126
                     wp_safe_redirect(
127 127
                         add_query_arg(
128
-                            array( '_redirected' => 'yes' ),
128
+                            array('_redirected' => 'yes'),
129 129
                             $redirect_page
130 130
                         )
131 131
                     );
Please login to merge, or discard this patch.