@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | private function __construct() { |
7 | 7 | |
8 | - add_action( 'init', array( $this, 'register') ); |
|
8 | + add_action('init', array($this, 'register')); |
|
9 | 9 | |
10 | 10 | return $this; |
11 | 11 | |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | static $instance = null; |
17 | 17 | |
18 | - if ( null === $instance ) { |
|
18 | + if (null === $instance) { |
|
19 | 19 | |
20 | 20 | $instance = new Shortcodes(); |
21 | 21 | |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | |
29 | 29 | function register() { |
30 | 30 | |
31 | - add_shortcode( 'subway_login', array( $this, 'wp_login' ) ); |
|
31 | + add_shortcode('subway_login', array($this, 'wp_login')); |
|
32 | 32 | |
33 | - add_action( 'login_form_middle', array( $this, '__action_lost_password_link' ) ); |
|
33 | + add_action('login_form_middle', array($this, '__action_lost_password_link')); |
|
34 | 34 | |
35 | 35 | return null; |
36 | 36 | |
@@ -40,26 +40,26 @@ discard block |
||
40 | 40 | |
41 | 41 | $atts = array(); |
42 | 42 | |
43 | - echo $this->get_template_file( $atts, $file = 'login-form.php', $content = null ); |
|
43 | + echo $this->get_template_file($atts, $file = 'login-form.php', $content = null); |
|
44 | 44 | |
45 | 45 | return; |
46 | 46 | } |
47 | 47 | |
48 | - protected function get_template_file( $atts, $file = '', $content = null ) { |
|
48 | + protected function get_template_file($atts, $file = '', $content = null) { |
|
49 | 49 | |
50 | 50 | ob_start(); |
51 | 51 | |
52 | - if ( empty( $file ) ) { |
|
52 | + if (empty($file)) { |
|
53 | 53 | |
54 | 54 | return; |
55 | 55 | |
56 | 56 | } |
57 | 57 | |
58 | - $template = SUBWAY_DIR_PATH . 'templates/'.$file; |
|
58 | + $template = SUBWAY_DIR_PATH . 'templates/' . $file; |
|
59 | 59 | |
60 | - if ( file_exists( $template ) ) { |
|
60 | + if (file_exists($template)) { |
|
61 | 61 | |
62 | - if ( $theme_template = locate_template( array('gears/shortcodes/'.$file ) ) ) { |
|
62 | + if ($theme_template = locate_template(array('gears/shortcodes/' . $file))) { |
|
63 | 63 | |
64 | 64 | $template = $theme_template; |
65 | 65 | |
@@ -69,18 +69,18 @@ discard block |
||
69 | 69 | |
70 | 70 | } else { |
71 | 71 | |
72 | - echo sprintf( __( 'Subway Error: Unable to find template file in: %1s', 'subway' ), $template ); |
|
72 | + echo sprintf(__('Subway Error: Unable to find template file in: %1s', 'subway'), $template); |
|
73 | 73 | |
74 | 74 | } |
75 | 75 | |
76 | 76 | return ob_get_clean(); |
77 | 77 | } |
78 | 78 | |
79 | - public function __action_lost_password_link( $content ) { |
|
79 | + public function __action_lost_password_link($content) { |
|
80 | 80 | |
81 | - return $this->get_template_file( $params = array(), |
|
81 | + return $this->get_template_file($params = array(), |
|
82 | 82 | $file = 'login-form-lost-password.php', |
83 | - $content = null ); |
|
83 | + $content = null); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | global $post; |
10 | 10 | |
11 | - if ( '' == session_id() || ! isset( $_SESSION ) ) { |
|
11 | + if ('' == session_id() || ! isset($_SESSION)) { |
|
12 | 12 | |
13 | 13 | session_start(); |
14 | 14 | |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | $post_copy = &$post; |
18 | 18 | |
19 | - $login_page_id = intval( get_option( 'subway_login_page' ) ); |
|
19 | + $login_page_id = intval(get_option('subway_login_page')); |
|
20 | 20 | |
21 | 21 | $excluded_page = Options::get_public_post_ids(); |
22 | 22 | |
@@ -24,64 +24,64 @@ discard block |
||
24 | 24 | $redirect_page = Options::get_redirect_page_url(); |
25 | 25 | |
26 | 26 | // Check if redirect page is empty or not. |
27 | - if ( empty( $redirect_page ) ) { |
|
27 | + if (empty($redirect_page)) { |
|
28 | 28 | return; |
29 | 29 | } |
30 | 30 | |
31 | 31 | // Check if buddypress activate page. |
32 | - if ( function_exists( 'bp_is_activation_page' ) ) { |
|
33 | - if ( bp_is_activation_page() ) { |
|
32 | + if (function_exists('bp_is_activation_page')) { |
|
33 | + if (bp_is_activation_page()) { |
|
34 | 34 | return; |
35 | 35 | } |
36 | 36 | } |
37 | 37 | |
38 | 38 | // Check if buddypress registration page. |
39 | - if ( function_exists( 'bp_is_register_page' ) ) { |
|
40 | - if ( bp_is_register_page() ) { |
|
39 | + if (function_exists('bp_is_register_page')) { |
|
40 | + if (bp_is_register_page()) { |
|
41 | 41 | return; |
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
45 | 45 | // Assign 0 value to empty $post->ID to prevent exception. |
46 | 46 | // This applies to custom WordPress pages such as BP Members Page and Groups. |
47 | - if ( empty( $post_copy ) ) { |
|
47 | + if (empty($post_copy)) { |
|
48 | 48 | $post_copy = new \stdclass; |
49 | 49 | $post_copy->ID = 0; |
50 | 50 | } |
51 | 51 | |
52 | - $current_page_id = intval( $post_copy->ID ); |
|
52 | + $current_page_id = intval($post_copy->ID); |
|
53 | 53 | |
54 | 54 | // Check if $current_page_id && $selected_blog_id is equal to each other. |
55 | 55 | // If that is the case, get the page ID instead of global $post->ID that the query returns. |
56 | 56 | // The ID of the first post object inside the loop is not correct. |
57 | - $blog_id = intval( get_option( 'page_for_posts' ) ); |
|
57 | + $blog_id = intval(get_option('page_for_posts')); |
|
58 | 58 | |
59 | - if ( is_home() ) { |
|
60 | - if ( $blog_id === $login_page_id ) { |
|
59 | + if (is_home()) { |
|
60 | + if ($blog_id === $login_page_id) { |
|
61 | 61 | $current_page_id = $blog_id; |
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
65 | - if ( isset( $_SESSION['redirected'] ) ) { |
|
65 | + if (isset($_SESSION['redirected'])) { |
|
66 | 66 | |
67 | - unset( $_SESSION['redirected'] ); |
|
67 | + unset($_SESSION['redirected']); |
|
68 | 68 | |
69 | 69 | return; |
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | 73 | // Only execute the script for non-loggedin visitors. |
74 | - if ( ! is_user_logged_in() ) { |
|
74 | + if ( ! is_user_logged_in()) { |
|
75 | 75 | |
76 | - if ( $current_page_id !== $login_page_id ) { |
|
76 | + if ($current_page_id !== $login_page_id) { |
|
77 | 77 | |
78 | - if ( ! in_array( $current_page_id, $excluded_page, true ) ) { |
|
78 | + if ( ! in_array($current_page_id, $excluded_page, true)) { |
|
79 | 79 | |
80 | 80 | $_SESSION['redirected'] = true; |
81 | 81 | |
82 | 82 | wp_safe_redirect( |
83 | 83 | add_query_arg( |
84 | - array( '_redirected' => 'yes' ), |
|
84 | + array('_redirected' => 'yes'), |
|
85 | 85 | $redirect_page |
86 | 86 | ) |
87 | 87 | ); |
@@ -6,78 +6,78 @@ discard block |
||
6 | 6 | public static function index() { |
7 | 7 | |
8 | 8 | // Only run this function when on wp-login.php. |
9 | - if ( ! in_array( $GLOBALS['pagenow'], array( 'wp-login.php' ), true ) ) { |
|
9 | + if ( ! in_array($GLOBALS['pagenow'], array('wp-login.php'), true)) { |
|
10 | 10 | return; |
11 | 11 | } |
12 | 12 | |
13 | 13 | // Has any errors? |
14 | - $has_error = filter_input( INPUT_GET, 'error', FILTER_SANITIZE_STRING ); |
|
14 | + $has_error = filter_input(INPUT_GET, 'error', FILTER_SANITIZE_STRING); |
|
15 | 15 | |
16 | 16 | // Error Types. |
17 | - $has_type = filter_input( INPUT_GET, 'type', FILTER_SANITIZE_STRING ); |
|
17 | + $has_type = filter_input(INPUT_GET, 'type', FILTER_SANITIZE_STRING); |
|
18 | 18 | |
19 | 19 | // Set the default to our login page. |
20 | 20 | $redirect_page = Options::get_redirect_page_url(); |
21 | 21 | |
22 | - if ( $has_error && $has_type ) { |
|
22 | + if ($has_error && $has_type) { |
|
23 | 23 | |
24 | - $redirect_to = add_query_arg( array( |
|
24 | + $redirect_to = add_query_arg(array( |
|
25 | 25 | 'login' => 'failed', |
26 | 26 | 'type' => $has_type, |
27 | - ), $redirect_page ); |
|
27 | + ), $redirect_page); |
|
28 | 28 | |
29 | - wp_safe_redirect( esc_url_raw( $redirect_to ) ); |
|
29 | + wp_safe_redirect(esc_url_raw($redirect_to)); |
|
30 | 30 | |
31 | 31 | die(); |
32 | 32 | |
33 | 33 | } |
34 | 34 | |
35 | 35 | // Bypass wp-login.php?action=* link. |
36 | - if ( filter_input( INPUT_GET, 'action', FILTER_SANITIZE_STRING ) ) { |
|
36 | + if (filter_input(INPUT_GET, 'action', FILTER_SANITIZE_STRING)) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
40 | 40 | // Bypass no redirect action |
41 | - if ( filter_input( INPUT_GET, 'no_redirect', FILTER_VALIDATE_BOOLEAN ) ) { |
|
41 | + if (filter_input(INPUT_GET, 'no_redirect', FILTER_VALIDATE_BOOLEAN)) { |
|
42 | 42 | return; |
43 | 43 | } |
44 | 44 | |
45 | 45 | // Do not redirect if BuddyPress activation page. |
46 | - if ( function_exists( 'bp_is_activation_page' ) ) { |
|
47 | - if ( bp_is_activation_page() ) { |
|
46 | + if (function_exists('bp_is_activation_page')) { |
|
47 | + if (bp_is_activation_page()) { |
|
48 | 48 | return; |
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | 52 | // Do not redirect if BuddyPress registration page. |
53 | - if ( function_exists( 'bp_is_register_page' ) ) { |
|
54 | - if ( bp_is_register_page() ) { |
|
53 | + if (function_exists('bp_is_register_page')) { |
|
54 | + if (bp_is_register_page()) { |
|
55 | 55 | return; |
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
59 | 59 | // Holds the curret URI string for checking. |
60 | - $curr_paged = basename( $_SERVER['REQUEST_URI'] ); |
|
60 | + $curr_paged = basename($_SERVER['REQUEST_URI']); |
|
61 | 61 | |
62 | - if ( empty( $redirect_page ) ) { |
|
62 | + if (empty($redirect_page)) { |
|
63 | 63 | return; |
64 | 64 | } |
65 | 65 | |
66 | 66 | // If user visits wp-admin or wp-login.php, redirect them. |
67 | - if ( strstr( $curr_paged, 'wp-login.php' ) ) { |
|
67 | + if (strstr($curr_paged, 'wp-login.php')) { |
|
68 | 68 | |
69 | 69 | // Do not redirect interim login. |
70 | - if ( isset( $_GET['interim-login'] ) ) { |
|
70 | + if (isset($_GET['interim-login'])) { |
|
71 | 71 | return; |
72 | 72 | } |
73 | 73 | |
74 | 74 | // Check if there is an action present. |
75 | 75 | // The action might represent user trying to log out. |
76 | - if ( isset( $_GET['action'] ) ) { |
|
76 | + if (isset($_GET['action'])) { |
|
77 | 77 | |
78 | 78 | $action = $_GET['action']; |
79 | 79 | |
80 | - if ( 'logout' === $action ) { |
|
80 | + if ('logout' === $action) { |
|
81 | 81 | |
82 | 82 | return; |
83 | 83 | |
@@ -85,46 +85,46 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | // Only redirect if there are no incoming post data. |
88 | - if ( empty( $_POST ) ) { |
|
89 | - wp_safe_redirect( $redirect_page ); |
|
88 | + if (empty($_POST)) { |
|
89 | + wp_safe_redirect($redirect_page); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | // Redirect to error page if user left username and password blank. |
93 | - if ( ! empty( $_POST ) ) { |
|
93 | + if ( ! empty($_POST)) { |
|
94 | 94 | |
95 | - if ( empty( $_POST['log'] ) && empty( $_POST['pwd'] ) ) { |
|
96 | - $redirect_to = add_query_arg( array( |
|
95 | + if (empty($_POST['log']) && empty($_POST['pwd'])) { |
|
96 | + $redirect_to = add_query_arg(array( |
|
97 | 97 | 'login' => 'failed', |
98 | 98 | 'type' => '__blank', |
99 | - ), $redirect_page ); |
|
99 | + ), $redirect_page); |
|
100 | 100 | |
101 | - wp_safe_redirect( esc_url_raw( $redirect_to ) ); |
|
101 | + wp_safe_redirect(esc_url_raw($redirect_to)); |
|
102 | 102 | |
103 | - } elseif ( empty( $_POST['log'] ) && ! empty( $_POST['pwd'] ) && ! empty( $_POST['redirect_to'] ) ) { |
|
103 | + } elseif (empty($_POST['log']) && ! empty($_POST['pwd']) && ! empty($_POST['redirect_to'])) { |
|
104 | 104 | // Username empty. |
105 | - $redirect_to = add_query_arg( array( |
|
105 | + $redirect_to = add_query_arg(array( |
|
106 | 106 | 'login' => 'failed', |
107 | 107 | 'type' => '__userempty', |
108 | - ), $redirect_page ); |
|
108 | + ), $redirect_page); |
|
109 | 109 | |
110 | - wp_safe_redirect( esc_url_raw( $redirect_to ) ); |
|
111 | - } elseif ( ! empty( $_POST['log'] ) && empty( $_POST['pwd'] ) && ! empty( $_POST['redirect_to'] ) ) { |
|
110 | + wp_safe_redirect(esc_url_raw($redirect_to)); |
|
111 | + } elseif ( ! empty($_POST['log']) && empty($_POST['pwd']) && ! empty($_POST['redirect_to'])) { |
|
112 | 112 | // Password empty. |
113 | - $redirect_to = add_query_arg( array( |
|
113 | + $redirect_to = add_query_arg(array( |
|
114 | 114 | 'login' => 'failed', |
115 | 115 | 'type' => '__passempty', |
116 | - ), $redirect_page ); |
|
116 | + ), $redirect_page); |
|
117 | 117 | |
118 | - wp_safe_redirect( esc_url_raw( $redirect_to ) ); |
|
118 | + wp_safe_redirect(esc_url_raw($redirect_to)); |
|
119 | 119 | } else { |
120 | 120 | |
121 | 121 | // Generic. |
122 | - $redirect_to = add_query_arg( array( |
|
122 | + $redirect_to = add_query_arg(array( |
|
123 | 123 | 'login' => 'failed', |
124 | 124 | 'type' => 'default', |
125 | - ), $redirect_page ); |
|
125 | + ), $redirect_page); |
|
126 | 126 | |
127 | - wp_safe_redirect( esc_url_raw( $redirect_to ) ); |
|
127 | + wp_safe_redirect(esc_url_raw($redirect_to)); |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | } |
@@ -139,31 +139,31 @@ discard block |
||
139 | 139 | |
140 | 140 | $custom_sign_in_page_url = Options::get_redirect_page_url(); |
141 | 141 | |
142 | - if ( ! empty( $custom_sign_in_page_url ) ) { |
|
142 | + if ( ! empty($custom_sign_in_page_url)) { |
|
143 | 143 | |
144 | 144 | $sign_in_page = $custom_sign_in_page_url; |
145 | 145 | |
146 | 146 | } |
147 | 147 | |
148 | 148 | // Check that were not on the default login page. |
149 | - if ( ! empty( $sign_in_page ) && ! strstr( $sign_in_page,'wp-login' ) && ! strstr( $sign_in_page,'wp-admin' ) && null !== $user ) { |
|
149 | + if ( ! empty($sign_in_page) && ! strstr($sign_in_page, 'wp-login') && ! strstr($sign_in_page, 'wp-admin') && null !== $user) { |
|
150 | 150 | |
151 | 151 | // make sure we don't already have a failed login attempt. |
152 | - if ( ! strstr( $sign_in_page, '?login=failed' ) ) { |
|
152 | + if ( ! strstr($sign_in_page, '?login=failed')) { |
|
153 | 153 | |
154 | 154 | // Redirect to the login page and append a querystring of login failed. |
155 | - $permalink = add_query_arg( array( |
|
155 | + $permalink = add_query_arg(array( |
|
156 | 156 | 'login' => 'failed', |
157 | 157 | 'type' => 'default', |
158 | - ), $custom_sign_in_page_url ); |
|
158 | + ), $custom_sign_in_page_url); |
|
159 | 159 | |
160 | - wp_safe_redirect( esc_url_raw( $permalink ) ); |
|
160 | + wp_safe_redirect(esc_url_raw($permalink)); |
|
161 | 161 | |
162 | 162 | die(); |
163 | 163 | |
164 | 164 | } else { |
165 | 165 | |
166 | - wp_safe_redirect( $sign_in_page ); |
|
166 | + wp_safe_redirect($sign_in_page); |
|
167 | 167 | |
168 | 168 | die(); |
169 | 169 | } |
@@ -174,42 +174,42 @@ discard block |
||
174 | 174 | return; |
175 | 175 | } |
176 | 176 | |
177 | - public static function authentication_200( $redirect_to, $request, $user ) { |
|
177 | + public static function authentication_200($redirect_to, $request, $user) { |
|
178 | 178 | |
179 | - $subway_redirect_type = get_option( 'subway_redirect_type' ); |
|
179 | + $subway_redirect_type = get_option('subway_redirect_type'); |
|
180 | 180 | |
181 | 181 | // Redirect the user to default behaviour if there are no redirect type option saved. |
182 | - if ( empty( $subway_redirect_type ) ) { |
|
182 | + if (empty($subway_redirect_type)) { |
|
183 | 183 | |
184 | 184 | return $redirect_to; |
185 | 185 | |
186 | 186 | } |
187 | 187 | |
188 | - if ( 'default' === $subway_redirect_type ) { |
|
188 | + if ('default' === $subway_redirect_type) { |
|
189 | 189 | return $redirect_to; |
190 | 190 | } |
191 | 191 | |
192 | - if ( 'page' === $subway_redirect_type ) { |
|
192 | + if ('page' === $subway_redirect_type) { |
|
193 | 193 | |
194 | 194 | // Get the page url of the selected page if the admin selected 'Custom Page' in the redirect type settings. |
195 | - $selected_redirect_page = intval( get_option( 'subway_redirect_page_id' ) ); |
|
195 | + $selected_redirect_page = intval(get_option('subway_redirect_page_id')); |
|
196 | 196 | |
197 | 197 | // Redirect to default WordPress behaviour if the user did not select page. |
198 | - if ( empty( $selected_redirect_page ) ) { |
|
198 | + if (empty($selected_redirect_page)) { |
|
199 | 199 | |
200 | 200 | return $redirect_to; |
201 | 201 | } |
202 | 202 | |
203 | 203 | // Otherwise, get the permalink of the saved page and let the user go into that page. |
204 | - return get_permalink( $selected_redirect_page ); |
|
204 | + return get_permalink($selected_redirect_page); |
|
205 | 205 | |
206 | - } elseif ( 'custom_url' === $subway_redirect_type ) { |
|
206 | + } elseif ('custom_url' === $subway_redirect_type) { |
|
207 | 207 | |
208 | 208 | // Get the custom url saved in the redirect type settings. |
209 | - $entered_custom_url = get_option( 'subway_redirect_custom_url' ); |
|
209 | + $entered_custom_url = get_option('subway_redirect_custom_url'); |
|
210 | 210 | |
211 | 211 | // Redirect to default WordPress behaviour if the user did enter a custom url. |
212 | - if ( empty( $entered_custom_url ) ) { |
|
212 | + if (empty($entered_custom_url)) { |
|
213 | 213 | |
214 | 214 | return $redirect_to; |
215 | 215 | |
@@ -218,9 +218,9 @@ discard block |
||
218 | 218 | // Otherwise, get the custom url saved and let the user go into that page. |
219 | 219 | $current_user = wp_get_current_user(); |
220 | 220 | |
221 | - $entered_custom_url = str_replace( '%user_id%', $user->ID, $entered_custom_url ); |
|
221 | + $entered_custom_url = str_replace('%user_id%', $user->ID, $entered_custom_url); |
|
222 | 222 | |
223 | - $entered_custom_url = str_replace( '%user_name%', $user->user_login, $entered_custom_url ); |
|
223 | + $entered_custom_url = str_replace('%user_name%', $user->user_login, $entered_custom_url); |
|
224 | 224 | |
225 | 225 | return $entered_custom_url; |
226 | 226 |
@@ -5,19 +5,19 @@ discard block |
||
5 | 5 | |
6 | 6 | public static function get_redirect_page_url() { |
7 | 7 | |
8 | - $selected_login_post_id = intval( get_option( 'subway_login_page' ) ); |
|
8 | + $selected_login_post_id = intval(get_option('subway_login_page')); |
|
9 | 9 | |
10 | - if ( 0 === $selected_login_post_id ) { |
|
10 | + if (0 === $selected_login_post_id) { |
|
11 | 11 | |
12 | 12 | return; |
13 | 13 | |
14 | 14 | } |
15 | 15 | |
16 | - $login_post = get_post( $selected_login_post_id ); |
|
16 | + $login_post = get_post($selected_login_post_id); |
|
17 | 17 | |
18 | - if ( ! empty( $login_post ) ) { |
|
18 | + if ( ! empty($login_post)) { |
|
19 | 19 | |
20 | - return get_permalink( $login_post->ID ); |
|
20 | + return get_permalink($login_post->ID); |
|
21 | 21 | |
22 | 22 | } |
23 | 23 | |
@@ -27,19 +27,19 @@ discard block |
||
27 | 27 | |
28 | 28 | public static function get_public_post_ids() { |
29 | 29 | |
30 | - $subway_public_post = get_option( 'subway_public_post' ); |
|
30 | + $subway_public_post = get_option('subway_public_post'); |
|
31 | 31 | |
32 | 32 | $excluded_pages_collection = array(); |
33 | 33 | |
34 | - if ( ! empty( $subway_public_post ) ) { |
|
34 | + if ( ! empty($subway_public_post)) { |
|
35 | 35 | |
36 | - $excluded_pages_collection = explode( ',', $subway_public_post ); |
|
36 | + $excluded_pages_collection = explode(',', $subway_public_post); |
|
37 | 37 | |
38 | 38 | } |
39 | 39 | |
40 | 40 | // Should filter it by integer, spaces will be ignored, other strings. |
41 | 41 | // Will be converted to zero '0'. |
42 | - return array_filter( array_map( 'intval', $excluded_pages_collection ) ); |
|
42 | + return array_filter(array_map('intval', $excluded_pages_collection)); |
|
43 | 43 | |
44 | 44 | } |
45 | 45 | } |
@@ -16,24 +16,24 @@ discard block |
||
16 | 16 | * @package subway |
17 | 17 | */ |
18 | 18 | |
19 | -if ( ! defined( 'ABSPATH' ) ) { |
|
19 | +if ( ! defined('ABSPATH')) { |
|
20 | 20 | exit(); |
21 | 21 | } |
22 | 22 | |
23 | -if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) { |
|
24 | - add_action( 'admin_notices', 'subway_admin_notice' ); |
|
23 | +if (version_compare(PHP_VERSION, '5.3.0', '<')) { |
|
24 | + add_action('admin_notices', 'subway_admin_notice'); |
|
25 | 25 | function subway_admin_notice() { ?> |
26 | 26 | <div class="notice notice-error is-dismissible"> |
27 | - <p><strong><?php _e( 'Notice: Subway uses PHP Class Namespaces which is only available in servers with PHP 5.3.0 version and above. Update your server\'s PHP version. You can deactivate Subway in the meantime.', 'subway' ); ?></strong></p> |
|
27 | + <p><strong><?php _e('Notice: Subway uses PHP Class Namespaces which is only available in servers with PHP 5.3.0 version and above. Update your server\'s PHP version. You can deactivate Subway in the meantime.', 'subway'); ?></strong></p> |
|
28 | 28 | </div> |
29 | 29 | <?php } |
30 | 30 | return; |
31 | 31 | } |
32 | 32 | // Define Subway Plugin Version. |
33 | -define( 'SUBWAY_VERSION', '2.0' ); |
|
33 | +define('SUBWAY_VERSION', '2.0'); |
|
34 | 34 | |
35 | 35 | // Define Subway Directory Path. |
36 | -define( 'SUBWAY_DIR_PATH', trailingslashit( plugin_dir_path( __FILE__ ) ) ); |
|
36 | +define('SUBWAY_DIR_PATH', trailingslashit(plugin_dir_path(__FILE__))); |
|
37 | 37 | |
38 | 38 | // Include Subway i18n. |
39 | 39 | require_once SUBWAY_DIR_PATH . 'i18.php'; |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | require_once SUBWAY_DIR_PATH . 'shortcodes/subway-shortcodes.php'; |
55 | 55 | |
56 | 56 | // Redirect (302) all front-end request to the login page. |
57 | -add_action( 'wp', array( 'Subway\Page_Redirect', 'index') ); |
|
57 | +add_action('wp', array('Subway\Page_Redirect', 'index')); |
|
58 | 58 | |
59 | 59 | // Redirect the user when he/she visit wp-admin or wp-login.php. |
60 | -add_action( 'init', array( 'Subway\Admin_Redirect', 'index' ) ); |
|
60 | +add_action('init', array('Subway\Admin_Redirect', 'index')); |
|
61 | 61 | |
62 | 62 | // Redirect (302) invalid login request to the login page. |
63 | -add_action( 'wp_login_failed', array('Subway\Admin_Redirect', 'authentication_fail') ); |
|
63 | +add_action('wp_login_failed', array('Subway\Admin_Redirect', 'authentication_fail')); |
|
64 | 64 | |
65 | 65 | // Redirect the user after successful logged in; Priority = 10; Accepted Params Number = 3' |
66 | -add_filter( 'login_redirect', array('Subway\Admin_Redirect', 'authentication_200'), 10, 3 ); |
|
66 | +add_filter('login_redirect', array('Subway\Admin_Redirect', 'authentication_200'), 10, 3); |
|
67 | 67 |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | /** |
3 | 3 | * Plugin i18n. |
4 | 4 | */ |
5 | -add_action( 'plugins_loaded', 'subway_localize_plugin' ); |
|
5 | +add_action('plugins_loaded', 'subway_localize_plugin'); |
|
6 | 6 | |
7 | 7 | /** |
8 | 8 | * Subway l10n callback. |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $rel_path = SUBWAY_DIR_PATH . 'languages'; |
15 | 15 | |
16 | - load_plugin_textdomain( 'subway', false, $rel_path ); |
|
16 | + load_plugin_textdomain('subway', false, $rel_path); |
|
17 | 17 | |
18 | 18 | return; |
19 | 19 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <p class="subway-login-lost-password"> |
2 | - <a href="<?php echo esc_url( wp_lostpassword_url( $redirect = '' ) ); ?>"> |
|
3 | - <?php esc_html_e( 'Forgot Password', 'subway' ); ?> |
|
2 | + <a href="<?php echo esc_url(wp_lostpassword_url($redirect = '')); ?>"> |
|
3 | + <?php esc_html_e('Forgot Password', 'subway'); ?> |
|
4 | 4 | </a> |
5 | 5 | </p> |
6 | 6 | \ No newline at end of file |
@@ -3,10 +3,10 @@ discard block |
||
3 | 3 | $args = array( |
4 | 4 | 'echo' => true, |
5 | 5 | 'form_id' => 'loginform', |
6 | - 'label_username' => __( 'Username', 'subway' ), |
|
7 | - 'label_password' => __( 'Password', 'subway' ), |
|
8 | - 'label_remember' => __( 'Remember Me', 'subway' ), |
|
9 | - 'label_log_in' => __( 'Log In', 'subway' ), |
|
6 | + 'label_username' => __('Username', 'subway'), |
|
7 | + 'label_password' => __('Password', 'subway'), |
|
8 | + 'label_remember' => __('Remember Me', 'subway'), |
|
9 | + 'label_log_in' => __('Log In', 'subway'), |
|
10 | 10 | 'id_username' => 'user_login', |
11 | 11 | 'id_password' => 'user_pass', |
12 | 12 | 'id_remember' => 'rememberme', |
@@ -22,87 +22,87 @@ discard block |
||
22 | 22 | $message_types = array(); |
23 | 23 | |
24 | 24 | // add_filter('login_form_middle', 'subway_integrate_login_form_filter'); |
25 | -if ( isset( $_GET['login'] ) ) { |
|
25 | +if (isset($_GET['login'])) { |
|
26 | 26 | |
27 | - if ( 'failed' === $_GET['login'] ) { |
|
27 | + if ('failed' === $_GET['login']) { |
|
28 | 28 | |
29 | - if ( isset( $_GET['type'] ) ) { |
|
29 | + if (isset($_GET['type'])) { |
|
30 | 30 | |
31 | 31 | $message_types = array( |
32 | 32 | |
33 | 33 | 'default' => array( |
34 | - 'message' => __( 'There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway' ), |
|
34 | + 'message' => __('There was an error trying to sign-in to your account. Make sure the credentials below are correct.', 'subway'), |
|
35 | 35 | ), |
36 | 36 | '__blank' => array( |
37 | - 'message' => __( 'Required: Username and Password cannot be empty.', 'subway' ), |
|
37 | + 'message' => __('Required: Username and Password cannot be empty.', 'subway'), |
|
38 | 38 | ), |
39 | 39 | '__userempty' => array( |
40 | - 'message' => __( 'Required: Username cannot be empty.', 'subway' ), |
|
40 | + 'message' => __('Required: Username cannot be empty.', 'subway'), |
|
41 | 41 | ), |
42 | 42 | '__passempty' => array( |
43 | - 'message' => __( 'Required: Password cannot be empty.', 'subway' ), |
|
43 | + 'message' => __('Required: Password cannot be empty.', 'subway'), |
|
44 | 44 | ), |
45 | 45 | 'fb_invalid_email' => array( |
46 | - 'message' => __( 'Facebook email address is invalid or is not yet verified.', 'subway' ), |
|
46 | + 'message' => __('Facebook email address is invalid or is not yet verified.', 'subway'), |
|
47 | 47 | ), |
48 | 48 | 'fb_error' => array( |
49 | - 'message' => __( 'Facebook Application Error. Misconfigured or App is rejected.', 'subway' ), |
|
49 | + 'message' => __('Facebook Application Error. Misconfigured or App is rejected.', 'subway'), |
|
50 | 50 | ), |
51 | 51 | 'app_not_live' => array( |
52 | - 'message' => __( 'Unable to fetch your Facebook Profile.', 'subway' ), |
|
52 | + 'message' => __('Unable to fetch your Facebook Profile.', 'subway'), |
|
53 | 53 | ), |
54 | 54 | 'gears_username_or_email_exists' => array( |
55 | - 'message' => __( 'Username or email address already exists', 'subway' ), |
|
55 | + 'message' => __('Username or email address already exists', 'subway'), |
|
56 | 56 | ), |
57 | 57 | 'gp_error_authentication' => array( |
58 | - 'message' => __( 'Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway' ), |
|
58 | + 'message' => __('Google Plus Authentication Error. Invalid Client ID or Secret.', 'subway'), |
|
59 | 59 | ), |
60 | 60 | ); |
61 | 61 | |
62 | 62 | $message = $message_types['default']['message']; |
63 | 63 | |
64 | - if ( array_key_exists( $_GET['type'], $message_types ) ) { |
|
64 | + if (array_key_exists($_GET['type'], $message_types)) { |
|
65 | 65 | |
66 | - $message = $message_types[ $_GET['type'] ]['message']; |
|
66 | + $message = $message_types[$_GET['type']]['message']; |
|
67 | 67 | |
68 | 68 | } |
69 | 69 | |
70 | - $error_login_message = '<div id="message" class="error">'. esc_html( $message ) .'</div>'; |
|
70 | + $error_login_message = '<div id="message" class="error">' . esc_html($message) . '</div>'; |
|
71 | 71 | |
72 | 72 | } else { |
73 | 73 | |
74 | - $error_login_message = '<div id="message" class="error">'.__( 'Error: Invalid username and password combination.', 'subway' ).'</div>'; |
|
74 | + $error_login_message = '<div id="message" class="error">' . __('Error: Invalid username and password combination.', 'subway') . '</div>'; |
|
75 | 75 | |
76 | 76 | } |
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | -if ( isset( $_GET['_redirected'] ) ) { |
|
81 | - $error_login_message = '<div id="message" class="success">' .__( 'Oops! Looks like you need to login in order to view the page.', 'subway' ) . '</div>'; |
|
80 | +if (isset($_GET['_redirected'])) { |
|
81 | + $error_login_message = '<div id="message" class="success">' . __('Oops! Looks like you need to login in order to view the page.', 'subway') . '</div>'; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | ?> |
85 | -<?php if ( ! is_user_logged_in() ) { ?> |
|
85 | +<?php if ( ! is_user_logged_in()) { ?> |
|
86 | 86 | <div class="mg-top-35 mg-bottom-35 subway-login-form"> |
87 | 87 | <div class="subway-login-form-form"> |
88 | 88 | <div class="subway-login-form__actions"> |
89 | 89 | <h3> |
90 | - <?php _e( 'Account Sign-in', 'subway' ); ?> |
|
90 | + <?php _e('Account Sign-in', 'subway'); ?> |
|
91 | 91 | </h3> |
92 | - <?php do_action( 'gears_login_form' ); ?> |
|
92 | + <?php do_action('gears_login_form'); ?> |
|
93 | 93 | </div> |
94 | 94 | <div class="subway-login-form-message"> |
95 | 95 | <?php echo $error_login_message; ?> |
96 | 96 | </div> |
97 | 97 | <div class="subway-login-form__form"> |
98 | - <?php echo wp_login_form( $args ); ?> |
|
98 | + <?php echo wp_login_form($args); ?> |
|
99 | 99 | </div> |
100 | 100 | </div> |
101 | 101 | </div> |
102 | 102 | <?php } else { ?> |
103 | 103 | <div class="mg-top-35 mg-bottom-35 subway-login-sucessfull" style="background: #CDDC39; padding: 15px 15px 15px 15px;border-radius: 4px;color: #616161;"> |
104 | 104 | <p style="margin-bottom: 0px;"> |
105 | - <?php echo esc_html__( apply_filters( 'subway_login_message', 'Great! You have succesfully login.' ), 'subway' ); ?> |
|
105 | + <?php echo esc_html__(apply_filters('subway_login_message', 'Great! You have succesfully login.'), 'subway'); ?> |
|
106 | 106 | </p> |
107 | 107 | </div> |
108 | 108 | <?php } ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -add_action( 'admin_init', 'subway_admin_settings_index' ); |
|
2 | +add_action('admin_init', 'subway_admin_settings_index'); |
|
3 | 3 | |
4 | 4 | /** |
5 | 5 | * Register all the settings inside 'Reading' section |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | // Add new 'Pages Visibility Settings'. |
13 | 13 | add_settings_section( |
14 | 14 | 'subway_setting_section', |
15 | - __( 'Pages Visibility Settings', 'subway' ), |
|
15 | + __('Pages Visibility Settings', 'subway'), |
|
16 | 16 | 'subway_setting_section_callback_function', |
17 | 17 | 'reading' |
18 | 18 | ); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | // WP Options 'subway_public_post'. |
21 | 21 | add_settings_field( |
22 | 22 | 'subway_public_post', |
23 | - __( 'Public Posts IDs', 'subway' ), |
|
23 | + __('Public Posts IDs', 'subway'), |
|
24 | 24 | 'subway_setting_callback_function', |
25 | 25 | 'reading', |
26 | 26 | 'subway_setting_section' |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | // WP Options 'subway_is_public'. |
30 | 30 | add_settings_field( |
31 | 31 | 'subway_is_public', |
32 | - __( 'Public Website', 'subway' ), |
|
32 | + __('Public Website', 'subway'), |
|
33 | 33 | 'subway_is_public_form', |
34 | 34 | 'reading', |
35 | 35 | 'subway_setting_section' |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // WP Options 'subway_login_page'. |
39 | 39 | add_settings_field( |
40 | 40 | 'subway_login_page', |
41 | - __( 'Login Page', 'subway' ), |
|
41 | + __('Login Page', 'subway'), |
|
42 | 42 | 'subway_login_page_form', |
43 | 43 | 'reading', |
44 | 44 | 'subway_setting_section' |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | // WP Options 'subway_redirect_type'. |
48 | 48 | add_settings_field( |
49 | 49 | 'subway_redirect_type', |
50 | - __( 'Redirect Type', 'subway' ), |
|
50 | + __('Redirect Type', 'subway'), |
|
51 | 51 | 'subway_redirect_option_form', |
52 | 52 | 'reading', |
53 | 53 | 'subway_setting_section' |
@@ -56,20 +56,20 @@ discard block |
||
56 | 56 | // WP Options 'subway_bypassing_info'. |
57 | 57 | add_settings_field( |
58 | 58 | 'subway_bypassing_info', |
59 | - __( 'Bypassing Redirect', 'subway' ), |
|
59 | + __('Bypassing Redirect', 'subway'), |
|
60 | 60 | 'subway_bypassing_option_form', |
61 | 61 | 'reading', |
62 | 62 | 'subway_setting_section' |
63 | 63 | ); |
64 | 64 | |
65 | 65 | // Register all the callback settings id. |
66 | - register_setting( 'reading', 'subway_public_post' ); |
|
67 | - register_setting( 'reading', 'subway_is_public' ); |
|
68 | - register_setting( 'reading', 'subway_login_page' ); |
|
69 | - register_setting( 'reading', 'subway_redirect_type' ); |
|
66 | + register_setting('reading', 'subway_public_post'); |
|
67 | + register_setting('reading', 'subway_is_public'); |
|
68 | + register_setting('reading', 'subway_login_page'); |
|
69 | + register_setting('reading', 'subway_redirect_type'); |
|
70 | 70 | |
71 | - register_setting( 'reading', 'subway_redirect_page_id' ); |
|
72 | - register_setting( 'reading', 'subway_redirect_custom_url' ); |
|
71 | + register_setting('reading', 'subway_redirect_page_id'); |
|
72 | + register_setting('reading', 'subway_redirect_custom_url'); |
|
73 | 73 | |
74 | 74 | } |
75 | 75 | |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | */ |
93 | 93 | function subway_setting_callback_function() { |
94 | 94 | |
95 | - echo '<textarea id="subway_public_post" name="subway_public_post" rows="5" cols="95">' . esc_attr( trim( get_option( 'subway_public_post' ) ) ) . '</textarea>'; |
|
95 | + echo '<textarea id="subway_public_post" name="subway_public_post" rows="5" cols="95">' . esc_attr(trim(get_option('subway_public_post'))) . '</textarea>'; |
|
96 | 96 | |
97 | - 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), \nfor example: 143,123,213. Alternatively, you can enable public viewing of all of your pages and posts by checking the option below.", 'subway' ) ) . '</p>'; |
|
97 | + 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), \nfor example: 143,123,213. Alternatively, you can enable public viewing of all of your pages and posts by checking the option below.", 'subway')) . '</p>'; |
|
98 | 98 | |
99 | 99 | return; |
100 | 100 | } |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | */ |
107 | 107 | function subway_is_public_form() { |
108 | 108 | |
109 | - 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>'; |
|
110 | - echo '<p class="description">' . esc_html__( 'Pages like user profile, members, and groups are still only available to the rightful owner of the profile.', 'subway' ) . '</p>'; |
|
109 | + 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>'; |
|
110 | + echo '<p class="description">' . esc_html__('Pages like user profile, members, and groups are still only available to the rightful owner of the profile.', 'subway') . '</p>'; |
|
111 | 111 | |
112 | 112 | return; |
113 | 113 | } |
@@ -119,24 +119,24 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function subway_login_page_form() { |
121 | 121 | |
122 | - $subway_login_page_id = intval( get_option( 'subway_login_page' ) ); |
|
122 | + $subway_login_page_id = intval(get_option('subway_login_page')); |
|
123 | 123 | |
124 | - if ( ! empty( $subway_login_page_id ) ) { |
|
124 | + if ( ! empty($subway_login_page_id)) { |
|
125 | 125 | |
126 | - $login_page_object = get_post( $subway_login_page_id ); |
|
126 | + $login_page_object = get_post($subway_login_page_id); |
|
127 | 127 | |
128 | - if ( ! empty( $login_page_object ) && isset( $login_page_object->post_content ) ) { |
|
128 | + if ( ! empty($login_page_object) && isset($login_page_object->post_content)) { |
|
129 | 129 | |
130 | 130 | // Automatically prepend the login shortcode if no |
131 | 131 | // Shortcode exists in the selected login page. |
132 | - if ( ! has_shortcode( $login_page_object->post_content, 'subway_login' ) ) { |
|
132 | + if ( ! has_shortcode($login_page_object->post_content, 'subway_login')) { |
|
133 | 133 | |
134 | 134 | $new_post_object = array( |
135 | 135 | 'ID' => $login_page_object->ID, |
136 | - 'post_content' => '[subway_login] ' . $login_page_object->post_content,// Prepend Only. |
|
136 | + 'post_content' => '[subway_login] ' . $login_page_object->post_content, // Prepend Only. |
|
137 | 137 | ); |
138 | 138 | |
139 | - wp_update_post( $new_post_object ); |
|
139 | + wp_update_post($new_post_object); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | } |
@@ -144,12 +144,12 @@ discard block |
||
144 | 144 | wp_dropdown_pages( |
145 | 145 | array( |
146 | 146 | 'name' => 'subway_login_page', |
147 | - 'selected' => intval( $subway_login_page_id ), |
|
148 | - 'show_option_none' => esc_html__( '---', 'subway' ), |
|
147 | + 'selected' => intval($subway_login_page_id), |
|
148 | + 'show_option_none' => esc_html__('---', 'subway'), |
|
149 | 149 | ) |
150 | 150 | ); |
151 | 151 | |
152 | - echo '<p class="description">' . sprintf( esc_html__( 'Select a page to use as a login page for your website. 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 automatic)', 'subway' ) ) . '</span></p>'; |
|
152 | + echo '<p class="description">' . sprintf(esc_html__('Select a page to use as a login page for your website. 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 automatic)', 'subway')) . '</span></p>'; |
|
153 | 153 | |
154 | 154 | return; |
155 | 155 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | and go directly to your website's wp-login URL (http://yoursiteurl.com/wp-login.php): |
170 | 170 | <br><br> <strong>%s</strong>", 'subway' |
171 | 171 | ), |
172 | - site_url( 'wp-login.php?no_redirect=true' ) |
|
172 | + site_url('wp-login.php?no_redirect=true') |
|
173 | 173 | ); |
174 | 174 | |
175 | 175 | echo '</p>'; |
@@ -200,9 +200,9 @@ discard block |
||
200 | 200 | <!-- Page --> |
201 | 201 | <label for="subway_use_page"> |
202 | 202 | |
203 | - <input <?php checked( 'page', get_option( 'subway_redirect_type' ), true ); ?> value="page" name="subway_redirect_type" id="subway_use_page" type="radio" class="code" /> |
|
203 | + <input <?php checked('page', get_option('subway_redirect_type'), true); ?> value="page" name="subway_redirect_type" id="subway_use_page" type="radio" class="code" /> |
|
204 | 204 | |
205 | - <?php esc_html_e( 'Custom Page', 'subway' ); ?> |
|
205 | + <?php esc_html_e('Custom Page', 'subway'); ?> |
|
206 | 206 | |
207 | 207 | </label> |
208 | 208 | |
@@ -212,9 +212,9 @@ discard block |
||
212 | 212 | |
213 | 213 | <label for="subway_use_custom_url"> |
214 | 214 | |
215 | - <input <?php checked( 'custom_url', get_option( 'subway_redirect_type' ), true ); ?> value="custom_url" name="subway_redirect_type" id="subway_use_custom_url" type="radio" class="code" /> |
|
215 | + <input <?php checked('custom_url', get_option('subway_redirect_type'), true); ?> value="custom_url" name="subway_redirect_type" id="subway_use_custom_url" type="radio" class="code" /> |
|
216 | 216 | |
217 | - <?php esc_html_e( 'Custom URL', 'subway' ); ?> |
|
217 | + <?php esc_html_e('Custom URL', 'subway'); ?> |
|
218 | 218 | |
219 | 219 | </label> |
220 | 220 | |
@@ -224,9 +224,9 @@ discard block |
||
224 | 224 | |
225 | 225 | <label for="subway_use_default"> |
226 | 226 | |
227 | - <input <?php checked( 'default', get_option( 'subway_redirect_type' ), true ); ?> value="default" name="subway_redirect_type" id="subway_use_default" type="radio" class="code" /> |
|
227 | + <input <?php checked('default', get_option('subway_redirect_type'), true); ?> value="default" name="subway_redirect_type" id="subway_use_default" type="radio" class="code" /> |
|
228 | 228 | |
229 | - <?php esc_html_e( 'Default Behavior', 'subway' ); ?> |
|
229 | + <?php esc_html_e('Default Behavior', 'subway'); ?> |
|
230 | 230 | |
231 | 231 | </label> |
232 | 232 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | <div id="subway_redirect_page_option_section" class="hidden subway-redirect-option-section"> |
243 | 243 | |
244 | 244 | <label for="subway_redirect_page_id"> |
245 | - <?php esc_html_e( 'Select Page' ); ?> |
|
245 | + <?php esc_html_e('Select Page'); ?> |
|
246 | 246 | </label> |
247 | 247 | |
248 | 248 | <?php |
@@ -250,8 +250,8 @@ discard block |
||
250 | 250 | wp_dropdown_pages( |
251 | 251 | array( |
252 | 252 | 'name' => 'subway_redirect_page_id', |
253 | - 'selected' => intval( get_option( 'subway_redirect_page_id' ) ), |
|
254 | - 'show_option_none' => esc_html__( '-', 'subway' ), |
|
253 | + 'selected' => intval(get_option('subway_redirect_page_id')), |
|
254 | + 'show_option_none' => esc_html__('-', 'subway'), |
|
255 | 255 | ) |
256 | 256 | ); |
257 | 257 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | |
260 | 260 | <p class="description"> |
261 | 261 | |
262 | - <?php _e( 'The selected page will be used as the redirect endpoint for all of your users. Selecting blank (-) will redirect the user to the default redirect defined in WordPress or other plugins. Choose "Custom URL" if you want to redirect to a custom URL or domain.', 'subway' ); ?> |
|
262 | + <?php _e('The selected page will be used as the redirect endpoint for all of your users. Selecting blank (-) will redirect the user to the default redirect defined in WordPress or other plugins. Choose "Custom URL" if you want to redirect to a custom URL or domain.', 'subway'); ?> |
|
263 | 263 | |
264 | 264 | </p> |
265 | 265 | |
@@ -268,29 +268,29 @@ discard block |
||
268 | 268 | <div id="subway_redirect_custom_url_option_section" class="hidden subway-redirect-option-section"> |
269 | 269 | |
270 | 270 | <label for="subway_redirect_custom_url"> |
271 | - <?php esc_attr_e( 'Enter Redirect URL:', 'subway' ); ?> |
|
271 | + <?php esc_attr_e('Enter Redirect URL:', 'subway'); ?> |
|
272 | 272 | </label> |
273 | 273 | |
274 | - <input value="<?php echo esc_attr( esc_url( get_option( 'subway_redirect_custom_url' ) ) ); ?>" type="text" name="subway_redirect_custom_url" placeholder="<?php esc_attr_e( 'http://', 'subway' ); ?>" |
|
274 | + <input value="<?php echo esc_attr(esc_url(get_option('subway_redirect_custom_url'))); ?>" type="text" name="subway_redirect_custom_url" placeholder="<?php esc_attr_e('http://', 'subway'); ?>" |
|
275 | 275 | id="subway_redirect_custom_url" size="75" /> |
276 | 276 | |
277 | 277 | <p class="description"><br> |
278 | 278 | |
279 | 279 | <?php |
280 | - echo sprintf( __( 'When entering a custom domain, you can use a variable string such us: %1$s and %2$s. For example, http://yoursiteurl.com/members/<strong>%2$s</strong> will translate to http://yoursiteurl/members/<strong>admin</strong> where "admin" is equal to the %2$s variable; http://yoursiteurl.com/users/<strong>%1$s</strong> will translate to http://yoursiteurl.com/users/<strong>4</strong> where "4" is equal to the %1$s. Both variables refer to the current user that is logged-in.', 'subway' ), '%user_id%', '%user_name%' ); |
|
280 | + echo sprintf(__('When entering a custom domain, you can use a variable string such us: %1$s and %2$s. For example, http://yoursiteurl.com/members/<strong>%2$s</strong> will translate to http://yoursiteurl/members/<strong>admin</strong> where "admin" is equal to the %2$s variable; http://yoursiteurl.com/users/<strong>%1$s</strong> will translate to http://yoursiteurl.com/users/<strong>4</strong> where "4" is equal to the %1$s. Both variables refer to the current user that is logged-in.', 'subway'), '%user_id%', '%user_name%'); |
|
281 | 281 | ?> |
282 | 282 | |
283 | 283 | </p><br> |
284 | 284 | |
285 | 285 | <p class="description"> |
286 | 286 | |
287 | - <?php esc_attr_e( 'Leave empty to use existing WordPress or other 3rd party plugin redirect option.', 'subway' ); ?> |
|
287 | + <?php esc_attr_e('Leave empty to use existing WordPress or other 3rd party plugin redirect option.', 'subway'); ?> |
|
288 | 288 | |
289 | 289 | </p><br> |
290 | 290 | |
291 | 291 | <p class="description"> |
292 | 292 | |
293 | - <?php esc_html_e( 'Warning: External URLs are not supported by WordPress Function (wp_safe_redirect) and will be redirected back to default WordPress behavior.', 'subway' ); ?> |
|
293 | + <?php esc_html_e('Warning: External URLs are not supported by WordPress Function (wp_safe_redirect) and will be redirected back to default WordPress behavior.', 'subway'); ?> |
|
294 | 294 | |
295 | 295 | </p> |
296 | 296 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | <div id="subway_redirect_default_option_section" class="hidden subway-redirect-option-section"> |
301 | 301 | <p> |
302 | 302 | <?php |
303 | - esc_html_e( "By choosing the default behavior, the redirect type will be set to the default WordPress' behavior. For example, if you have plugins like Peter's Login Redirect. This option will disable Subway's redirect and use the Peter's Login Redirect Instead.", 'subway' ); |
|
303 | + esc_html_e("By choosing the default behavior, the redirect type will be set to the default WordPress' behavior. For example, if you have plugins like Peter's Login Redirect. This option will disable Subway's redirect and use the Peter's Login Redirect Instead.", 'subway'); |
|
304 | 304 | ?> |
305 | 305 | </p> |
306 | 306 | </div> |