Passed
Pull Request — master (#40)
by
unknown
02:23
created
settings-fields/field-subway-is-public-form.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  * @package Subway
11 11
  */
12 12
 
13
-if ( ! defined( 'ABSPATH' ) ) {
13
+if ( ! defined('ABSPATH')) {
14 14
 	return;
15 15
 }
16 16
 
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function subway_is_public_form() {
23 23
 
24
-	echo '<label for="subway_is_public"><input ' . checked( 1, get_option( 'subway_is_public' ), false ) . ' value="1" name="subway_is_public" id="subway_is_public" type="checkbox" class="code" /> Check to make all of your posts and pages visible to public.</label>';
25
-	echo '<p class="description">' . esc_html__( 'This option will overwrite the \'Private Login Page\' below. BuddyPress pages like user profile, members, and groups are still only available to the rightful owner of the profile.', 'subway' ) . '</p>';
24
+	echo '<label for="subway_is_public"><input ' . checked(1, get_option('subway_is_public'), false) . ' value="1" name="subway_is_public" id="subway_is_public" type="checkbox" class="code" /> Check to make all of your posts and pages visible to public.</label>';
25
+	echo '<p class="description">' . esc_html__('This option will overwrite the \'Private Login Page\' below. BuddyPress pages like user profile, members, and groups are still only available to the rightful owner of the profile.', 'subway') . '</p>';
26 26
 
27 27
 	return;
28 28
 }
Please login to merge, or discard this patch.
templates/login-form-lost-password.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@
 block discarded – undo
17 17
  * @link     github.com/codehaiku/subway The Plugin Repository
18 18
  */
19 19
 
20
-if ( ! defined( 'ABSPATH' ) ) {
20
+if ( ! defined('ABSPATH')) {
21 21
 	return;
22 22
 }
23 23
 ?>
24 24
 <p class="subway-login-lost-password">
25
-	<a href="<?php echo esc_url( wp_lostpassword_url( $redirect = '' ) ); ?>">
26
-	 	<?php esc_html_e( 'Forgot Password', 'subway' ); ?>
25
+	<a href="<?php echo esc_url(wp_lostpassword_url($redirect = '')); ?>">
26
+	 	<?php esc_html_e('Forgot Password', 'subway'); ?>
27 27
 	</a>
28 28
 </p>
Please login to merge, or discard this patch.
classes/subway-enqueue.php 2 patches
Indentation   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 namespace Subway;
21 21
 
22 22
 if (! defined('ABSPATH') ) {
23
-    return;
23
+	return;
24 24
 }
25 25
 
26 26
 /**
@@ -36,50 +36,50 @@  discard block
 block discarded – undo
36 36
 final class Enqueue
37 37
 {
38 38
 
39
-    /**
40
-     * Registers our CSS and Javascript to WordPress Enqueue Handler.
41
-     *
42
-     * @return void
43
-     */
44
-    public static function registerJs() 
45
-    {
39
+	/**
40
+	 * Registers our CSS and Javascript to WordPress Enqueue Handler.
41
+	 *
42
+	 * @return void
43
+	 */
44
+	public static function registerJs() 
45
+	{
46 46
 
47
-        $post_id = absint(get_queried_object_id());
47
+		$post_id = absint(get_queried_object_id());
48 48
 
49
-        $signin_page = absint(get_option('subway_login_page'));
49
+		$signin_page = absint(get_option('subway_login_page'));
50 50
 
51
-        // Only load the stylesheet and javascript documents inside our sign-in page.
52
-        if ($post_id === $signin_page ) {
51
+		// Only load the stylesheet and javascript documents inside our sign-in page.
52
+		if ($post_id === $signin_page ) {
53 53
 
54
-            wp_enqueue_style(
55
-                'subway-style', 
56
-                SUBWAY_DIR_URL . 'assets/css/subway.css'
57
-            );
54
+			wp_enqueue_style(
55
+				'subway-style', 
56
+				SUBWAY_DIR_URL . 'assets/css/subway.css'
57
+			);
58 58
 
59
-            if (! is_user_logged_in() ) {
59
+			if (! is_user_logged_in() ) {
60 60
 
61
-                wp_enqueue_script(
62
-                    'subway-script', 
63
-                    SUBWAY_DIR_URL . 'assets/js/subway.js', 
64
-                    array( 'jquery' )
65
-                );
61
+				wp_enqueue_script(
62
+					'subway-script', 
63
+					SUBWAY_DIR_URL . 'assets/js/subway.js', 
64
+					array( 'jquery' )
65
+				);
66 66
 
67
-                wp_localize_script(
68
-                    'subway-script', 'subway_config', array(
69
-                    'ajax_url' => admin_url('admin-ajax.php'),
70
-                    'login_http_error' => esc_html__(
71
-                        'An error occured while 
67
+				wp_localize_script(
68
+					'subway-script', 'subway_config', array(
69
+					'ajax_url' => admin_url('admin-ajax.php'),
70
+					'login_http_error' => esc_html__(
71
+						'An error occured while 
72 72
                     	transmitting the data. Refresh the page and try again', 
73
-                        'subway'
74
-                    ),
75
-                    )
76
-                );
73
+						'subway'
74
+					),
75
+					)
76
+				);
77 77
 
78
-            }
79
-        }
78
+			}
79
+		}
80 80
 
81
-        return;
81
+		return;
82 82
 
83
-    }
83
+	}
84 84
 
85 85
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 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
 
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
         $signin_page = absint(get_option('subway_login_page'));
50 50
 
51 51
         // Only load the stylesheet and javascript documents inside our sign-in page.
52
-        if ($post_id === $signin_page ) {
52
+        if ($post_id === $signin_page) {
53 53
 
54 54
             wp_enqueue_style(
55 55
                 'subway-style', 
56 56
                 SUBWAY_DIR_URL . 'assets/css/subway.css'
57 57
             );
58 58
 
59
-            if (! is_user_logged_in() ) {
59
+            if ( ! is_user_logged_in()) {
60 60
 
61 61
                 wp_enqueue_script(
62 62
                     'subway-script', 
63 63
                     SUBWAY_DIR_URL . 'assets/js/subway.js', 
64
-                    array( 'jquery' )
64
+                    array('jquery')
65 65
                 );
66 66
 
67 67
                 wp_localize_script(
Please login to merge, or discard this patch.
classes/subway-helpers.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 namespace Subway;
21 21
 
22 22
 if (! defined('ABSPATH') ) {
23
-    return;
23
+	return;
24 24
 }
25 25
 
26 26
 /**
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
 final class Helpers
37 37
 {
38 38
 
39
-    /**
40
-     * Exit wrapper.
41
-     * 
42
-     * @return void
43
-     */
44
-    public static function close() 
45
-    {
46
-        exit;
47
-    }
39
+	/**
40
+	 * Exit wrapper.
41
+	 * 
42
+	 * @return void
43
+	 */
44
+	public static function close() 
45
+	{
46
+		exit;
47
+	}
48 48
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 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
 
Please login to merge, or discard this patch.
classes/subway-options.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 namespace Subway;
21 21
 
22 22
 if (! defined('ABSPATH') ) {
23
-    return;
23
+	return;
24 24
 }
25 25
 
26 26
 /**
@@ -36,73 +36,73 @@  discard block
 block discarded – undo
36 36
 final class Options
37 37
 {
38 38
 
39
-    /**
40
-     * Get the redirect page url.
41
-     *
42
-     * @return mixed The redirect url of our settings. Otherwise, false.
43
-     */
44
-    public static function getRedirectPageUrl() 
45
-    {
39
+	/**
40
+	 * Get the redirect page url.
41
+	 *
42
+	 * @return mixed The redirect url of our settings. Otherwise, false.
43
+	 */
44
+	public static function getRedirectPageUrl() 
45
+	{
46 46
 
47
-        $selected_login_post_id = intval(get_option('subway_login_page'));
47
+		$selected_login_post_id = intval(get_option('subway_login_page'));
48 48
 
49
-        if (0 === $selected_login_post_id ) {
49
+		if (0 === $selected_login_post_id ) {
50 50
 
51
-            return;
51
+			return;
52 52
 
53
-        }
53
+		}
54 54
 
55
-        $login_post = get_post($selected_login_post_id);
55
+		$login_post = get_post($selected_login_post_id);
56 56
 
57
-        if (! empty($login_post) ) {
57
+		if (! empty($login_post) ) {
58 58
 
59
-            return trailingslashit(get_permalink($login_post->ID));
59
+			return trailingslashit(get_permalink($login_post->ID));
60 60
 
61
-        }
61
+		}
62 62
 
63
-        return false;
63
+		return false;
64 64
 
65
-    }
65
+	}
66 66
 
67
-    /**
68
-     * Fetches the public post ids.
69
-     *
70
-     * @return array The collection of public 'post' IDs.
71
-     */
72
-    public static function getPublicPostsIdentifiers() 
73
-    {
67
+	/**
68
+	 * Fetches the public post ids.
69
+	 *
70
+	 * @return array The collection of public 'post' IDs.
71
+	 */
72
+	public static function getPublicPostsIdentifiers() 
73
+	{
74 74
 
75
-        $subway_public_post = get_option('subway_public_post');
75
+		$subway_public_post = get_option('subway_public_post');
76 76
 
77
-        $excluded_pages_collection = array();
77
+		$excluded_pages_collection = array();
78 78
 
79
-        if (! empty($subway_public_post) ) {
79
+		if (! empty($subway_public_post) ) {
80 80
 
81
-            $excluded_pages_collection = explode(',', $subway_public_post);
81
+			$excluded_pages_collection = explode(',', $subway_public_post);
82 82
 
83
-        }
83
+		}
84 84
 
85
-        // Should filter it by integer, spaces will be ignored, other strings.
86
-        // Will be converted to zero '0'.
87
-        return array_filter(array_map('intval', $excluded_pages_collection));
85
+		// Should filter it by integer, spaces will be ignored, other strings.
86
+		// Will be converted to zero '0'.
87
+		return array_filter(array_map('intval', $excluded_pages_collection));
88 88
 
89
-    }
89
+	}
90 90
 
91
-    /**
92
-     * Check if site is public or not.
93
-     *
94
-     * @return boolean True on success. Otherwise, false.
95
-     */
96
-    public static function isPublicSite() 
97
-    {
91
+	/**
92
+	 * Check if site is public or not.
93
+	 *
94
+	 * @return boolean True on success. Otherwise, false.
95
+	 */
96
+	public static function isPublicSite() 
97
+	{
98 98
 
99
-        $subway_public_post = get_option('subway_is_public');
99
+		$subway_public_post = get_option('subway_is_public');
100 100
 
101
-        if (! empty($subway_public_post) ) {
101
+		if (! empty($subway_public_post) ) {
102 102
 
103
-            return true;
103
+			return true;
104 104
 
105
-        }
106
-        return false;
107
-    }
105
+		}
106
+		return false;
107
+	}
108 108
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 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
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
         $selected_login_post_id = intval(get_option('subway_login_page'));
48 48
 
49
-        if (0 === $selected_login_post_id ) {
49
+        if (0 === $selected_login_post_id) {
50 50
 
51 51
             return;
52 52
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
         $login_post = get_post($selected_login_post_id);
56 56
 
57
-        if (! empty($login_post) ) {
57
+        if ( ! empty($login_post)) {
58 58
 
59 59
             return trailingslashit(get_permalink($login_post->ID));
60 60
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
         $excluded_pages_collection = array();
78 78
 
79
-        if (! empty($subway_public_post) ) {
79
+        if ( ! empty($subway_public_post)) {
80 80
 
81 81
             $excluded_pages_collection = explode(',', $subway_public_post);
82 82
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 
99 99
         $subway_public_post = get_option('subway_is_public');
100 100
 
101
-        if (! empty($subway_public_post) ) {
101
+        if ( ! empty($subway_public_post)) {
102 102
 
103 103
             return true;
104 104
 
Please login to merge, or discard this patch.
shortcodes/subway-shortcodes.php 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     /**
40 40
      * Class Constructor.
41 41
      *
42
-     * @return void
42
+     * @return Shortcodes
43 43
      */
44 44
     private function __construct() 
45 45
     {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     /**
54 54
      * Instantiate our class.
55 55
      * 
56
-     * @return mixed The instance of this class.
56
+     * @return Shortcodes|null The instance of this class.
57 57
      */
58 58
     public static function instance() 
59 59
     {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     /**
92 92
      * Displays the login form
93 93
      * 
94
-     * @return void
94
+     * @return null|string
95 95
      */
96 96
     public function loginForm( $atts )
97 97
     {
Please login to merge, or discard this patch.
Indentation   +137 added lines, -137 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 namespace Subway;
21 21
 
22 22
 if (! defined('ABSPATH') ) {
23
-    return;
23
+	return;
24 24
 }
25 25
 
26 26
 /**
@@ -36,166 +36,166 @@  discard block
 block discarded – undo
36 36
 final class Shortcodes
37 37
 {
38 38
 
39
-    /**
40
-     * Class Constructor.
41
-     *
42
-     * @return void
43
-     */
44
-    private function __construct() 
45
-    {
39
+	/**
40
+	 * Class Constructor.
41
+	 *
42
+	 * @return void
43
+	 */
44
+	private function __construct() 
45
+	{
46 46
         
47
-        add_action('init', array( $this, 'register'));
47
+		add_action('init', array( $this, 'register'));
48 48
         
49
-        return $this;
49
+		return $this;
50 50
 
51
-    }
51
+	}
52 52
 
53
-    /**
54
-     * Instantiate our class.
55
-     * 
56
-     * @return mixed The instance of this class.
57
-     */
58
-    public static function instance() 
59
-    {
53
+	/**
54
+	 * Instantiate our class.
55
+	 * 
56
+	 * @return mixed The instance of this class.
57
+	 */
58
+	public static function instance() 
59
+	{
60 60
         
61
-        static $instance = null;
62
-
63
-        if (null === $instance ) {
64
-
65
-            $instance = new Shortcodes();
66
-
67
-        }
68
-
69
-        return $instance;
70
-
71
-    }
72
-
73
-    /**
74
-     * Instantiate our class.
75
-     * 
76
-     * @return void
77
-     */
78
-    public function register() 
79
-    {
80
-
81
-        add_shortcode('subway_login', array( $this, 'loginForm' ));
82
-
83
-        add_action('login_form_middle', array( $this, 'loginFormAction' ), 10, 2);
84
-
85
-        add_action('login_form_middle', array( $this, 'lostPasswordLink' ), 10, 2);
86
-
87
-        return;
88
-
89
-    }
90
-
91
-    /**
92
-     * Displays the login form
93
-     * 
94
-     * @return void
95
-     */
96
-    public function loginForm( $atts )
97
-    {
98
-        $atts = shortcode_atts( array(
99
-            'echo'           => true,
100
-            'form_id'        => 'loginform',
101
-            'label_username' => __( 'Username', 'subway' ),
102
-            'label_password' => __( 'Password', 'subway' ),
103
-            'label_remember' => __( 'Remember Me', 'subway' ),
104
-            'label_log_in'   => __( 'Log In', 'subway' ),
105
-            'id_username'    => 'user_login',
106
-            'id_password'    => 'user_pass',
107
-            'id_remember'    => 'rememberme',
108
-            'id_submit'      => 'wp-submit',
109
-            'remember'       => true,
110
-            'value_username' => '',
111
-            'value_remember' => false,
112
-            'redirect'       => home_url(),
113
-        ), $atts );
114
-
115
-        return $this->renderTemplate($atts, 'login-form.php');
116
-    }
117
-
118
-    /**
119
-     * Include the specific plugin file if there is no template file.
120
-     * 
121
-     * @param mixed  $atts The shortcode attribute.
122
-     * @param string $file The shortcode template file.
123
-     * 
124
-     * @return string The html template content.
125
-     */
126
-    protected function renderTemplate( $atts, $file = '' ) 
127
-    {
128
-
129
-        ob_start();
130
-
131
-        if (empty($file) ) {
61
+		static $instance = null;
62
+
63
+		if (null === $instance ) {
64
+
65
+			$instance = new Shortcodes();
66
+
67
+		}
68
+
69
+		return $instance;
70
+
71
+	}
72
+
73
+	/**
74
+	 * Instantiate our class.
75
+	 * 
76
+	 * @return void
77
+	 */
78
+	public function register() 
79
+	{
80
+
81
+		add_shortcode('subway_login', array( $this, 'loginForm' ));
82
+
83
+		add_action('login_form_middle', array( $this, 'loginFormAction' ), 10, 2);
84
+
85
+		add_action('login_form_middle', array( $this, 'lostPasswordLink' ), 10, 2);
86
+
87
+		return;
88
+
89
+	}
90
+
91
+	/**
92
+	 * Displays the login form
93
+	 * 
94
+	 * @return void
95
+	 */
96
+	public function loginForm( $atts )
97
+	{
98
+		$atts = shortcode_atts( array(
99
+			'echo'           => true,
100
+			'form_id'        => 'loginform',
101
+			'label_username' => __( 'Username', 'subway' ),
102
+			'label_password' => __( 'Password', 'subway' ),
103
+			'label_remember' => __( 'Remember Me', 'subway' ),
104
+			'label_log_in'   => __( 'Log In', 'subway' ),
105
+			'id_username'    => 'user_login',
106
+			'id_password'    => 'user_pass',
107
+			'id_remember'    => 'rememberme',
108
+			'id_submit'      => 'wp-submit',
109
+			'remember'       => true,
110
+			'value_username' => '',
111
+			'value_remember' => false,
112
+			'redirect'       => home_url(),
113
+		), $atts );
114
+
115
+		return $this->renderTemplate($atts, 'login-form.php');
116
+	}
117
+
118
+	/**
119
+	 * Include the specific plugin file if there is no template file.
120
+	 * 
121
+	 * @param mixed  $atts The shortcode attribute.
122
+	 * @param string $file The shortcode template file.
123
+	 * 
124
+	 * @return string The html template content.
125
+	 */
126
+	protected function renderTemplate( $atts, $file = '' ) 
127
+	{
128
+
129
+		ob_start();
130
+
131
+		if (empty($file) ) {
132 132
             
133
-            return;
133
+			return;
134 134
 
135
-        }
135
+		}
136 136
 
137
-        $template = SUBWAY_DIR_PATH . 'templates/'.$file;
137
+		$template = SUBWAY_DIR_PATH . 'templates/'.$file;
138 138
 
139
-        if (file_exists($template) ) {
139
+		if (file_exists($template) ) {
140 140
 
141
-            $theme_template = locate_template(array('gears/shortcodes/'.$file ));
141
+			$theme_template = locate_template(array('gears/shortcodes/'.$file ));
142 142
 
143
-            if ($theme_template) {
143
+			if ($theme_template) {
144 144
 
145
-                   $template = $theme_template;
145
+				   $template = $theme_template;
146 146
 
147
-            }
147
+			}
148 148
 
149
-            include $template;
149
+			include $template;
150 150
 
151
-        } else {
151
+		} else {
152 152
 
153
-            echo sprintf(
154
-                esc_html_e(
155
-                    'Subway Error: Unable to find template file in: %1s', 'subway'
156
-                ), 
157
-                $template
158
-            );
153
+			echo sprintf(
154
+				esc_html_e(
155
+					'Subway Error: Unable to find template file in: %1s', 'subway'
156
+				), 
157
+				$template
158
+			);
159 159
 
160
-        }
160
+		}
161 161
 
162
-        return ob_get_clean();
163
-    }
162
+		return ob_get_clean();
163
+	}
164 164
 
165
-    /**
166
-     * The action for our login form.
167
-     * 
168
-     * @param string $__content The current filtered contents.
169
-     * 
170
-     * @return string            The content of our login form action.
171
-     */
172
-    public function loginFormAction( $__content ) 
173
-    {
165
+	/**
166
+	 * The action for our login form.
167
+	 * 
168
+	 * @param string $__content The current filtered contents.
169
+	 * 
170
+	 * @return string            The content of our login form action.
171
+	 */
172
+	public function loginFormAction( $__content ) 
173
+	{
174 174
 
175
-        ob_start();
175
+		ob_start();
176 176
         
177
-        do_action('login_form');
177
+		do_action('login_form');
178 178
         
179
-        return $__content . ob_get_clean();
180
-
181
-    }
182
-
183
-     /**
184
-     * The action for our 'lost password' link.
185
-     * 
186
-     * @param string $content The current filtered contents.
187
-     * 
188
-     * @return string          The content of our lost password link.
189
-     */
190
-    public function lostPasswordLink( $content ) 
191
-    {
179
+		return $__content . ob_get_clean();
180
+
181
+	}
182
+
183
+	 /**
184
+	  * The action for our 'lost password' link.
185
+	  * 
186
+	  * @param string $content The current filtered contents.
187
+	  * 
188
+	  * @return string          The content of our lost password link.
189
+	  */
190
+	public function lostPasswordLink( $content ) 
191
+	{
192 192
         
193
-        return $content . $this->renderTemplate(
194
-            array(), 
195
-            'login-form-lost-password.php'
196
-        );
193
+		return $content . $this->renderTemplate(
194
+			array(), 
195
+			'login-form-lost-password.php'
196
+		);
197 197
 
198
-    }
198
+	}
199 199
 
200 200
 }
201 201
 
Please login to merge, or discard this patch.
Spacing   +20 added lines, -20 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
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     private function __construct() 
45 45
     {
46 46
         
47
-        add_action('init', array( $this, 'register'));
47
+        add_action('init', array($this, 'register'));
48 48
         
49 49
         return $this;
50 50
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         
61 61
         static $instance = null;
62 62
 
63
-        if (null === $instance ) {
63
+        if (null === $instance) {
64 64
 
65 65
             $instance = new Shortcodes();
66 66
 
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
     public function register() 
79 79
     {
80 80
 
81
-        add_shortcode('subway_login', array( $this, 'loginForm' ));
81
+        add_shortcode('subway_login', array($this, 'loginForm'));
82 82
 
83
-        add_action('login_form_middle', array( $this, 'loginFormAction' ), 10, 2);
83
+        add_action('login_form_middle', array($this, 'loginFormAction'), 10, 2);
84 84
 
85
-        add_action('login_form_middle', array( $this, 'lostPasswordLink' ), 10, 2);
85
+        add_action('login_form_middle', array($this, 'lostPasswordLink'), 10, 2);
86 86
 
87 87
         return;
88 88
 
@@ -93,15 +93,15 @@  discard block
 block discarded – undo
93 93
      * 
94 94
      * @return void
95 95
      */
96
-    public function loginForm( $atts )
96
+    public function loginForm($atts)
97 97
     {
98
-        $atts = shortcode_atts( array(
98
+        $atts = shortcode_atts(array(
99 99
             'echo'           => true,
100 100
             'form_id'        => 'loginform',
101
-            'label_username' => __( 'Username', 'subway' ),
102
-            'label_password' => __( 'Password', 'subway' ),
103
-            'label_remember' => __( 'Remember Me', 'subway' ),
104
-            'label_log_in'   => __( 'Log In', 'subway' ),
101
+            'label_username' => __('Username', 'subway'),
102
+            'label_password' => __('Password', 'subway'),
103
+            'label_remember' => __('Remember Me', 'subway'),
104
+            'label_log_in'   => __('Log In', 'subway'),
105 105
             'id_username'    => 'user_login',
106 106
             'id_password'    => 'user_pass',
107 107
             'id_remember'    => 'rememberme',
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             'value_username' => '',
111 111
             'value_remember' => false,
112 112
             'redirect'       => home_url(),
113
-        ), $atts );
113
+        ), $atts);
114 114
 
115 115
         return $this->renderTemplate($atts, 'login-form.php');
116 116
     }
@@ -123,22 +123,22 @@  discard block
 block discarded – undo
123 123
      * 
124 124
      * @return string The html template content.
125 125
      */
126
-    protected function renderTemplate( $atts, $file = '' ) 
126
+    protected function renderTemplate($atts, $file = '') 
127 127
     {
128 128
 
129 129
         ob_start();
130 130
 
131
-        if (empty($file) ) {
131
+        if (empty($file)) {
132 132
             
133 133
             return;
134 134
 
135 135
         }
136 136
 
137
-        $template = SUBWAY_DIR_PATH . 'templates/'.$file;
137
+        $template = SUBWAY_DIR_PATH . 'templates/' . $file;
138 138
 
139
-        if (file_exists($template) ) {
139
+        if (file_exists($template)) {
140 140
 
141
-            $theme_template = locate_template(array('gears/shortcodes/'.$file ));
141
+            $theme_template = locate_template(array('gears/shortcodes/' . $file));
142 142
 
143 143
             if ($theme_template) {
144 144
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * 
170 170
      * @return string            The content of our login form action.
171 171
      */
172
-    public function loginFormAction( $__content ) 
172
+    public function loginFormAction($__content) 
173 173
     {
174 174
 
175 175
         ob_start();
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      * 
188 188
      * @return string          The content of our lost password link.
189 189
      */
190
-    public function lostPasswordLink( $content ) 
190
+    public function lostPasswordLink($content) 
191 191
     {
192 192
         
193 193
         return $content . $this->renderTemplate(
Please login to merge, or discard this patch.
i18.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 namespace Subway;
21 21
 
22 22
 if (! defined('ABSPATH') ) {
23
-    return;
23
+	return;
24 24
 }
25 25
 
26 26
 /**
@@ -36,32 +36,32 @@  discard block
 block discarded – undo
36 36
 final class I18
37 37
 {
38 38
 
39
-    /**
40
-     * Class Constructor.
41
-     *
42
-     * @return void
43
-     */
44
-    public function __construct() 
45
-    {
39
+	/**
40
+	 * Class Constructor.
41
+	 *
42
+	 * @return void
43
+	 */
44
+	public function __construct() 
45
+	{
46 46
 
47
-        add_action('plugins_loaded', array( $this, 'subwayLocalizePlugin' ));
47
+		add_action('plugins_loaded', array( $this, 'subwayLocalizePlugin' ));
48 48
 
49
-        return;
50
-    }
49
+		return;
50
+	}
51 51
 
52
-    /**
53
-     * Subway l8n callback.
54
-     *
55
-     * @return void
56
-     */
57
-    public function subwayLocalizePlugin() 
58
-    {
52
+	/**
53
+	 * Subway l8n callback.
54
+	 *
55
+	 * @return void
56
+	 */
57
+	public function subwayLocalizePlugin() 
58
+	{
59 59
 
60
-        load_plugin_textdomain('subway', false, basename( dirname( __FILE__ ) ) . '/languages'  );
60
+		load_plugin_textdomain('subway', false, basename( dirname( __FILE__ ) ) . '/languages'  );
61 61
 
62
-        return;
62
+		return;
63 63
 
64
-    }
64
+	}
65 65
 
66 66
 }
67 67
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function __construct() 
45 45
     {
46 46
 
47
-        add_action('plugins_loaded', array( $this, 'subwayLocalizePlugin' ));
47
+        add_action('plugins_loaded', array($this, 'subwayLocalizePlugin'));
48 48
 
49 49
         return;
50 50
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     public function subwayLocalizePlugin() 
58 58
     {
59 59
 
60
-        load_plugin_textdomain('subway', false, basename( dirname( __FILE__ ) ) . '/languages'  );
60
+        load_plugin_textdomain('subway', false, basename(dirname(__FILE__)) . '/languages');
61 61
 
62 62
         return;
63 63
 
Please login to merge, or discard this patch.
templates/login-form.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @link     github.com/codehaiku/subway The Plugin Repository
18 18
  */
19 19
 
20
-if ( ! defined( 'ABSPATH' ) ) {
20
+if ( ! defined('ABSPATH')) {
21 21
 	return;
22 22
 }
23 23
 
@@ -25,100 +25,100 @@  discard block
 block discarded – undo
25 25
 
26 26
 $message_types = array();
27 27
 
28
-$http_request_login = filter_input( INPUT_GET, 'login', FILTER_SANITIZE_SPECIAL_CHARS );
28
+$http_request_login = filter_input(INPUT_GET, 'login', FILTER_SANITIZE_SPECIAL_CHARS);
29 29
 
30
-$http_request_type = filter_input( INPUT_GET, 'type', FILTER_SANITIZE_SPECIAL_CHARS );
30
+$http_request_type = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_SPECIAL_CHARS);
31 31
 
32
-$http_request_logout = filter_input( INPUT_GET, 'loggedout', FILTER_SANITIZE_SPECIAL_CHARS );
32
+$http_request_logout = filter_input(INPUT_GET, 'loggedout', FILTER_SANITIZE_SPECIAL_CHARS);
33 33
 
34
-if ( isset( $http_request_login ) ) {
34
+if (isset($http_request_login)) {
35 35
 
36
-	if ( 'failed' === $http_request_login ) {
36
+	if ('failed' === $http_request_login) {
37 37
 
38
-		if ( isset( $http_request_type ) ) {
38
+		if (isset($http_request_type)) {
39 39
 
40 40
 			$message_types = array(
41 41
 
42 42
 				'default' => array(
43
-						'message' => __( 'There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway' ),
43
+						'message' => __('There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway'),
44 44
 					),
45 45
 				'__blank' => array(
46
-						'message' => __( 'Required: Username and Password cannot be empty.', 'subway' ),
46
+						'message' => __('Required: Username and Password cannot be empty.', 'subway'),
47 47
 					),
48 48
 				'__userempty' => array(
49
-						'message' => __( 'Required: Username cannot be empty.', 'subway' ),
49
+						'message' => __('Required: Username cannot be empty.', 'subway'),
50 50
 					),
51 51
 				'__passempty' => array(
52
-						'message' => __( 'Required: Password cannot be empty.', 'subway' ),
52
+						'message' => __('Required: Password cannot be empty.', 'subway'),
53 53
 					),
54 54
 				'fb_invalid_email' => array(
55
-						'message' => __( 'Facebook email address is invalid or is not yet verified.', 'subway' ),
55
+						'message' => __('Facebook email address is invalid or is not yet verified.', 'subway'),
56 56
 					),
57 57
 				'fb_error' => array(
58
-						'message' => __( 'Facebook Application Error. Misconfigured or App is rejected.', 'subway' ),
58
+						'message' => __('Facebook Application Error. Misconfigured or App is rejected.', 'subway'),
59 59
 					),
60 60
 				'app_not_live' => array(
61
-						'message' => __( 'Unable to fetch your Facebook Profile.', 'subway' ),
61
+						'message' => __('Unable to fetch your Facebook Profile.', 'subway'),
62 62
 					),
63 63
 				'gears_username_or_email_exists' => array(
64
-						'message' => __( 'Username or email address already exists', 'subway' ),
64
+						'message' => __('Username or email address already exists', 'subway'),
65 65
 					),
66 66
 				'gp_error_authentication' => array(
67
-						'message' => __( 'Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway' ),
67
+						'message' => __('Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway'),
68 68
 					),
69 69
 			);
70 70
 
71 71
 			$message = $message_types['default']['message'];
72 72
 
73
-			if ( array_key_exists( $http_request_type, $message_types ) ) {
73
+			if (array_key_exists($http_request_type, $message_types)) {
74 74
 
75
-				$message = $message_types[ $http_request_type ]['message'];
75
+				$message = $message_types[$http_request_type]['message'];
76 76
 
77 77
 			}
78 78
 
79
-			$error_login_message = '<div id="message" class="error">' . esc_html( $message ) . '</div>';
79
+			$error_login_message = '<div id="message" class="error">' . esc_html($message) . '</div>';
80 80
 
81 81
 		} else {
82 82
 
83
-			$error_login_message = '<div id="message" class="error">' . esc_html__( 'Error: Invalid username and password combination.', 'subway' ) . '</div>';
83
+			$error_login_message = '<div id="message" class="error">' . esc_html__('Error: Invalid username and password combination.', 'subway') . '</div>';
84 84
 
85 85
 		}
86 86
 	}
87 87
 }
88 88
 
89
-if ( isset( $http_request_logout ) ) {
90
-	$error_login_message = '<div id="message" class="success">' . esc_html__( 'You have logged out successfully.', 'subway' ) . '</div>';
89
+if (isset($http_request_logout)) {
90
+	$error_login_message = '<div id="message" class="success">' . esc_html__('You have logged out successfully.', 'subway') . '</div>';
91 91
 }
92 92
 
93
-$http_request_redirected = filter_input( INPUT_GET, '_redirected', FILTER_SANITIZE_SPECIAL_CHARS );
93
+$http_request_redirected = filter_input(INPUT_GET, '_redirected', FILTER_SANITIZE_SPECIAL_CHARS);
94 94
 
95
-if ( isset( $http_request_redirected ) ) {
96
-	$error_login_message = '<div id="message" class="success">' . esc_html__( 'Members only page. Please use the login form below to access the page.', 'subway' ) . '</div>';
95
+if (isset($http_request_redirected)) {
96
+	$error_login_message = '<div id="message" class="success">' . esc_html__('Members only page. Please use the login form below to access the page.', 'subway') . '</div>';
97 97
 }
98 98
 
99 99
 ?>
100
-<?php if ( ! is_user_logged_in() ) { ?>
100
+<?php if ( ! is_user_logged_in()) { ?>
101 101
 	<div class="mg-top-35 mg-bottom-35 subway-login-form">
102 102
 		<div class="subway-login-form-form">
103 103
 			<div class="subway-login-form__actions">
104 104
 				<h3>
105
-					<?php esc_html_e( 'Account Sign-in', 'subway' ); ?>
105
+					<?php esc_html_e('Account Sign-in', 'subway'); ?>
106 106
 				</h3>
107
-				<?php do_action( 'gears_login_form' ); ?>
107
+				<?php do_action('gears_login_form'); ?>
108 108
 			</div>
109 109
 			<div class="subway-login-form-message">
110
-				<?php echo wp_kses_post( $error_login_message ); ?>
110
+				<?php echo wp_kses_post($error_login_message); ?>
111 111
 			</div>
112 112
 			<div class="subway-login-form__form">
113
-				<?php echo wp_login_form( $atts ); ?>
113
+				<?php echo wp_login_form($atts); ?>
114 114
 			</div>
115 115
 		</div>
116 116
 	</div>
117 117
 <?php } else { ?>
118 118
 	<div class="mg-top-35 mg-bottom-35 subway-login-sucessfull" style="background: #CDDC39; padding: 15px 15px 15px 15px;border-radius: 4px;color: #616161;">
119 119
 		<p style="margin-bottom: 0px;">
120
-			<?php $success_message = apply_filters( 'subway_login_message_success', esc_html__( 'Great! You have succesfully logged in.', 'subway' ) ); ?>
121
-			<?php echo esc_html( $success_message ); ?>
120
+			<?php $success_message = apply_filters('subway_login_message_success', esc_html__('Great! You have succesfully logged in.', 'subway')); ?>
121
+			<?php echo esc_html($success_message); ?>
122 122
 		</p>
123 123
 	</div>
124 124
 <?php } ?>
Please login to merge, or discard this patch.
classes/subway-auth-redirect.php 2 patches
Spacing   +14 added lines, -14 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
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
         $pwd = filter_input(INPUT_POST, 'pwd', FILTER_SANITIZE_STRING);
53 53
 
54
-        if (empty($log) && empty($pwd) ) {
54
+        if (empty($log) && empty($pwd)) {
55 55
 
56 56
             $response['type'] = 'error';
57 57
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
             $response = array();
68 68
 
69
-            if (is_wp_error($is_signin) ) {
69
+            if (is_wp_error($is_signin)) {
70 70
 
71 71
                 $response['type'] = 'error';
72 72
 
@@ -105,24 +105,24 @@  discard block
 block discarded – undo
105 105
      *
106 106
      * @return string             The final redirect url.
107 107
      */
108
-    public static function getLoginRedirectUrl( $redirect_to, $user )
108
+    public static function getLoginRedirectUrl($redirect_to, $user)
109 109
     {
110 110
 
111 111
         $subway_redirect_type = get_option('subway_redirect_type');
112 112
 
113 113
         // Redirect the user to default behaviour.
114 114
         // If there are no redirect type option saved.
115
-        if (empty($subway_redirect_type) ) {
115
+        if (empty($subway_redirect_type)) {
116 116
 
117 117
             return $redirect_to;
118 118
 
119 119
         }
120 120
 
121
-        if ('default' === $subway_redirect_type ) {
121
+        if ('default' === $subway_redirect_type) {
122 122
             return $redirect_to;
123 123
         }
124 124
 
125
-        if ('page' === $subway_redirect_type ) {
125
+        if ('page' === $subway_redirect_type) {
126 126
 
127 127
             // Get the page url of the selected page.
128 128
             // If the admin selected 'Custom Page' in the redirect type settings.
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
             // Redirect to default WordPress behaviour.
132 132
             // If the user did not select page.
133
-            if (empty($selected_redirect_page) ) {
133
+            if (empty($selected_redirect_page)) {
134 134
 
135 135
                 return $redirect_to;
136 136
             }
@@ -139,14 +139,14 @@  discard block
 block discarded – undo
139 139
             // and let the user go into that page.
140 140
             return get_permalink($selected_redirect_page);
141 141
 
142
-        } elseif ('custom_url' === $subway_redirect_type ) {
142
+        } elseif ('custom_url' === $subway_redirect_type) {
143 143
 
144 144
             // Get the custom url saved in the redirect type settings.
145 145
             $entered_custom_url = get_option('subway_redirect_custom_url');
146 146
 
147 147
             // Redirect to default WordPress behaviour
148 148
             // if the user did enter a custom url.
149
-            if (empty($entered_custom_url) ) {
149
+            if (empty($entered_custom_url)) {
150 150
 
151 151
                 return $redirect_to;
152 152
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 
155 155
             // Otherwise, get the custom url saved
156 156
             // and let the user go into that page.
157
-            if (! empty($user->ID) ) {
157
+            if ( ! empty($user->ID)) {
158 158
                 $entered_custom_url = str_replace(
159 159
                     '%user_id%', $user->ID,
160 160
                     $entered_custom_url
161 161
                 );
162 162
             }
163 163
 
164
-            if (! empty($user->user_login) ) {
164
+            if ( ! empty($user->user_login)) {
165 165
                 $entered_custom_url = str_replace(
166 166
                     '%user_name%', $user->user_login,
167 167
                     $entered_custom_url
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
      *
184 184
      * @return string            The final login url.
185 185
      */
186
-    public static function loginUrl( $login_url  )
186
+    public static function loginUrl($login_url)
187 187
     {
188 188
 
189 189
         $subway_login_page = Options::getRedirectPageUrl();
190 190
 
191 191
         // Return the default login url if there is no log-in page defined.
192
-        if (empty($subway_login_page) ) {
192
+        if (empty($subway_login_page)) {
193 193
             return $login_url;
194 194
         }
195 195
 
Please login to merge, or discard this patch.
Indentation   +127 added lines, -127 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 namespace Subway;
21 21
 
22 22
 if (! defined('ABSPATH') ) {
23
-    return;
23
+	return;
24 24
 }
25 25
 
26 26
 /**
@@ -36,183 +36,183 @@  discard block
 block discarded – undo
36 36
 final class AuthRedirect
37 37
 {
38 38
 
39
-    /**
40
-     * Handles our ajax authentication.
41
-     *
42
-     * @return void
43
-     */
44
-    public static function handleAuthentication()
45
-    {
39
+	/**
40
+	 * Handles our ajax authentication.
41
+	 *
42
+	 * @return void
43
+	 */
44
+	public static function handleAuthentication()
45
+	{
46 46
 
47
-        // Set the header type to json.
48
-        header('Content-Type: application/json');
47
+		// Set the header type to json.
48
+		header('Content-Type: application/json');
49 49
 
50
-        $log = filter_input(INPUT_POST, 'log', FILTER_SANITIZE_STRING);
50
+		$log = filter_input(INPUT_POST, 'log', FILTER_SANITIZE_STRING);
51 51
 
52
-        $pwd = filter_input(INPUT_POST, 'pwd', FILTER_SANITIZE_STRING);
52
+		$pwd = filter_input(INPUT_POST, 'pwd', FILTER_SANITIZE_STRING);
53 53
 
54
-        if (empty($log) && empty($pwd) ) {
54
+		if (empty($log) && empty($pwd) ) {
55 55
 
56
-            $response['type'] = 'error';
56
+			$response['type'] = 'error';
57 57
 
58
-            $response['message'] = esc_html__(
59
-                'Username and Password cannot be empty.',
60
-                'subway'
61
-            );
58
+			$response['message'] = esc_html__(
59
+				'Username and Password cannot be empty.',
60
+				'subway'
61
+			);
62 62
 
63
-        } else {
63
+		} else {
64 64
 
65
-            $is_signin = wp_signon();
65
+			$is_signin = wp_signon();
66 66
 
67
-            $response = array();
67
+			$response = array();
68 68
 
69
-            if (is_wp_error($is_signin) ) {
69
+			if (is_wp_error($is_signin) ) {
70 70
 
71
-                $response['type'] = 'error';
71
+				$response['type'] = 'error';
72 72
 
73
-                $response['message'] = $is_signin->get_error_message();
73
+				$response['message'] = $is_signin->get_error_message();
74 74
 
75
-            } else {
75
+			} else {
76 76
 
77
-                $response['type'] = 'success';
77
+				$response['type'] = 'success';
78 78
 
79
-                $response['message'] = esc_html__(
80
-                    'You have successfully logged-in. Redirecting you in few seconds...',
81
-                    'subway'
82
-                );
79
+				$response['message'] = esc_html__(
80
+					'You have successfully logged-in. Redirecting you in few seconds...',
81
+					'subway'
82
+				);
83 83
 
84
-            }
85
-        }
84
+			}
85
+		}
86 86
 
87
-        $subway_redirect_url = AuthRedirect::getLoginRedirectUrl('', $is_signin);
87
+		$subway_redirect_url = AuthRedirect::getLoginRedirectUrl('', $is_signin);
88 88
 
89
-        $response['redirect_url'] = apply_filters(
90
-            'subway_login_redirect',
91
-            $subway_redirect_url,
92
-            $is_signin
93
-        );
89
+		$response['redirect_url'] = apply_filters(
90
+			'subway_login_redirect',
91
+			$subway_redirect_url,
92
+			$is_signin
93
+		);
94 94
 
95
-        echo wp_json_encode($response);
95
+		echo wp_json_encode($response);
96 96
 
97
-        wp_die();
97
+		wp_die();
98 98
 
99
-    }
99
+	}
100 100
 
101
-    /**
102
-     * Returns the filtered redirect url for the current user.
103
-     *
104
-     * @param string $redirect_to The default redirect callback argument.
105
-     * @param mixed  $user        This holds the meta info of currently logged-in user.
106
-     *
107
-     * @return string             The final redirect url.
108
-     */
109
-    public static function getLoginRedirectUrl( $redirect_to, $user )
110
-    {
101
+	/**
102
+	 * Returns the filtered redirect url for the current user.
103
+	 *
104
+	 * @param string $redirect_to The default redirect callback argument.
105
+	 * @param mixed  $user        This holds the meta info of currently logged-in user.
106
+	 *
107
+	 * @return string             The final redirect url.
108
+	 */
109
+	public static function getLoginRedirectUrl( $redirect_to, $user )
110
+	{
111 111
 
112
-        $subway_redirect_type = get_option('subway_redirect_type');
112
+		$subway_redirect_type = get_option('subway_redirect_type');
113 113
 
114
-        // Redirect the user to default behaviour.
115
-        // If there are no redirect type option saved.
116
-        if (empty($subway_redirect_type) ) {
114
+		// Redirect the user to default behaviour.
115
+		// If there are no redirect type option saved.
116
+		if (empty($subway_redirect_type) ) {
117 117
 
118
-            return $redirect_to;
118
+			return $redirect_to;
119 119
 
120
-        }
120
+		}
121 121
 
122
-        if ('default' === $subway_redirect_type ) {
123
-            return $redirect_to;
124
-        }
122
+		if ('default' === $subway_redirect_type ) {
123
+			return $redirect_to;
124
+		}
125 125
 
126
-        if ('page' === $subway_redirect_type ) {
126
+		if ('page' === $subway_redirect_type ) {
127 127
 
128
-            // Get the page url of the selected page.
129
-            // If the admin selected 'Custom Page' in the redirect type settings.
130
-            $selected_redirect_page = intval(get_option('subway_redirect_page_id'));
128
+			// Get the page url of the selected page.
129
+			// If the admin selected 'Custom Page' in the redirect type settings.
130
+			$selected_redirect_page = intval(get_option('subway_redirect_page_id'));
131 131
 
132
-            // Redirect to default WordPress behaviour.
133
-            // If the user did not select page.
134
-            if (empty($selected_redirect_page) ) {
132
+			// Redirect to default WordPress behaviour.
133
+			// If the user did not select page.
134
+			if (empty($selected_redirect_page) ) {
135 135
 
136
-                return $redirect_to;
137
-            }
136
+				return $redirect_to;
137
+			}
138 138
 
139
-            // Otherwise, get the permalink of the saved page
140
-            // and let the user go into that page.
141
-            return get_permalink($selected_redirect_page);
139
+			// Otherwise, get the permalink of the saved page
140
+			// and let the user go into that page.
141
+			return get_permalink($selected_redirect_page);
142 142
 
143
-        } elseif ('custom_url' === $subway_redirect_type ) {
143
+		} elseif ('custom_url' === $subway_redirect_type ) {
144 144
 
145
-            // Get the custom url saved in the redirect type settings.
146
-            $entered_custom_url = get_option('subway_redirect_custom_url');
145
+			// Get the custom url saved in the redirect type settings.
146
+			$entered_custom_url = get_option('subway_redirect_custom_url');
147 147
 
148
-            // Redirect to default WordPress behaviour
149
-            // if the user did enter a custom url.
150
-            if (empty($entered_custom_url) ) {
148
+			// Redirect to default WordPress behaviour
149
+			// if the user did enter a custom url.
150
+			if (empty($entered_custom_url) ) {
151 151
 
152
-                return $redirect_to;
152
+				return $redirect_to;
153 153
 
154
-            }
154
+			}
155 155
 
156
-            // Otherwise, get the custom url saved
157
-            // and let the user go into that page.
158
-            if (! empty($user->ID) ) {
159
-                $entered_custom_url = str_replace(
160
-                    '%user_id%', $user->ID,
161
-                    $entered_custom_url
162
-                );
163
-            }
156
+			// Otherwise, get the custom url saved
157
+			// and let the user go into that page.
158
+			if (! empty($user->ID) ) {
159
+				$entered_custom_url = str_replace(
160
+					'%user_id%', $user->ID,
161
+					$entered_custom_url
162
+				);
163
+			}
164 164
 
165
-            if (! empty($user->user_login) ) {
166
-                $entered_custom_url = str_replace(
167
-                    '%user_name%', $user->user_login,
168
-                    $entered_custom_url
169
-                );
170
-            }
165
+			if (! empty($user->user_login) ) {
166
+				$entered_custom_url = str_replace(
167
+					'%user_name%', $user->user_login,
168
+					$entered_custom_url
169
+				);
170
+			}
171 171
 
172
-            return $entered_custom_url;
172
+			return $entered_custom_url;
173 173
 
174
-        }
174
+		}
175 175
 
176
-        // Otherwise, quit and redirect the user back to default WordPress behaviour.
177
-        return $redirect_to;
178
-    }
176
+		// Otherwise, quit and redirect the user back to default WordPress behaviour.
177
+		return $redirect_to;
178
+	}
179 179
 
180
-    /**
181
-     * Callback function for the 'login_url' filter defined in Subway.php
182
-     *
183
-     * @param string $login_url The login url.
184
-     *
185
-     * @return string            The final login url.
186
-     */
187
-    public static function loginUrl( $login_url  )
188
-    {
180
+	/**
181
+	 * Callback function for the 'login_url' filter defined in Subway.php
182
+	 *
183
+	 * @param string $login_url The login url.
184
+	 *
185
+	 * @return string            The final login url.
186
+	 */
187
+	public static function loginUrl( $login_url  )
188
+	{
189 189
 
190
-        $subway_login_page = Options::getRedirectPageUrl();
190
+		$subway_login_page = Options::getRedirectPageUrl();
191 191
 
192
-        // Return the default login url if there is no log-in page defined.
193
-        if (empty($subway_login_page) ) {
194
-            return $login_url;
195
-        }
192
+		// Return the default login url if there is no log-in page defined.
193
+		if (empty($subway_login_page) ) {
194
+			return $login_url;
195
+		}
196 196
 
197
-        // Otherwise, return the Subway login page.
198
-        return $subway_login_page;
197
+		// Otherwise, return the Subway login page.
198
+		return $subway_login_page;
199 199
 
200
-    }
200
+	}
201 201
 
202
-    /**
203
-     * The callback function for our logout filter.
204
-     *
205
-     * @return void
206
-     */
207
-    public static function logoutUrl()
208
-    {
202
+	/**
203
+	 * The callback function for our logout filter.
204
+	 *
205
+	 * @return void
206
+	 */
207
+	public static function logoutUrl()
208
+	{
209 209
 
210
-        $subway_login_page = Options::getRedirectPageUrl();
210
+		$subway_login_page = Options::getRedirectPageUrl();
211 211
 
212
-        wp_safe_redirect(esc_url($subway_login_page . '?loggedout=true'));
212
+		wp_safe_redirect(esc_url($subway_login_page . '?loggedout=true'));
213 213
 
214
-        Helpers::close();
214
+		Helpers::close();
215 215
 
216
-    }
216
+	}
217 217
 
218 218
 }
Please login to merge, or discard this patch.