Passed
Pull Request — master (#42)
by Joseph
01:49
created
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 1 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 1 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 1 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 2 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.
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 1 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-metabox.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
      *
199 199
      * @since  2.0.9
200 200
      * @access public
201
-     * @return boolean false Returns false if nonce is not valid.
201
+     * @return boolean|null false Returns false if nonce is not valid.
202 202
      */
203 203
     public function saveVisibilityMetabox( $post_id = '' )
204 204
     {
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
      *
269 269
      * @since  2.0.9
270 270
      * @access public
271
-     * @return boolean false Returns false if nonce is not valid.
271
+     * @return boolean|null false Returns false if nonce is not valid.
272 272
      */
273 273
     public function saveMetaboxValues( $post_id )
274 274
     {
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
      *
308 308
      * @since  2.0.9
309 309
      * @access public
310
-     * @return boolean true Returns true if nonce is valid.
310
+     * @return null|boolean true Returns true if nonce is valid.
311 311
      */
312 312
     public function isNonceValid( $nonce )
313 313
     {
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 namespace Subway;
22 22
 
23
-if (! defined('ABSPATH') ) {
23
+if ( ! defined('ABSPATH')) {
24 24
     return;
25 25
 }
26 26
 
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
     {
93 93
         $post_types = $this->getPostTypes();
94 94
 
95
-        foreach ( $post_types as $post_type => $value ) {
95
+        foreach ($post_types as $post_type => $value) {
96 96
             add_meta_box(
97 97
                 'subway_visibility_metabox',
98 98
                 esc_html__('Subway: Visibility Option', 'subway'),
99
-                array( $this, 'visibilityMetabox' ),
99
+                array($this, 'visibilityMetabox'),
100 100
                 $post_type,
101 101
                 'side',
102 102
                 'low'
@@ -113,37 +113,37 @@  discard block
 block discarded – undo
113 113
      * @access public
114 114
      * @return void
115 115
      */
116
-    public function visibilityMetabox( $post )
116
+    public function visibilityMetabox($post)
117 117
     {
118 118
         $howto = __(
119 119
             'Choose the accessibility of this page from the options above.',
120 120
             'subway'
121 121
         );
122 122
       
123
-        $private_setting_label = __( 'Members Only', 'subway'  );
123
+        $private_setting_label = __('Members Only', 'subway');
124 124
 
125 125
         $is_post_public          = self::isPostPublic($post->ID);
126 126
         $is_post_private         = self::isPostPrivate($post->ID);
127 127
 
128 128
         // Make sure the form request comes from WordPress
129
-        wp_nonce_field(  basename(__FILE__),  'subway_post_visibility_nonce' );
129
+        wp_nonce_field(basename(__FILE__), 'subway_post_visibility_nonce');
130 130
 
131 131
         // Disable the options (radio) when site is selected as public
132 132
         ?>
133 133
         
134
-        <?php if ( ! Options::isPublicSite() ):  ?>
134
+        <?php if ( ! Options::isPublicSite()):  ?>
135 135
         <?php // Site is private. Give them some Beer! ?>
136 136
             <p>
137 137
                 <label class="subway-visibility-settings-checkbox-label" for="subway-visibility-public">
138
-                    <input type="radio" class="subway-visibility-settings-radio" id="subway-visibility-public" name="subway-visibility-settings" value="public" <?php echo checked( false, $is_post_private, false); ?>>
139
-                    <?php esc_html_e( 'Public','subway') ?>
138
+                    <input type="radio" class="subway-visibility-settings-radio" id="subway-visibility-public" name="subway-visibility-settings" value="public" <?php echo checked(false, $is_post_private, false); ?>>
139
+                    <?php esc_html_e('Public', 'subway') ?>
140 140
                 </label>
141 141
             </p>
142 142
             <p>
143 143
                 <label class="subway-visibility-settings-checkbox-label" for="subway-visibility-private">
144 144
                     <input type="radio" class="subway-visibility-settings-radio" id="subway-visibility-private" name="subway-visibility-settings"
145
-                    value="private" <?php echo checked( true, $is_post_private, false); ?>>
146
-                    <?php esc_html_e( 'Members Only','subway') ?>
145
+                    value="private" <?php echo checked(true, $is_post_private, false); ?>>
146
+                    <?php esc_html_e('Members Only', 'subway') ?>
147 147
                  </label>
148 148
             </p>
149 149
             <p class="howto"><?php echo esc_html($howto); ?></p>
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
      * @access public
167 167
      * @return boolean false Returns false if nonce is not valid.
168 168
      */
169
-    public function saveVisibilityMetabox( $post_id = '' )
169
+    public function saveVisibilityMetabox($post_id = '')
170 170
     {
171 171
 
172 172
         $public_posts     = Options::getPublicPostsIdentifiers();
@@ -192,29 +192,29 @@  discard block
 block discarded – undo
192 192
         );
193 193
 
194 194
         // verify taxonomies meta box nonce
195
-        if (false === $is_valid_visibility_nonce ) {
195
+        if (false === $is_valid_visibility_nonce) {
196 196
             return;
197 197
         }
198 198
 
199
-        if (! empty($post_visibility) ) {
200
-            if (! empty($post_id) ) {
201
-                if ('public' === $post_visibility ) {
202
-                    if (! in_array($post_id, $public_posts) ) {
199
+        if ( ! empty($post_visibility)) {
200
+            if ( ! empty($post_id)) {
201
+                if ('public' === $post_visibility) {
202
+                    if ( ! in_array($post_id, $public_posts)) {
203 203
                         array_push($public_posts, $post_id);
204 204
                     }
205 205
                 }
206
-                if ('private' === $post_visibility ) {
207
-                    unset($public_posts[ array_search($post_id, $public_posts) ]);
206
+                if ('private' === $post_visibility) {
207
+                    unset($public_posts[array_search($post_id, $public_posts)]);
208 208
                 }
209 209
             }
210 210
         }
211 211
 
212
-        if (! empty($post_id) ) {
212
+        if ( ! empty($post_id)) {
213 213
             $posts_implode = implode(", ", $public_posts);
214 214
 
215
-            if ('inherit' !== get_post_status($post_id) ) {
215
+            if ('inherit' !== get_post_status($post_id)) {
216 216
 
217
-                if (true === $is_valid_visibility_nonce ) {
217
+                if (true === $is_valid_visibility_nonce) {
218 218
                     update_option('subway_public_post', $posts_implode);
219 219
                     update_post_meta(
220 220
                         $post_id,
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
      * @access public
237 237
      * @return boolean false Returns false if nonce is not valid.
238 238
      */
239
-    public function saveMetaboxValues( $post_id )
239
+    public function saveMetaboxValues($post_id)
240 240
     {
241 241
         $this->saveVisibilityMetabox($post_id);
242 242
         return;
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
      * @access public
253 253
      * @return void
254 254
      */
255
-    public static function getPostTypes( $args = '', $output = '' )
255
+    public static function getPostTypes($args = '', $output = '')
256 256
     {
257
-        if (empty($args) ) {
257
+        if (empty($args)) {
258 258
             $args = array(
259 259
             'public'   => true,
260 260
             );
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
      * @access public
276 276
      * @return boolean true Returns true if nonce is valid.
277 277
      */
278
-    public function isNonceValid( $nonce )
278
+    public function isNonceValid($nonce)
279 279
     {
280
-        if (!isset($nonce) || !wp_verify_nonce($nonce, basename(__FILE__)) ) {
280
+        if ( ! isset($nonce) || ! wp_verify_nonce($nonce, basename(__FILE__))) {
281 281
             return;
282 282
         }
283 283
 
@@ -293,23 +293,23 @@  discard block
 block discarded – undo
293 293
      * @access public
294 294
      * @return boolean true Returns true if post is private. Otherwise false.
295 295
      */
296
-    public static function isPostPrivate( $post_id )
296
+    public static function isPostPrivate($post_id)
297 297
     {
298 298
         $meta_value = '';
299 299
 
300
-        if ( ! empty( $post_id ) ) {
300
+        if ( ! empty($post_id)) {
301 301
             $meta_value = get_post_meta($post_id, self::VISIBILITY_METAKEY, true);
302 302
 
303 303
             // New page or old pages that don't have Subway'\ Visibility Options
304
-            if ( empty ( $meta_value ) ) {
304
+            if (empty ($meta_value)) {
305 305
                 // Get the value from the general settings (Settings > Subway)
306 306
                 $is_site_public = Options::isPublicSite();
307
-                if ( ! $is_site_public ) {
307
+                if ( ! $is_site_public) {
308 308
                     // It's private.
309 309
                     return true;
310 310
                 }
311 311
             }
312
-            if ('private' === $meta_value ) {
312
+            if ('private' === $meta_value) {
313 313
                 return true;
314 314
             }
315 315
         }
@@ -326,12 +326,12 @@  discard block
 block discarded – undo
326 326
      * @access public
327 327
      * @return boolean true Returns true if post is public. Otherwise false.
328 328
      */
329
-    public static function isPostPublic( $post_id )
329
+    public static function isPostPublic($post_id)
330 330
     {
331 331
         $public_post = Options::getPublicPostsIdentifiers();
332 332
 
333
-        if (! empty($post_id) ) {
334
-            if (! in_array($post_id, $public_post, true) ) {
333
+        if ( ! empty($post_id)) {
334
+            if ( ! in_array($post_id, $public_post, true)) {
335 335
                 return true;
336 336
             }
337 337
         }
Please login to merge, or discard this patch.
settings-fields/field-subway-lock-wp-admin.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
 
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 
19 19
 	<p class="description">
20 20
 		<?php
21
-			echo sprintf( __( "In case, you were locked out. Use the link below to bypass the log-in page and go directly
22
-			to your website's wp-login URL (http://yoursiteurl.com/wp-login.php): <strong class='subway-settings-text-notice'>%s</strong>", 'subway' ), site_url( 'wp-login.php?no_redirect=true' ) ); 
21
+			echo sprintf(__("In case, you were locked out. Use the link below to bypass the log-in page and go directly
22
+			to your website's wp-login URL (http://yoursiteurl.com/wp-login.php): <strong class='subway-settings-text-notice'>%s</strong>", 'subway'), site_url('wp-login.php?no_redirect=true')); 
23 23
 		?>
24 24
 	</p>
25 25
 <?php
Please login to merge, or discard this patch.