Passed
Push — master ( ae7108...58dda0 )
by Joseph
69:36 queued 35:36
created
settings-fields/field-subway-login-page-form.php 1 patch
Spacing   +11 added lines, -11 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,24 +21,24 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function subway_login_page_form() {
23 23
 
24
-	$subway_login_page_id = intval( get_option( 'subway_login_page' ) );
24
+	$subway_login_page_id = intval(get_option('subway_login_page'));
25 25
 
26
-	if ( ! empty( $subway_login_page_id ) ) {
26
+	if ( ! empty($subway_login_page_id)) {
27 27
 
28
-		$login_page_object = get_post( $subway_login_page_id );
28
+		$login_page_object = get_post($subway_login_page_id);
29 29
 
30
-		if ( ! empty( $login_page_object )  && isset( $login_page_object->post_content ) ) {
30
+		if ( ! empty($login_page_object) && isset($login_page_object->post_content)) {
31 31
 
32 32
 			// Automatically prepend the login shortcode if no
33 33
 			// Shortcode exists in the selected login page.
34
-			if ( ! has_shortcode( $login_page_object->post_content, 'subway_login' ) ) {
34
+			if ( ! has_shortcode($login_page_object->post_content, 'subway_login')) {
35 35
 
36 36
 				$new_post_object = array(
37 37
 				  'ID' => $login_page_object->ID,
38
-				  'post_content' => '[subway_login] ' . $login_page_object->post_content,// Prepend Only.
38
+				  'post_content' => '[subway_login] ' . $login_page_object->post_content, // Prepend Only.
39 39
 				 );
40 40
 
41
-				wp_update_post( $new_post_object );
41
+				wp_update_post($new_post_object);
42 42
 			}
43 43
 		}
44 44
 	}
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 	wp_dropdown_pages(
47 47
 		array(
48 48
 		'name' => 'subway_login_page',
49
-		'selected' => intval( $subway_login_page_id ),
50
-		'show_option_none' => esc_html__( '---', 'subway' ),
49
+		'selected' => intval($subway_login_page_id),
50
+		'show_option_none' => esc_html__('---', 'subway'),
51 51
 		)
52 52
 	);
53 53
 
54
-	echo '<p class="description">' . sprintf( esc_html__( 'Select a login page and save the changes to make your site private. Leave blank to make your site public. %1$s.', 'subway' ), '<span style="font-weight: bold; color: #ad4a4a;">' . esc_html__( 'You need to add "[subway_login]" shortcode in the selected page to show the login form (this is done automatically)', 'subway' ) ) . '</span></p>';
54
+	echo '<p class="description">' . sprintf(esc_html__('Select a login page and save the changes to make your site private. Leave blank to make your site public. %1$s.', 'subway'), '<span style="font-weight: bold; color: #ad4a4a;">' . esc_html__('You need to add "[subway_login]" shortcode in the selected page to show the login form (this is done automatically)', 'subway')) . '</span></p>';
55 55
 
56 56
 	return;
57 57
 }
58 58
\ No newline at end of file
Please login to merge, or discard this patch.
settings-fields/field-subway-lock-wp-admin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,24 +10,24 @@
 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
 
17 17
 function subway_lock_wp_admin() { ?>
18 18
 
19 19
 	<label for="subway_redirect_wp_admin">
20
-		<input <?php echo checked( 1, get_option( 'subway_redirect_wp_admin' ), false ) ;?> value="1" name="subway_redirect_wp_admin" 
20
+		<input <?php echo checked(1, get_option('subway_redirect_wp_admin'), false); ?> value="1" name="subway_redirect_wp_admin" 
21 21
 		id="subway_redirect_wp_admin" type="checkbox" class="code" /> 
22
-		<?php esc_html_e( 'Check to hide /wp-admin or /wp-login.php to logged out users and redirect them to Subway custom login form.', 'subway' ); ?>
22
+		<?php esc_html_e('Check to hide /wp-admin or /wp-login.php to logged out users and redirect them to Subway custom login form.', 'subway'); ?>
23 23
 		
24 24
 	</label>
25 25
 
26 26
 	<p class="description">
27 27
 		<?php 
28
-			echo sprintf( __( "<br/>In case, you were locked out. Use the link below to bypass the log-in page and go directly 
28
+			echo sprintf(__("<br/>In case, you were locked out. Use the link below to bypass the log-in page and go directly 
29 29
 			to your website's wp-login URL (http://yoursiteurl.com/wp-login.php):
30
-			<br> <strong>%s</strong>", 'subway' ), site_url( 'wp-login.php?no_redirect=true' ) ); 
30
+			<br> <strong>%s</strong>", 'subway'), site_url('wp-login.php?no_redirect=true')); 
31 31
 		?>
32 32
 	</p>
33 33
 <?php
Please login to merge, or discard this patch.
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.
settings-fields/field-subway-public-post.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@
 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
 
17 17
 function subway_public_post() {
18 18
 
19
-	echo '<textarea id="subway_public_post" name="subway_public_post" rows="5" cols="95">' . esc_attr( trim( get_option( 'subway_public_post' ) ) ) . '</textarea>';
19
+	echo '<textarea id="subway_public_post" name="subway_public_post" rows="5" cols="95">' . esc_attr(trim(get_option('subway_public_post'))) . '</textarea>';
20 20
 
21
-	echo '<p class="description">' . nl2br( esc_html( "Enter the IDs of posts and pages that you wanted to show in public. You need to separate it by ',' (comma),  for example: 143,123,213. Alternatively, you can enable public viewing of all of your pages and posts by checking the 'Public Website' option above.", 'subway' ) ) . '</p>';
21
+	echo '<p class="description">' . nl2br(esc_html("Enter the IDs of posts and pages that you wanted to show in public. You need to separate it by ',' (comma),  for example: 143,123,213. Alternatively, you can enable public viewing of all of your pages and posts by checking the 'Public Website' option above.", 'subway')) . '</p>';
22 22
 
23 23
 	return;
24 24
 
Please login to merge, or discard this patch.
templates/login-form.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -10,17 +10,17 @@  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
 
17 17
 $args = array(
18 18
 	'echo'           => true,
19 19
 	'form_id'        => 'loginform',
20
-	'label_username' => __( 'Username', 'subway' ),
21
-	'label_password' => __( 'Password', 'subway' ),
22
-	'label_remember' => __( 'Remember Me', 'subway' ),
23
-	'label_log_in'   => __( 'Log In', 'subway' ),
20
+	'label_username' => __('Username', 'subway'),
21
+	'label_password' => __('Password', 'subway'),
22
+	'label_remember' => __('Remember Me', 'subway'),
23
+	'label_log_in'   => __('Log In', 'subway'),
24 24
 	'id_username'    => 'user_login',
25 25
 	'id_password'    => 'user_pass',
26 26
 	'id_remember'    => 'rememberme',
@@ -35,87 +35,87 @@  discard block
 block discarded – undo
35 35
 
36 36
 $message_types = array();
37 37
 
38
-if ( isset( $_GET['login'] ) ) {
38
+if (isset($_GET['login'])) {
39 39
 
40
-	if ( 'failed' === $_GET['login'] ) {
40
+	if ('failed' === $_GET['login']) {
41 41
 
42
-		if ( isset( $_GET['type'] ) ) {
42
+		if (isset($_GET['type'])) {
43 43
 
44 44
 			$message_types = array(
45 45
 
46 46
 				'default' => array(
47
-						'message' => __( 'There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway' ),
47
+						'message' => __('There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway'),
48 48
 					),
49 49
 				'__blank' => array(
50
-						'message' => __( 'Required: Username and Password cannot be empty.', 'subway' ),
50
+						'message' => __('Required: Username and Password cannot be empty.', 'subway'),
51 51
 					),
52 52
 				'__userempty' => array(
53
-						'message' => __( 'Required: Username cannot be empty.', 'subway' ),
53
+						'message' => __('Required: Username cannot be empty.', 'subway'),
54 54
 					),
55 55
 				'__passempty' => array(
56
-						'message' => __( 'Required: Password cannot be empty.', 'subway' ),
56
+						'message' => __('Required: Password cannot be empty.', 'subway'),
57 57
 					),
58 58
 				'fb_invalid_email' => array(
59
-						'message' => __( 'Facebook email address is invalid or is not yet verified.', 'subway' ),
59
+						'message' => __('Facebook email address is invalid or is not yet verified.', 'subway'),
60 60
 					),
61 61
 				'fb_error' => array(
62
-						'message' => __( 'Facebook Application Error. Misconfigured or App is rejected.', 'subway' ),
62
+						'message' => __('Facebook Application Error. Misconfigured or App is rejected.', 'subway'),
63 63
 					),
64 64
 				'app_not_live' => array(
65
-						'message' => __( 'Unable to fetch your Facebook Profile.', 'subway' ),
65
+						'message' => __('Unable to fetch your Facebook Profile.', 'subway'),
66 66
 					),
67 67
 				'gears_username_or_email_exists' => array(
68
-						'message' => __( 'Username or email address already exists', 'subway' ),
68
+						'message' => __('Username or email address already exists', 'subway'),
69 69
 					),
70 70
 				'gp_error_authentication' => array(
71
-						'message' => __( 'Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway' ),
71
+						'message' => __('Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway'),
72 72
 					),
73 73
 			);
74 74
 
75 75
 			$message = $message_types['default']['message'];
76 76
 
77
-			if ( array_key_exists( $_GET['type'], $message_types ) ) {
77
+			if (array_key_exists($_GET['type'], $message_types)) {
78 78
 
79
-				$message = $message_types[ $_GET['type'] ]['message'];
79
+				$message = $message_types[$_GET['type']]['message'];
80 80
 
81 81
 			}
82 82
 
83
-			$error_login_message = '<div id="message" class="error">'. esc_html( $message ) .'</div>';
83
+			$error_login_message = '<div id="message" class="error">' . esc_html($message) . '</div>';
84 84
 
85 85
 		} else {
86 86
 
87
-			$error_login_message = '<div id="message" class="error">'. esc_html__ ( 'Error: Invalid username and password combination.', 'subway' ).'</div>';
87
+			$error_login_message = '<div id="message" class="error">' . esc_html__('Error: Invalid username and password combination.', 'subway') . '</div>';
88 88
 
89 89
 		}
90 90
 	}
91 91
 }
92 92
 
93
-if ( isset( $_GET['_redirected'] ) ) {
94
-	$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>';
93
+if (isset($_GET['_redirected'])) {
94
+	$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 95
 }
96 96
 
97 97
 ?>
98
-<?php if ( ! is_user_logged_in() ) { ?>
98
+<?php if ( ! is_user_logged_in()) { ?>
99 99
 	<div class="mg-top-35 mg-bottom-35 subway-login-form">
100 100
 		<div class="subway-login-form-form">
101 101
 			<div class="subway-login-form__actions">
102 102
 				<h3>
103
-					<?php esc_html_e( 'Account Sign-in', 'subway' ); ?>
103
+					<?php esc_html_e('Account Sign-in', 'subway'); ?>
104 104
 				</h3>
105
-				<?php do_action( 'gears_login_form' ); ?>
105
+				<?php do_action('gears_login_form'); ?>
106 106
 			</div>
107 107
 			<div class="subway-login-form-message">
108 108
 				<?php echo $error_login_message; ?>
109 109
 			</div>
110 110
 			<div class="subway-login-form__form">
111
-				<?php echo wp_login_form( $args ); ?>
111
+				<?php echo wp_login_form($args); ?>
112 112
 			</div>
113 113
 		</div>
114 114
 	</div>
115 115
 <?php } else { ?>
116 116
 	<div class="mg-top-35 mg-bottom-35 subway-login-sucessfull" style="background: #CDDC39; padding: 15px 15px 15px 15px;border-radius: 4px;color: #616161;">
117 117
 		<p style="margin-bottom: 0px;">
118
-			<?php echo esc_html__( apply_filters( 'subway_login_message', 'Great! You have succesfully login.' ), 'subway' ); ?>
118
+			<?php echo esc_html__(apply_filters('subway_login_message', 'Great! You have succesfully login.'), 'subway'); ?>
119 119
 		</p>
120 120
 	</div>
121 121
 <?php } ?>
Please login to merge, or discard this patch.