Passed
Pull Request — master (#19)
by
unknown
02:03
created
classes/subway-page-redirect.php 1 patch
Spacing   +16 added lines, -16 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,32 +61,32 @@  discard block
 block discarded – undo
61 61
         $redirect_page = Options::getRedirectPageUrl(); // WPCS XSS OK.
62 62
 
63 63
         // Exit if site is public.
64
-        if (Options::isPublicSite() ) {
64
+        if (Options::isPublicSite()) {
65 65
             return;
66 66
         }
67 67
 
68 68
         // Check if redirect page is empty or not.
69
-        if (empty($redirect_page) ) {
69
+        if (empty($redirect_page)) {
70 70
             return;
71 71
         }
72 72
 
73 73
         // Check if buddypress activate page.
74
-        if (function_exists('bp_is_activation_page') ) {
75
-            if (bp_is_activation_page() ) {
74
+        if (function_exists('bp_is_activation_page')) {
75
+            if (bp_is_activation_page()) {
76 76
                 return;
77 77
             }
78 78
         }
79 79
 
80 80
         // Check if buddypress registration page.
81
-        if (function_exists('bp_is_register_page') ) {
82
-            if (bp_is_register_page() ) {
81
+        if (function_exists('bp_is_register_page')) {
82
+            if (bp_is_register_page()) {
83 83
                 return;
84 84
             }
85 85
         }
86 86
 
87 87
         // Assign 0 value to empty $post->ID to prevent exception.
88 88
         // This applies to custom WordPress pages such as BP Members Page and Groups.
89
-        if (empty($current_post) ) {
89
+        if (empty($current_post)) {
90 90
             $current_post = new \stdclass;
91 91
             $current_post->ID = 0;
92 92
         }
@@ -98,23 +98,23 @@  discard block
 block discarded – undo
98 98
         // The ID of the first post object inside the loop is not correct.
99 99
         $blog_id = absint(get_option('page_for_posts'));
100 100
 
101
-        if (is_home() ) {
102
-            if ($blog_id === $login_page_id ) {
101
+        if (is_home()) {
102
+            if ($blog_id === $login_page_id) {
103 103
                 $current_page_id = $blog_id;
104 104
             }
105 105
         }
106 106
 
107 107
         // Only execute the script for non-loggedin visitors.
108
-        if (! is_user_logged_in() ) {
108
+        if ( ! is_user_logged_in()) {
109 109
 
110
-            if ($current_page_id !== $login_page_id ) {
111
-                $excluded_page = apply_filters( 'subway_excluded_page', $excluded_page, $current_page_id );
110
+            if ($current_page_id !== $login_page_id) {
111
+                $excluded_page = apply_filters('subway_excluded_page', $excluded_page, $current_page_id);
112 112
 
113
-                if (! in_array($current_page_id, $excluded_page, true) ) {
113
+                if ( ! in_array($current_page_id, $excluded_page, true)) {
114 114
 
115 115
                     wp_safe_redirect(
116 116
                         add_query_arg(
117
-                            array( '_redirected' => 'yes' ),
117
+                            array('_redirected' => 'yes'),
118 118
                             $redirect_page
119 119
                         )
120 120
                     );
Please login to merge, or discard this patch.