@@ -10,17 +10,17 @@ discard block |
||
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,100 +35,100 @@ discard block |
||
35 | 35 | |
36 | 36 | $message_types = array(); |
37 | 37 | |
38 | -$http_request_login = filter_input( INPUT_GET, 'login', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
38 | +$http_request_login = filter_input(INPUT_GET, 'login', FILTER_SANITIZE_SPECIAL_CHARS); |
|
39 | 39 | |
40 | -$http_request_type = filter_input( INPUT_GET, 'type', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
40 | +$http_request_type = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_SPECIAL_CHARS); |
|
41 | 41 | |
42 | -$http_request_logout = filter_input( INPUT_GET, 'loggedout', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
42 | +$http_request_logout = filter_input(INPUT_GET, 'loggedout', FILTER_SANITIZE_SPECIAL_CHARS); |
|
43 | 43 | |
44 | -if ( isset( $http_request_login ) ) { |
|
44 | +if (isset($http_request_login)) { |
|
45 | 45 | |
46 | - if ( 'failed' === $http_request_login ) { |
|
46 | + if ('failed' === $http_request_login) { |
|
47 | 47 | |
48 | - if ( isset( $http_request_type ) ) { |
|
48 | + if (isset($http_request_type)) { |
|
49 | 49 | |
50 | 50 | $message_types = array( |
51 | 51 | |
52 | 52 | 'default' => array( |
53 | - 'message' => __( 'There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway' ), |
|
53 | + 'message' => __('There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway'), |
|
54 | 54 | ), |
55 | 55 | '__blank' => array( |
56 | - 'message' => __( 'Required: Username and Password cannot be empty.', 'subway' ), |
|
56 | + 'message' => __('Required: Username and Password cannot be empty.', 'subway'), |
|
57 | 57 | ), |
58 | 58 | '__userempty' => array( |
59 | - 'message' => __( 'Required: Username cannot be empty.', 'subway' ), |
|
59 | + 'message' => __('Required: Username cannot be empty.', 'subway'), |
|
60 | 60 | ), |
61 | 61 | '__passempty' => array( |
62 | - 'message' => __( 'Required: Password cannot be empty.', 'subway' ), |
|
62 | + 'message' => __('Required: Password cannot be empty.', 'subway'), |
|
63 | 63 | ), |
64 | 64 | 'fb_invalid_email' => array( |
65 | - 'message' => __( 'Facebook email address is invalid or is not yet verified.', 'subway' ), |
|
65 | + 'message' => __('Facebook email address is invalid or is not yet verified.', 'subway'), |
|
66 | 66 | ), |
67 | 67 | 'fb_error' => array( |
68 | - 'message' => __( 'Facebook Application Error. Misconfigured or App is rejected.', 'subway' ), |
|
68 | + 'message' => __('Facebook Application Error. Misconfigured or App is rejected.', 'subway'), |
|
69 | 69 | ), |
70 | 70 | 'app_not_live' => array( |
71 | - 'message' => __( 'Unable to fetch your Facebook Profile.', 'subway' ), |
|
71 | + 'message' => __('Unable to fetch your Facebook Profile.', 'subway'), |
|
72 | 72 | ), |
73 | 73 | 'gears_username_or_email_exists' => array( |
74 | - 'message' => __( 'Username or email address already exists', 'subway' ), |
|
74 | + 'message' => __('Username or email address already exists', 'subway'), |
|
75 | 75 | ), |
76 | 76 | 'gp_error_authentication' => array( |
77 | - 'message' => __( 'Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway' ), |
|
77 | + 'message' => __('Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway'), |
|
78 | 78 | ), |
79 | 79 | ); |
80 | 80 | |
81 | 81 | $message = $message_types['default']['message']; |
82 | 82 | |
83 | - if ( array_key_exists( $http_request_type, $message_types ) ) { |
|
83 | + if (array_key_exists($http_request_type, $message_types)) { |
|
84 | 84 | |
85 | - $message = $message_types[ $http_request_type ]['message']; |
|
85 | + $message = $message_types[$http_request_type]['message']; |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | |
89 | - $error_login_message = '<div id="message" class="error">' . esc_html( $message ) . '</div>'; |
|
89 | + $error_login_message = '<div id="message" class="error">' . esc_html($message) . '</div>'; |
|
90 | 90 | |
91 | 91 | } else { |
92 | 92 | |
93 | - $error_login_message = '<div id="message" class="error">' . esc_html__( 'Error: Invalid username and password combination.', 'subway' ) . '</div>'; |
|
93 | + $error_login_message = '<div id="message" class="error">' . esc_html__('Error: Invalid username and password combination.', 'subway') . '</div>'; |
|
94 | 94 | |
95 | 95 | } |
96 | 96 | } |
97 | 97 | } |
98 | 98 | |
99 | -if ( isset( $http_request_logout ) ) { |
|
100 | - $error_login_message = '<div id="message" class="success">' . esc_html__( 'You have logged out successfully.', 'subway' ) . '</div>'; |
|
99 | +if (isset($http_request_logout)) { |
|
100 | + $error_login_message = '<div id="message" class="success">' . esc_html__('You have logged out successfully.', 'subway') . '</div>'; |
|
101 | 101 | } |
102 | 102 | |
103 | -$http_request_redirected = filter_input( INPUT_GET, '_redirected', FILTER_SANITIZE_SPECIAL_CHARS ); |
|
103 | +$http_request_redirected = filter_input(INPUT_GET, '_redirected', FILTER_SANITIZE_SPECIAL_CHARS); |
|
104 | 104 | |
105 | -if ( isset( $http_request_redirected ) ) { |
|
106 | - $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>'; |
|
105 | +if (isset($http_request_redirected)) { |
|
106 | + $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>'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | ?> |
110 | -<?php if ( ! is_user_logged_in() ) { ?> |
|
110 | +<?php if ( ! is_user_logged_in()) { ?> |
|
111 | 111 | <div class="mg-top-35 mg-bottom-35 subway-login-form"> |
112 | 112 | <div class="subway-login-form-form"> |
113 | 113 | <div class="subway-login-form__actions"> |
114 | 114 | <h3> |
115 | - <?php esc_html_e( 'Account Sign-in', 'subway' ); ?> |
|
115 | + <?php esc_html_e('Account Sign-in', 'subway'); ?> |
|
116 | 116 | </h3> |
117 | - <?php do_action( 'gears_login_form' ); ?> |
|
117 | + <?php do_action('gears_login_form'); ?> |
|
118 | 118 | </div> |
119 | 119 | <div class="subway-login-form-message"> |
120 | - <?php echo wp_kses_post( $error_login_message ); ?> |
|
120 | + <?php echo wp_kses_post($error_login_message); ?> |
|
121 | 121 | </div> |
122 | 122 | <div class="subway-login-form__form"> |
123 | - <?php echo wp_login_form( $args ); ?> |
|
123 | + <?php echo wp_login_form($args); ?> |
|
124 | 124 | </div> |
125 | 125 | </div> |
126 | 126 | </div> |
127 | 127 | <?php } else { ?> |
128 | 128 | <div class="mg-top-35 mg-bottom-35 subway-login-sucessfull" style="background: #CDDC39; padding: 15px 15px 15px 15px;border-radius: 4px;color: #616161;"> |
129 | 129 | <p style="margin-bottom: 0px;"> |
130 | - <?php $success_message = apply_filters( 'subway_login_message_success', esc_html__( 'Great! You have succesfully login.', 'subway' ) ); ?> |
|
131 | - <?php echo esc_html( $success_message ); ?> |
|
130 | + <?php $success_message = apply_filters('subway_login_message_success', esc_html__('Great! You have succesfully login.', 'subway')); ?> |
|
131 | + <?php echo esc_html($success_message); ?> |
|
132 | 132 | </p> |
133 | 133 | </div> |
134 | 134 | <?php } ?> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | namespace Subway; |
14 | 14 | |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | return; |
17 | 17 | } |
18 | 18 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | 30 | |
31 | - add_action( 'admin_menu', array( $this, 'subway_admin_menu' ) ); |
|
31 | + add_action('admin_menu', array($this, 'subway_admin_menu')); |
|
32 | 32 | |
33 | - add_action( 'admin_init', array( $this, 'subway_register_settings' ) ); |
|
33 | + add_action('admin_init', array($this, 'subway_register_settings')); |
|
34 | 34 | |
35 | 35 | } |
36 | 36 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function subway_admin_menu() { |
43 | 43 | |
44 | - add_options_page( 'Subway Settings', 'Subway', 'manage_options', 'subway', array( $this, 'subway_options_page' ) ); |
|
44 | + add_options_page('Subway Settings', 'Subway', 'manage_options', 'subway', array($this, 'subway_options_page')); |
|
45 | 45 | |
46 | 46 | return; |
47 | 47 | } |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | public function subway_register_settings() { |
55 | 55 | |
56 | 56 | // Register our settings section. |
57 | - add_settings_section( 'subway-page-visibility-section', __( 'Pages Visibility', 'subway' ), |
|
58 | - array( $this, 'subway_section_cb' ), 'subway-settings-section' ); |
|
57 | + add_settings_section('subway-page-visibility-section', __('Pages Visibility', 'subway'), |
|
58 | + array($this, 'subway_section_cb'), 'subway-settings-section'); |
|
59 | 59 | |
60 | 60 | // Register Redirect Options pages. |
61 | - add_settings_section( 'subway-redirect-section', __( 'Redirect Options', 'subway' ), |
|
62 | - array( $this, 'subway_redirect_cb' ), 'subway-settings-section' ); |
|
61 | + add_settings_section('subway-redirect-section', __('Redirect Options', 'subway'), |
|
62 | + array($this, 'subway_redirect_cb'), 'subway-settings-section'); |
|
63 | 63 | |
64 | 64 | // Register the fields. |
65 | 65 | $fields = array( |
66 | 66 | array( |
67 | 67 | 'id' => 'subway_is_public', |
68 | - 'label' => __( 'Public Website', 'subway' ), |
|
68 | + 'label' => __('Public Website', 'subway'), |
|
69 | 69 | 'callback' => 'subway_is_public_form', |
70 | 70 | 'section' => 'subway-settings-section', |
71 | 71 | 'group' => 'subway-page-visibility-section', |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | |
74 | 74 | array( |
75 | 75 | 'id' => 'subway_login_page', |
76 | - 'label' => __( 'Private Login Page', 'subway' ), |
|
76 | + 'label' => __('Private Login Page', 'subway'), |
|
77 | 77 | 'callback' => 'subway_login_page_form', |
78 | 78 | 'section' => 'subway-settings-section', |
79 | 79 | 'group' => 'subway-page-visibility-section', |
80 | 80 | ), |
81 | 81 | array( |
82 | 82 | 'id' => 'subway_public_post', |
83 | - 'label' => __( 'Public Posts IDs', 'subway' ), |
|
83 | + 'label' => __('Public Posts IDs', 'subway'), |
|
84 | 84 | 'callback' => 'subway_public_post', |
85 | 85 | 'section' => 'subway-settings-section', |
86 | 86 | 'group' => 'subway-page-visibility-section', |
@@ -88,37 +88,37 @@ discard block |
||
88 | 88 | |
89 | 89 | array( |
90 | 90 | 'id' => 'subway_redirect_type', |
91 | - 'label' => __( 'Redirect Type', 'subway' ), |
|
91 | + 'label' => __('Redirect Type', 'subway'), |
|
92 | 92 | 'callback' => 'subway_redirect_option_form', |
93 | 93 | 'section' => 'subway-settings-section', |
94 | 94 | 'group' => 'subway-redirect-section', |
95 | 95 | ), |
96 | 96 | array( |
97 | 97 | 'id' => 'subway_redirect_wp_admin', |
98 | - 'label' => __( 'Bypassing <em>wp-login.php</em>', 'subway' ), |
|
98 | + 'label' => __('Bypassing <em>wp-login.php</em>', 'subway'), |
|
99 | 99 | 'callback' => 'subway_lock_wp_admin', |
100 | 100 | 'section' => 'subway-settings-section', |
101 | 101 | 'group' => 'subway-redirect-section', |
102 | 102 | ), |
103 | 103 | ); |
104 | 104 | |
105 | - foreach ( $fields as $field ) { |
|
105 | + foreach ($fields as $field) { |
|
106 | 106 | |
107 | - add_settings_field( $field['id'], $field['label'], $field['callback'], $field['section'], $field['group'] ); |
|
107 | + add_settings_field($field['id'], $field['label'], $field['callback'], $field['section'], $field['group']); |
|
108 | 108 | |
109 | - register_setting( 'subway-settings-group', $field['id'] ); |
|
109 | + register_setting('subway-settings-group', $field['id']); |
|
110 | 110 | |
111 | - $file = str_replace( '_','-', $field['callback'] ); |
|
111 | + $file = str_replace('_', '-', $field['callback']); |
|
112 | 112 | |
113 | - require_once trailingslashit( SUBWAY_DIR_PATH ) . 'settings-fields/field-' . sanitize_title( $file ) . '.php'; |
|
113 | + require_once trailingslashit(SUBWAY_DIR_PATH) . 'settings-fields/field-' . sanitize_title($file) . '.php'; |
|
114 | 114 | |
115 | 115 | } |
116 | 116 | |
117 | 117 | // Register Redirect Page ID Settings. |
118 | - register_setting( 'subway-settings-group', 'subway_redirect_page_id' ); |
|
118 | + register_setting('subway-settings-group', 'subway_redirect_page_id'); |
|
119 | 119 | |
120 | 120 | // Register Redirect Custom URL Settings. |
121 | - register_setting( 'subway-settings-group', 'subway_redirect_custom_url' ); |
|
121 | + register_setting('subway-settings-group', 'subway_redirect_custom_url'); |
|
122 | 122 | |
123 | 123 | return; |
124 | 124 | } |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | |
153 | 153 | <div class="wrap"> |
154 | 154 | <h2> |
155 | - <?php esc_html_e( 'Subway Settings', 'subway' ); ?> |
|
155 | + <?php esc_html_e('Subway Settings', 'subway'); ?> |
|
156 | 156 | </h2> |
157 | 157 | <form id="subway-settings-form" action="options.php" method="POST"> |
158 | - <?php settings_fields( 'subway-settings-group' ); ?> |
|
159 | - <?php do_settings_sections( 'subway-settings-section' ); ?> |
|
158 | + <?php settings_fields('subway-settings-group'); ?> |
|
159 | + <?php do_settings_sections('subway-settings-section'); ?> |
|
160 | 160 | <?php submit_button(); ?> |
161 | 161 | </form> |
162 | 162 | </div> |
@@ -10,7 +10,7 @@ discard block |
||
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 |
||
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 |
||
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: #e53935;">' . esc_html__( 'You need to add "[subway_login]" shortcode in the selected page to show the login form (this will be done automatically after saving)', '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: #e53935;">' . esc_html__('You need to add "[subway_login]" shortcode in the selected page to show the login form (this will be done automatically after saving)', 'subway')) . '</span></p>'; |
|
55 | 55 | |
56 | 56 | return; |
57 | 57 | } |
@@ -10,7 +10,7 @@ discard block |
||
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 |
||
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 style='color: #e53935;'>%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 style='color: #e53935;'>%s</strong>", 'subway'), site_url('wp-login.php?no_redirect=true')); |
|
23 | 23 | ?> |
24 | 24 | </p> |
25 | 25 | <?php |
@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | namespace Subway; |
14 | 14 | |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | return; |
17 | 17 | } |
18 | 18 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | namespace Subway; |
14 | 14 | |
15 | -if ( ! defined( 'ABSPATH' ) ) { |
|
15 | +if ( ! defined('ABSPATH')) { |
|
16 | 16 | return; |
17 | 17 | } |
18 | 18 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct() { |
30 | 30 | |
31 | - add_action( 'plugins_loaded', array( $this, 'subway_localize_plugin' ) ); |
|
31 | + add_action('plugins_loaded', array($this, 'subway_localize_plugin')); |
|
32 | 32 | |
33 | 33 | return; |
34 | 34 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $rel_path = SUBWAY_DIR_PATH . 'languages'; |
44 | 44 | |
45 | - load_plugin_textdomain( 'subway', false, $rel_path ); |
|
45 | + load_plugin_textdomain('subway', false, $rel_path); |
|
46 | 46 | |
47 | 47 | return; |
48 | 48 | } |