WPS Hide Login - Version 1.2.3

Version Description

  • Fix: change 403 to 404 error on wp-admin
  • Fix: activate plugin
  • Enhancement: Third party wpserveur
Download this release

Release Info

Developer NicolasKulka
Plugin Icon 128x128 WPS Hide Login
Version 1.2.3
Comparing to
See all releases

Code changes from version 1.2.2 to 1.2.3

3rd-party/3rd-party.php ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || die( 'Cheatin&#8217; uh?' );
3
+
4
+ include( plugin_dir_path( __FILE__ ) . 'hosting/wpserveur.php' );
3rd-party/hosting/wpserveur.php ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) || die( 'Cheatin&#8217; uh?' );
3
+
4
+ if ( ! function_exists( 'wps_hide_login_remove_http' ) ) {
5
+ function wps_hide_login_remove_http( $url ) {
6
+ $disallowed = array( 'http://', 'https://' );
7
+ foreach ( $disallowed as $d ) {
8
+ if ( strpos( $url, $d ) === 0 ) {
9
+ return str_replace( $d, '', $url );
10
+ }
11
+ }
12
+
13
+ return $url;
14
+ }
15
+ }
16
+
17
+ if ( ! function_exists( 'wps_hide_login_return_pf' ) ) {
18
+ function wps_hide_login_return_pf() {
19
+ $ip_array = array(
20
+ 'pf1' => '212.129.21.7',
21
+ 'pf2' => '163.172.241.32',
22
+ 'pf3' => '212.83.178.111',
23
+ 'pf4' => '212.129.40.192',
24
+ 'pf5' => '212.129.45.189',
25
+ 'pf999' => '163.172.111.251',
26
+ );
27
+ $siteurl = get_site_url();
28
+ $host = gethostbyname( wps_hide_login_remove_http( $siteurl ) );
29
+
30
+ $pf = '';
31
+
32
+ if ( in_array( $host, array_values( $ip_array ) ) ) {
33
+ $pf = array_search( $host, $ip_array );
34
+
35
+ return strtoupper( $pf );
36
+ }
37
+
38
+ // gestion ip persos
39
+ $host_name = gethostname();
40
+ if ( strpos( $host_name, 'wps' ) !== false ) {
41
+ $pf = preg_replace( "/[^0-9]/", '', $host_name );
42
+ $pf = 'PF' . $pf;
43
+ }
44
+
45
+ return $pf;
46
+ }
47
+ }
48
+
49
+ if ( ! function_exists( 'wpserveur_wps_hide_login_activate' ) ) {
50
+ add_action( 'wps_hide_login_activate', 'wpserveur_wps_hide_login_activate' );
51
+ function wpserveur_wps_hide_login_activate() {
52
+ $pf = wps_hide_login_return_pf();
53
+ if ( empty( $pf ) ) {
54
+ return false;
55
+ }
56
+
57
+ $whl_page = get_option( 'whl_page' );
58
+ if( empty( $whl_page ) || $whl_page === 'login' ) {
59
+ update_option( 'whl_page', 'connecter' );
60
+ }
61
+ }
62
+ }
classes/plugin.php ADDED
@@ -0,0 +1,543 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'WPS_Hide_Login' ) ) {
3
+
4
+ class WPS_Hide_Login {
5
+
6
+ private $wp_login_php;
7
+
8
+ /**
9
+ * Instance of this class.
10
+ *
11
+ * @since 1.0.0
12
+ *
13
+ * @var object
14
+ */
15
+ protected static $instance = null;
16
+
17
+ public function __construct() {
18
+ global $wp_version;
19
+
20
+ if ( version_compare( $wp_version, '4.0-RC1-src', '<' ) ) {
21
+ add_action( 'admin_notices', array( $this, 'admin_notices_incompatible' ) );
22
+ add_action( 'network_admin_notices', array( $this, 'admin_notices_incompatible' ) );
23
+
24
+ return;
25
+ }
26
+
27
+
28
+ if ( is_multisite() && ! function_exists( 'is_plugin_active_for_network' ) || ! function_exists( 'is_plugin_active' ) ) {
29
+ require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
30
+
31
+ }
32
+
33
+ if ( is_plugin_active_for_network( 'rename-wp-login/rename-wp-login.php' ) ) {
34
+ deactivate_plugins( WPS_HIDE_LOGIN_BASENAME );
35
+ add_action( 'network_admin_notices', array( $this, 'admin_notices_plugin_conflict' ) );
36
+ if ( isset( $_GET['activate'] ) ) {
37
+ unset( $_GET['activate'] );
38
+ }
39
+
40
+ return;
41
+ }
42
+
43
+ if ( is_plugin_active( 'rename-wp-login/rename-wp-login.php' ) ) {
44
+ deactivate_plugins( WPS_HIDE_LOGIN_BASENAME );
45
+ add_action( 'admin_notices', array( $this, 'admin_notices_plugin_conflict' ) );
46
+ if ( isset( $_GET['activate'] ) ) {
47
+ unset( $_GET['activate'] );
48
+ }
49
+
50
+ return;
51
+ }
52
+
53
+ if ( is_multisite() && is_plugin_active_for_network( WPS_HIDE_LOGIN_BASENAME ) ) {
54
+ add_action( 'wpmu_options', array( $this, 'wpmu_options' ) );
55
+ add_action( 'update_wpmu_options', array( $this, 'update_wpmu_options' ) );
56
+
57
+ add_filter( 'network_admin_plugin_action_links_' . WPS_HIDE_LOGIN_BASENAME, array(
58
+ $this,
59
+ 'plugin_action_links'
60
+ ) );
61
+ }
62
+
63
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
64
+ add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 9999 );
65
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
66
+ add_action( 'network_admin_notices', array( $this, 'admin_notices' ) );
67
+ add_action( 'wp_loaded', array( $this, 'wp_loaded' ) );
68
+ add_action( 'setup_theme', array( $this, 'setup_theme' ), 1 );
69
+
70
+ add_filter( 'plugin_action_links_' . WPS_HIDE_LOGIN_BASENAME, array( $this, 'plugin_action_links' ) );
71
+ add_filter( 'site_url', array( $this, 'site_url' ), 10, 4 );
72
+ add_filter( 'network_site_url', array( $this, 'network_site_url' ), 10, 3 );
73
+ add_filter( 'wp_redirect', array( $this, 'wp_redirect' ), 10, 2 );
74
+ add_filter( 'site_option_welcome_email', array( $this, 'welcome_email' ) );
75
+
76
+ remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
77
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
78
+
79
+ add_action('admin_menu', array( $this, 'wps_hide_login_menu_page' ) );
80
+ add_action( 'admin_init', array( $this, 'whl_template_redirect' ) );
81
+ }
82
+
83
+ private function use_trailing_slashes() {
84
+
85
+ return ( '/' === substr( get_option( 'permalink_structure' ), - 1, 1 ) );
86
+
87
+ }
88
+
89
+ private function user_trailingslashit( $string ) {
90
+
91
+ return $this->use_trailing_slashes() ? trailingslashit( $string ) : untrailingslashit( $string );
92
+
93
+ }
94
+
95
+ private function wp_template_loader() {
96
+
97
+ global $pagenow;
98
+
99
+ $pagenow = 'index.php';
100
+
101
+ if ( ! defined( 'WP_USE_THEMES' ) ) {
102
+
103
+ define( 'WP_USE_THEMES', true );
104
+
105
+ }
106
+
107
+ wp();
108
+
109
+ if ( $_SERVER['REQUEST_URI'] === $this->user_trailingslashit( str_repeat( '-/', 10 ) ) ) {
110
+
111
+ $_SERVER['REQUEST_URI'] = $this->user_trailingslashit( '/wp-login-php/' );
112
+
113
+ }
114
+
115
+ require_once( ABSPATH . WPINC . '/template-loader.php' );
116
+
117
+ die;
118
+
119
+ }
120
+
121
+ private function new_login_slug() {
122
+ if ( $slug = get_option( 'whl_page' ) ) {
123
+ return $slug;
124
+ } else if ( ( is_multisite() && is_plugin_active_for_network( WPS_HIDE_LOGIN_BASENAME ) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
125
+ return $slug;
126
+ } else if ( $slug = 'login' ) {
127
+ return $slug;
128
+ }
129
+ }
130
+
131
+ public function new_login_url( $scheme = null ) {
132
+
133
+ if ( get_option( 'permalink_structure' ) ) {
134
+
135
+ return $this->user_trailingslashit( home_url( '/', $scheme ) . $this->new_login_slug() );
136
+
137
+ } else {
138
+
139
+ return home_url( '/', $scheme ) . '?' . $this->new_login_slug();
140
+
141
+ }
142
+
143
+ }
144
+
145
+ /**
146
+ * Return an instance of this class.
147
+ *
148
+ * @since 1.0.0
149
+ *
150
+ * @return object A single instance of this class.
151
+ */
152
+ public static function get_instance() {
153
+
154
+ // If the single instance hasn't been set, set it now.
155
+ if ( null == self::$instance ) {
156
+ self::$instance = new self;
157
+ }
158
+
159
+ return self::$instance;
160
+ }
161
+
162
+ public function admin_notices_incompatible() {
163
+
164
+ echo '<div class="error notice is-dismissible"><p>' . __( 'Please upgrade to the latest version of WordPress to activate', 'wpserveur-hide-login' ) . ' <strong>' . __( 'WPS Hide Login', 'wpserveur-hide-login' ) . '</strong>.</p></div>';
165
+
166
+ }
167
+
168
+ public function admin_notices_plugin_conflict() {
169
+
170
+ echo '<div class="error notice is-dismissible"><p>' . __( 'WPS Hide Login could not be activated because you already have Rename wp-login.php active. Please uninstall rename wp-login.php to use WPS Hide Login', 'wpserveur-hide-login' ) . '</p></div>';
171
+
172
+ }
173
+
174
+ public static function activate() {
175
+ add_option( 'whl_redirect', '1' );
176
+
177
+ do_action( 'wps_hide_login_activate' );
178
+ }
179
+
180
+ public function wpmu_options() {
181
+
182
+ $out = '';
183
+
184
+ $out .= '<h3>' . __( 'WPS Hide Login', 'wpserveur-hide-login' ) . '</h3>';
185
+ $out .= '<p>' . __( 'This option allows you to set a networkwide default, which can be overridden by individual sites. Simply go to to the site’s permalink settings to change the url.', 'wpserveur-hide-login' ) . '</p>';
186
+ $out .= '<p>' . sprintf( __( 'Need help? Try the <a href="%1$s" target="_blank">support forum</a>. This plugin is kindly brought to you by <a href="%2$s" target="_blank">WPServeur</a>', 'wpserveur-hide-login' ), 'http://wordpress.org/support/plugin/wps-hide-login/', 'https://www.wpserveur.net/?refwps=14&campaign=wpshidelogin' ) . '</p>';
187
+ $out .= '<table class="form-table">';
188
+ $out .= '<tr valign="top">';
189
+ $out .= '<th scope="row"><label for="whl_page">' . __( 'Networkwide default', 'wpserveur-hide-login' ) . '</label></th>';
190
+ $out .= '<td><input id="whl_page" type="text" name="whl_page" value="' . esc_attr( get_site_option( 'whl_page', 'login' ) ) . '"></td>';
191
+ $out .= '</tr>';
192
+ $out .= '</table>';
193
+
194
+ echo $out;
195
+
196
+ }
197
+
198
+ public function update_wpmu_options() {
199
+ if ( check_admin_referer( 'siteoptions' ) ) {
200
+ if ( ( $whl_page = sanitize_title_with_dashes( $_POST['whl_page'] ) )
201
+ && strpos( $whl_page, 'wp-login' ) === false
202
+ && ! in_array( $whl_page, $this->forbidden_slugs() ) ) {
203
+
204
+ update_site_option( 'whl_page', $whl_page );
205
+
206
+ }
207
+ }
208
+ }
209
+
210
+ public function admin_init() {
211
+
212
+ global $pagenow;
213
+
214
+ add_settings_section(
215
+ 'wps-hide-login-section',
216
+ 'WPS Hide Login',
217
+ array( $this, 'whl_section_desc' ),
218
+ 'general'
219
+ );
220
+
221
+ add_settings_field(
222
+ 'whl_page',
223
+ '<label for="whl_page">' . __( 'Login url', 'wpserveur-hide-login' ) . '</label>',
224
+ array( $this, 'whl_page_input' ),
225
+ 'general',
226
+ 'wps-hide-login-section'
227
+ );
228
+
229
+ register_setting( 'general', 'whl_page', 'sanitize_title_with_dashes' );
230
+
231
+ if ( get_option( 'whl_redirect' ) ) {
232
+
233
+ delete_option( 'whl_redirect' );
234
+
235
+ if ( is_multisite()
236
+ && is_super_admin()
237
+ && is_plugin_active_for_network( WPS_HIDE_LOGIN_BASENAME ) ) {
238
+
239
+ $redirect = network_admin_url( 'settings.php#whl_settings' );
240
+
241
+ } else {
242
+
243
+ $redirect = admin_url( 'options-general.php#whl_settings' );
244
+
245
+ }
246
+
247
+ wp_safe_redirect( $redirect );
248
+
249
+ die;
250
+
251
+ }
252
+
253
+ }
254
+
255
+ public function whl_section_desc() {
256
+
257
+ $out = '';
258
+
259
+ if ( ! is_multisite()
260
+ || is_super_admin() ) {
261
+
262
+ $details_url = add_query_arg(
263
+ array(
264
+ 'tab' => 'plugin-information',
265
+ 'plugin' => 'wps-bidouille',
266
+ 'TB_iframe' => true,
267
+ 'width' => 722,
268
+ 'height' => 949,
269
+ ),
270
+ admin_url( 'plugin-install.php' )
271
+ );
272
+
273
+ $out .= '<div id="whl_settings">';
274
+ $out .= sprintf( __( 'Need help? Try the <a href="%1$s" target="_blank">support forum</a>. This plugin is kindly brought to you by <a href="%2$s" target="_blank">WPServeur</a>', 'wpserveur-hide-login' ), 'http://wordpress.org/support/plugin/wps-hide-login/', 'https://www.wpserveur.net/?refwps=14&campaign=wpshidelogin' ) . ' (' . __( 'WordPress specialized hosting', 'wpserveur-hide-login' ) . ')';
275
+ $out .= '<br>' . __( 'Discover our other plugins:', 'wpserveur-hide-login' ) . ' ';
276
+ $out .= '<a href="' . $details_url .'" class="thickbox open-plugin-details-modal">' . __( 'WPS Bidouille', 'wpserveur-hide-login' ) . '</a>';
277
+ $out .= '</div>';
278
+
279
+ }
280
+
281
+ if ( is_multisite()
282
+ && is_super_admin()
283
+ && is_plugin_active_for_network( WPS_HIDE_LOGIN_BASENAME ) ) {
284
+
285
+ $out .= '<p>' . sprintf( __( 'To set a networkwide default, go to <a href="%s">Network Settings</a>.', 'wpserveur-hide-login' ), network_admin_url( 'settings.php#whl_settings' ) ) . '</p>';
286
+
287
+ }
288
+
289
+ echo $out;
290
+
291
+ }
292
+
293
+ public function whl_page_input() {
294
+
295
+ if ( get_option( 'permalink_structure' ) ) {
296
+
297
+ echo '<code>' . trailingslashit( home_url() ) . '</code> <input id="whl_page" type="text" name="whl_page" value="' . $this->new_login_slug() . '">' . ( $this->use_trailing_slashes() ? ' <code>/</code>' : '' );
298
+
299
+ } else {
300
+
301
+ echo '<code>' . trailingslashit( home_url() ) . '?</code> <input id="whl_page" type="text" name="whl_page" value="' . $this->new_login_slug() . '">';
302
+
303
+ }
304
+
305
+ echo '<p class="description">' . __( 'Protect your website by changing the login URL and preventing access to the wp-login.php page and the wp-admin directory to non-connected people.', 'wpserveur-hide-login' ) . '</p>';
306
+
307
+ }
308
+
309
+ public function admin_notices() {
310
+
311
+ global $pagenow;
312
+
313
+ $out = '';
314
+
315
+ if ( ! is_network_admin()
316
+ && $pagenow === 'options-general.php'
317
+ && isset( $_GET['settings-updated'] )
318
+ && ! isset( $_GET['page'] ) ) {
319
+
320
+ echo '<div class="updated notice is-dismissible"><p>' . sprintf( __( 'Your login page is now here: <strong><a href="%1$s">%2$s</a></strong>. Bookmark this page!', 'wpserveur-hide-login' ), $this->new_login_url(), $this->new_login_url() ) . '</p></div>';
321
+
322
+ }
323
+
324
+ }
325
+
326
+ public function plugin_action_links( $links ) {
327
+
328
+ if ( is_network_admin()
329
+ && is_plugin_active_for_network( WPS_HIDE_LOGIN_BASENAME ) ) {
330
+
331
+ array_unshift( $links, '<a href="' . network_admin_url( 'settings.php#whl_settings' ) . '">' . __( 'Settings', 'wpserveur-hide-login' ) . '</a>' );
332
+
333
+ } elseif ( ! is_network_admin() ) {
334
+
335
+ array_unshift( $links, '<a href="' . admin_url( 'options-general.php#whl_settings' ) . '">' . __( 'Settings', 'wpserveur-hide-login' ) . '</a>' );
336
+
337
+ }
338
+
339
+ return $links;
340
+
341
+ }
342
+
343
+ public function plugins_loaded() {
344
+
345
+ global $pagenow;
346
+
347
+ if ( ! is_multisite()
348
+ && ( strpos( $_SERVER['REQUEST_URI'], 'wp-signup' ) !== false
349
+ || strpos( $_SERVER['REQUEST_URI'], 'wp-activate' ) ) !== false ) {
350
+
351
+ wp_die( __( 'This feature is not enabled.', 'wpserveur-hide-login' ) );
352
+
353
+ }
354
+
355
+ $request = parse_url( $_SERVER['REQUEST_URI'] );
356
+
357
+ if ( ( strpos( rawurldecode( $_SERVER['REQUEST_URI'] ), 'wp-login.php' ) !== false
358
+ || untrailingslashit( $request['path'] ) === site_url( 'wp-login', 'relative' ) )
359
+ && ! is_admin() ) {
360
+
361
+ $this->wp_login_php = true;
362
+
363
+ $_SERVER['REQUEST_URI'] = $this->user_trailingslashit( '/' . str_repeat( '-/', 10 ) );
364
+
365
+ $pagenow = 'index.php';
366
+
367
+ } elseif ( untrailingslashit( $request['path'] ) === home_url( $this->new_login_slug(), 'relative' )
368
+ || ( ! get_option( 'permalink_structure' )
369
+ && isset( $_GET[ $this->new_login_slug() ] )
370
+ && empty( $_GET[ $this->new_login_slug() ] ) ) ) {
371
+
372
+ $pagenow = 'wp-login.php';
373
+
374
+ }
375
+
376
+ }
377
+
378
+ public function setup_theme() {
379
+ global $pagenow;
380
+
381
+ if ( ! is_user_logged_in() && 'customize.php' === $pagenow ) {
382
+ wp_die( __( 'This has been disabled', 'wpserveur-hide-login' ), 403 );
383
+ }
384
+ }
385
+
386
+ public function wp_loaded() {
387
+
388
+ global $pagenow;
389
+
390
+ if ( is_admin() && ! is_user_logged_in() && ! defined( 'DOING_AJAX' ) && $pagenow !== 'admin-post.php' ) {
391
+ wp_safe_redirect( home_url( '/404' ) );
392
+ die();
393
+ }
394
+
395
+ $request = parse_url( $_SERVER['REQUEST_URI'] );
396
+
397
+ if ( $pagenow === 'wp-login.php'
398
+ && $request['path'] !== $this->user_trailingslashit( $request['path'] )
399
+ && get_option( 'permalink_structure' ) ) {
400
+
401
+ wp_safe_redirect( $this->user_trailingslashit( $this->new_login_url() )
402
+ . ( ! empty( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '' ) );
403
+
404
+ die;
405
+
406
+ } elseif ( $this->wp_login_php ) {
407
+
408
+ if ( ( $referer = wp_get_referer() )
409
+ && strpos( $referer, 'wp-activate.php' ) !== false
410
+ && ( $referer = parse_url( $referer ) )
411
+ && ! empty( $referer['query'] ) ) {
412
+
413
+ parse_str( $referer['query'], $referer );
414
+
415
+ if ( ! empty( $referer['key'] )
416
+ && ( $result = wpmu_activate_signup( $referer['key'] ) )
417
+ && is_wp_error( $result )
418
+ && ( $result->get_error_code() === 'already_active'
419
+ || $result->get_error_code() === 'blog_taken' ) ) {
420
+
421
+ wp_safe_redirect( $this->new_login_url()
422
+ . ( ! empty( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '' ) );
423
+
424
+ die;
425
+
426
+ }
427
+
428
+ }
429
+
430
+ $this->wp_template_loader();
431
+
432
+ } elseif ( $pagenow === 'wp-login.php' ) {
433
+ global $error, $interim_login, $action, $user_login;
434
+
435
+ if ( is_user_logged_in() && ! isset( $_REQUEST['action'] ) ) {
436
+ wp_safe_redirect( admin_url() );
437
+ die();
438
+ }
439
+
440
+ @require_once ABSPATH . 'wp-login.php';
441
+
442
+ die;
443
+
444
+ }
445
+
446
+ }
447
+
448
+ public function site_url( $url, $path, $scheme, $blog_id ) {
449
+
450
+ return $this->filter_wp_login_php( $url, $scheme );
451
+
452
+ }
453
+
454
+ public function network_site_url( $url, $path, $scheme ) {
455
+
456
+ return $this->filter_wp_login_php( $url, $scheme );
457
+
458
+ }
459
+
460
+ public function wp_redirect( $location, $status ) {
461
+
462
+ return $this->filter_wp_login_php( $location );
463
+
464
+ }
465
+
466
+ public function filter_wp_login_php( $url, $scheme = null ) {
467
+
468
+ if ( strpos( $url, 'wp-login.php' ) !== false ) {
469
+
470
+ if ( is_ssl() ) {
471
+
472
+ $scheme = 'https';
473
+
474
+ }
475
+
476
+ $args = explode( '?', $url );
477
+
478
+ if ( isset( $args[1] ) ) {
479
+
480
+ parse_str( $args[1], $args );
481
+
482
+ $url = add_query_arg( $args, $this->new_login_url( $scheme ) );
483
+
484
+ } else {
485
+
486
+ $url = $this->new_login_url( $scheme );
487
+
488
+ }
489
+
490
+ }
491
+
492
+ return $url;
493
+
494
+ }
495
+
496
+ public function welcome_email( $value ) {
497
+
498
+ return $value = str_replace( 'wp-login.php', trailingslashit( get_site_option( 'whl_page', 'login' ) ), $value );
499
+
500
+ }
501
+
502
+ public function forbidden_slugs() {
503
+
504
+ $wp = new WP;
505
+
506
+ return array_merge( $wp->public_query_vars, $wp->private_query_vars );
507
+
508
+ }
509
+
510
+ /**
511
+ * Load scripts
512
+ */
513
+ public function admin_enqueue_scripts() {
514
+ $screen = get_current_screen();
515
+
516
+ if ( 'options-general' != $screen->id ) {
517
+ return false;
518
+ }
519
+
520
+ wp_enqueue_style( 'plugin-install' );
521
+
522
+ wp_enqueue_script( 'plugin-install' );
523
+ wp_enqueue_script( 'updates' );
524
+ add_thickbox();
525
+ }
526
+
527
+ public function wps_hide_login_menu_page() {
528
+ $title = __( 'WPS Hide Login' );
529
+
530
+ add_options_page($title, $title, 'manage_options', 'whl_settings', function () {
531
+ _e( 'WPS Hide Login' );
532
+ });
533
+ }
534
+
535
+ public function whl_template_redirect() {
536
+ if ( ! empty( $_GET ) && isset( $_GET['page'] ) && 'whl_settings' === $_GET['page'] ) {
537
+ wp_redirect( admin_url( 'options-general.php#whl_settings' ) );
538
+ exit();
539
+ }
540
+ }
541
+
542
+ }
543
+ }
index.php DELETED
@@ -1 +0,0 @@
1
- <?php // Silence is golden
 
languages/wpserveur-hide-login-fr_FR.mo ADDED
Binary file
languages/wpserveur-hide-login-fr_FR.po ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Translation of Plugins - WPS Hide Login - Stable (latest release) in French (France)
2
+ # This file is distributed under the same license as the Plugins - WPS Hide Login - Stable (latest release) package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Plugins - WPS Hide Login - Stable (latest release)\n"
6
+ "POT-Creation-Date: 2018-02-12 11:09+0100\n"
7
+ "PO-Revision-Date: 2018-02-12 11:09+0100\n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
+ "Language: fr\n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+ "Plural-Forms: nplurals=2; plural=n > 1;\n"
15
+ "X-Generator: Poedit 1.8.12\n"
16
+
17
+ #: classes/plugin.php:164
18
+ msgid "Please upgrade to the latest version of WordPress to activate"
19
+ msgstr "Veuillez mettre à jour WordPress dans sa dernière version pour activer"
20
+
21
+ #. Plugin Name of the plugin/theme
22
+ #: classes/plugin.php:164 classes/plugin.php:184 classes/plugin.php:528
23
+ #: classes/plugin.php:531
24
+ msgid "WPS Hide Login"
25
+ msgstr "WPS Hide Login"
26
+
27
+ #: classes/plugin.php:170
28
+ msgid ""
29
+ "WPS Hide Login could not be activated because you already have Rename wp-"
30
+ "login.php active. Please uninstall rename wp-login.php to use WPS Hide Login"
31
+ msgstr ""
32
+ "WPS Hide Login n’a pas pu être activé car vous avez déjà Rename wp-login.php "
33
+ "activé. Veuillez désinstaller Rename wp-login.php pour pouvoir utiliser WPS "
34
+ "Hide Login."
35
+
36
+ #: classes/plugin.php:185
37
+ msgid ""
38
+ "This option allows you to set a networkwide default, which can be overridden "
39
+ "by individual sites. Simply go to to the site’s permalink settings to change "
40
+ "the url."
41
+ msgstr ""
42
+ "Cette option vous permet de définir un réglage par défaut pour le réseau, "
43
+ "qui peut ensuite être remplacé pour chaque site individuellement. Allez "
44
+ "simplement dans les réglages des permaliens du site pour modifier l’URL."
45
+
46
+ #: classes/plugin.php:186 classes/plugin.php:274
47
+ #, php-format
48
+ msgid ""
49
+ "Need help? Try the <a href=\"%1$s\" target=\"_blank\">support forum</a>. "
50
+ "This plugin is kindly brought to you by <a href=\"%2$s\" target=\"_blank"
51
+ "\">WPServeur</a>"
52
+ msgstr ""
53
+ "Besoin d’aide ? Essayez le <a href=\"%1$s\" target=\"_blank\">forum de "
54
+ "support</a>. Cette extension vous est gentiment proposée par <a href=\"%2$s"
55
+ "\" target=\"_blank\">WPServeur</a>"
56
+
57
+ #: classes/plugin.php:189
58
+ msgid "Networkwide default"
59
+ msgstr "Réglage par défaut du réseau"
60
+
61
+ #: classes/plugin.php:223
62
+ msgid "Login url"
63
+ msgstr "URL de connexion"
64
+
65
+ #: classes/plugin.php:274
66
+ msgid "WordPress specialized hosting"
67
+ msgstr "Hébergement spécialisé WordPress"
68
+
69
+ #: classes/plugin.php:275
70
+ msgid "Discover our other plugins:"
71
+ msgstr "Découvrez notre dernière création, le plugin"
72
+
73
+ #: classes/plugin.php:276
74
+ msgid "WPS Bidouille"
75
+ msgstr "WPS Bidouille"
76
+
77
+ #: classes/plugin.php:285
78
+ #, php-format
79
+ msgid ""
80
+ "To set a networkwide default, go to <a href=\"%s\">Network Settings</a>."
81
+ msgstr ""
82
+ "Pour définir un réglage par défaut pour le réseau, allez aux <a href=\"%s"
83
+ "\">réglages du réseaux</a>."
84
+
85
+ #: classes/plugin.php:305
86
+ msgid ""
87
+ "Protect your website by changing the login URL and preventing access to the "
88
+ "wp-login.php page and the wp-admin directory to non-connected people."
89
+ msgstr ""
90
+ "Protégez votre site Web en changeant l’URL de connexion et en empêchant "
91
+ "l’accès à la page wp-login.php et au répertoire wp-admin aux personnes non-"
92
+ "connectées."
93
+
94
+ #: classes/plugin.php:320
95
+ #, php-format
96
+ msgid ""
97
+ "Your login page is now here: <strong><a href=\"%1$s\">%2$s</a></strong>. "
98
+ "Bookmark this page!"
99
+ msgstr ""
100
+ "Votre page de connexion est maintenant ici : <strong><a href=\"%1$s\">%2$s</"
101
+ "a></strong>. Mettez-la en favori !"
102
+
103
+ #: classes/plugin.php:331 classes/plugin.php:335
104
+ msgid "Settings"
105
+ msgstr "Réglages"
106
+
107
+ #: classes/plugin.php:351
108
+ msgid "This feature is not enabled."
109
+ msgstr "Cette fonctionnalité n’est pas activée."
110
+
111
+ #: classes/plugin.php:382
112
+ msgid "This has been disabled"
113
+ msgstr "Cela a été désactivé"
114
+
115
+ #. Plugin URI of the plugin/theme
116
+ msgid "https://github.com/Tabrisrp/wps-hide-login"
117
+ msgstr "https://github.com/Tabrisrp/wps-hide-login"
118
+
119
+ #. Description of the plugin/theme
120
+ msgid ""
121
+ "Protect your website by changing the login URL and preventing access to wp-"
122
+ "login.php page and wp-admin directory while not logged-in"
123
+ msgstr ""
124
+ "Protégez votre site Web en changeant l’URL de connexion et en empêchant "
125
+ "l’accès à la page wp-login.php et au répertoire wp-admin aux personnes non-"
126
+ "connectées. "
127
+
128
+ #. Author of the plugin/theme
129
+ msgid "Remy Perona for WPServeur"
130
+ msgstr "Remy Perona de WPServeur"
131
+
132
+ #. Author URI of the plugin/theme
133
+ msgid "http://profiles.wordpress.org/tabrisrp/"
134
+ msgstr "http://profiles.wordpress.org/tabrisrp/"
135
+
136
+ #~ msgid ""
137
+ #~ "Need help? Try the <a href=\"%1$s\" target=\"_blank\">support forum</a>. "
138
+ #~ "This plugin is kindly brought to you by <a href=\"%2$s\" target=\"_blank"
139
+ #~ "\">WPServeur</a>."
140
+ #~ msgstr ""
141
+ #~ "Besoin d’aide ? Essayez le <a href=\"%1$s\" target=\"_blank\">forum de "
142
+ #~ "support</a>. Cette extension vous est gentiment proposée par <a href="
143
+ #~ "\"%2$s\" target=\"_blank\">WPServeur</a>."
languages/wpserveur-hide-login.pot ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #, fuzzy
2
+ msgid ""
3
+ msgstr ""
4
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
5
+ "Project-Id-Version: WPS Hide Login\n"
6
+ "POT-Creation-Date: 2018-02-12 11:08+0100\n"
7
+ "PO-Revision-Date: 2018-02-12 11:08+0100\n"
8
+ "Last-Translator: \n"
9
+ "Language-Team: \n"
10
+ "MIME-Version: 1.0\n"
11
+ "Content-Type: text/plain; charset=UTF-8\n"
12
+ "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Poedit 1.8.12\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "X-Poedit-WPHeader: wps-hide-login.php\n"
16
+ "X-Poedit-SourceCharset: UTF-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
18
+ "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
19
+ "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Poedit-SearchPathExcluded-0: *.js\n"
22
+
23
+ #: classes/plugin.php:164
24
+ msgid "Please upgrade to the latest version of WordPress to activate"
25
+ msgstr ""
26
+
27
+ #. Plugin Name of the plugin/theme
28
+ #: classes/plugin.php:164 classes/plugin.php:184 classes/plugin.php:528
29
+ #: classes/plugin.php:531
30
+ msgid "WPS Hide Login"
31
+ msgstr ""
32
+
33
+ #: classes/plugin.php:170
34
+ msgid ""
35
+ "WPS Hide Login could not be activated because you already have Rename wp-"
36
+ "login.php active. Please uninstall rename wp-login.php to use WPS Hide Login"
37
+ msgstr ""
38
+
39
+ #: classes/plugin.php:185
40
+ msgid ""
41
+ "This option allows you to set a networkwide default, which can be overridden "
42
+ "by individual sites. Simply go to to the site’s permalink settings to change "
43
+ "the url."
44
+ msgstr ""
45
+
46
+ #: classes/plugin.php:186 classes/plugin.php:274
47
+ #, php-format
48
+ msgid ""
49
+ "Need help? Try the <a href=\"%1$s\" target=\"_blank\">support forum</a>. "
50
+ "This plugin is kindly brought to you by <a href=\"%2$s\" target=\"_blank"
51
+ "\">WPServeur</a>"
52
+ msgstr ""
53
+
54
+ #: classes/plugin.php:189
55
+ msgid "Networkwide default"
56
+ msgstr ""
57
+
58
+ #: classes/plugin.php:223
59
+ msgid "Login url"
60
+ msgstr ""
61
+
62
+ #: classes/plugin.php:274
63
+ msgid "WordPress specialized hosting"
64
+ msgstr ""
65
+
66
+ #: classes/plugin.php:275
67
+ msgid "Discover our other plugins:"
68
+ msgstr ""
69
+
70
+ #: classes/plugin.php:276
71
+ msgid "WPS Bidouille"
72
+ msgstr ""
73
+
74
+ #: classes/plugin.php:285
75
+ #, php-format
76
+ msgid ""
77
+ "To set a networkwide default, go to <a href=\"%s\">Network Settings</a>."
78
+ msgstr ""
79
+
80
+ #: classes/plugin.php:305
81
+ msgid ""
82
+ "Protect your website by changing the login URL and preventing access to the "
83
+ "wp-login.php page and the wp-admin directory to non-connected people."
84
+ msgstr ""
85
+
86
+ #: classes/plugin.php:320
87
+ #, php-format
88
+ msgid ""
89
+ "Your login page is now here: <strong><a href=\"%1$s\">%2$s</a></strong>. "
90
+ "Bookmark this page!"
91
+ msgstr ""
92
+
93
+ #: classes/plugin.php:331 classes/plugin.php:335
94
+ msgid "Settings"
95
+ msgstr ""
96
+
97
+ #: classes/plugin.php:351
98
+ msgid "This feature is not enabled."
99
+ msgstr ""
100
+
101
+ #: classes/plugin.php:382
102
+ msgid "This has been disabled"
103
+ msgstr ""
104
+
105
+ #. Plugin URI of the plugin/theme
106
+ msgid "https://github.com/Tabrisrp/wps-hide-login"
107
+ msgstr ""
108
+
109
+ #. Description of the plugin/theme
110
+ msgid ""
111
+ "Protect your website by changing the login URL and preventing access to wp-"
112
+ "login.php page and wp-admin directory while not logged-in"
113
+ msgstr ""
114
+
115
+ #. Author of the plugin/theme
116
+ msgid "Remy Perona for WPServeur"
117
+ msgstr ""
118
+
119
+ #. Author URI of the plugin/theme
120
+ msgid "http://profiles.wordpress.org/tabrisrp/"
121
+ msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: tabrisrp, WPServeur, nicolaskulka
4
  Tags: rename, login, wp-login, wp-login.php, custom login url
5
  Requires at least: 4.1
6
  Tested up to: 4.9
7
- Stable tag: 1.2.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,10 +12,37 @@ Change wp-login.php to anything you want.
12
 
13
  == Description ==
14
 
 
 
 
 
 
 
15
  *WPS Hide Login* is a very light plugin that lets you easily and safely change the url of the login form page to anything you want. It doesn’t literally rename or change files in core, nor does it add rewrite rules. It simply intercepts page requests and works on any WordPress website. The wp-admin directory and wp-login.php page become inaccessible, so you should bookmark or remember the url. Deactivating this plugin brings your site back exactly to the state it was before.
16
 
17
  = Compatibility =
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  Requires WordPress 4.1 or higher. All login related things such as the registration form, lost password form, login widget and expired sessions just keep working.
20
 
21
  It’s also compatible with any plugin that hooks in the login form, including:
@@ -39,11 +66,21 @@ https://github.com/tabrisrp/wps-hide-login
39
 
40
  == Installation ==
41
 
 
 
 
 
 
 
 
 
 
 
42
  1. Go to Plugins › Add New.
43
  2. Search for *WPS Hide Login*.
44
  3. Look for this plugin, download and activate it.
45
  4. The page will redirect you to the settings. Change your login url there.
46
- 5. You can change this option any time you want, just go back to Settings › General › WPS Hide Login.
47
 
48
  == Screenshots ==
49
  1. Setting on single site installation
@@ -51,6 +88,22 @@ https://github.com/tabrisrp/wps-hide-login
51
 
52
  == Frequently Asked Questions ==
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  = I forgot my login url! =
55
 
56
  Either go to your MySQL database and look for the value of `whl_page` in the options table, or remove the `wps-hide-login` folder from your `plugins` folder, log in through wp-login.php and reinstall the plugin.
@@ -64,6 +117,11 @@ First step is to check your .htaccess file and compare it to a regular one, to s
64
 
65
  == Changelog ==
66
 
 
 
 
 
 
67
  = 1.2.2 =
68
  * Enhancement: Compatibility 4.9.x
69
 
4
  Tags: rename, login, wp-login, wp-login.php, custom login url
5
  Requires at least: 4.1
6
  Tested up to: 4.9
7
+ Stable tag: 1.2.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
12
 
13
  == Description ==
14
 
15
+ = Français =
16
+
17
+ *WPS Hide Login* est un plugin très léger qui vous permet de changer facilement et en toute sécurité l'url de la page de formulaire de connexion. Il ne renomme pas littéralement ou ne modifie pas les fichiers dans le noyau, ni n'ajoute des règles de réécriture. Il intercepte simplement les demandes de pages et fonctionne sur n'importe quel site WordPress. Le répertoire wp-admin et la page wp-login.php deviennent inaccessibles, vous devez donc ajouter un signet ou vous souvenir de l'URL. Désactiver ce plugin ramène votre site exactement à l'état dans lequel il était auparavant.
18
+
19
+ = English =
20
+
21
  *WPS Hide Login* is a very light plugin that lets you easily and safely change the url of the login form page to anything you want. It doesn’t literally rename or change files in core, nor does it add rewrite rules. It simply intercepts page requests and works on any WordPress website. The wp-admin directory and wp-login.php page become inaccessible, so you should bookmark or remember the url. Deactivating this plugin brings your site back exactly to the state it was before.
22
 
23
  = Compatibility =
24
 
25
+ = Français =
26
+
27
+ Nécessite WordPress 4.1 ou supérieur. Toutes les choses liées à la connexion telles que le formulaire d'inscription, le formulaire de mot de passe perdu, le widget de connexion et les sessions expirées continuent de fonctionner.
28
+
29
+ Il est également compatible avec tout plugin qui se connecte au formulaire de connexion, notamment:
30
+
31
+ * BuddyPress,
32
+ * bbPress,
33
+ * Limit Login Attempts,
34
+ * and User Switching.
35
+
36
+ Évidemment, cela ne fonctionne pas avec les plugins ou les thèmes *hardcoded* wp-login.php.
37
+
38
+ Fonctionne en multisite, mais pas testé avec des sous-domaines. L'activer pour un réseau vous permet de définir une valeur par défaut pour l'ensemble du réseau. Les sites individuels peuvent toujours renommer leur page de connexion pour autre chose.
39
+
40
+ Si vous utilisez un **plugin de mise en cache de pages** autre que WP Rocket, vous devez ajouter le slug de la nouvelle URL de connexion à la liste des pages à ne pas mettre en cache. WP Rocket est déjà entièrement compatible avec le plugin.
41
+
42
+ Pour W3 Total Cache et WP Super Cache, ce plugin vous donnera un message avec un lien vers le champ que vous devriez mettre à jour.
43
+
44
+ = English =
45
+
46
  Requires WordPress 4.1 or higher. All login related things such as the registration form, lost password form, login widget and expired sessions just keep working.
47
 
48
  It’s also compatible with any plugin that hooks in the login form, including:
66
 
67
  == Installation ==
68
 
69
+ = Français =
70
+
71
+ 1. Aller dans Extensions › Ajouter.
72
+ 2. Rechercher *WPS Hide Login*.
73
+ 3. Recherchez ce plugin, téléchargez-le et activez-le.
74
+ 4. La page vous redirigera vers les paramètres. Changez votre URL de connexion.
75
+ 5. Vous pouvez changer cette option quand vous le souhaitez, il vous suffit de retourner dans Paramètres > WPS Hide Login.
76
+
77
+ = English =
78
+
79
  1. Go to Plugins › Add New.
80
  2. Search for *WPS Hide Login*.
81
  3. Look for this plugin, download and activate it.
82
  4. The page will redirect you to the settings. Change your login url there.
83
+ 5. You can change this option any time you want, just go back to Settings › WPS Hide Login.
84
 
85
  == Screenshots ==
86
  1. Setting on single site installation
88
 
89
  == Frequently Asked Questions ==
90
 
91
+ = Français =
92
+
93
+ = J'ai oublié mon identifiant de connexion ! =
94
+
95
+ Allez dans votre base de données MySQL et recherchez la valeur de 'whl_page' dans la table des options, ou supprimez le dossier 'wps-hide-login' de votre dossier 'plugins', connectez-vous via wp-login.php et réinstallez le plugin .
96
+
97
+ Sur une installation multisite, l'option 'whl_page' sera dans la table de sitemeta, si l'option n'existe pas dans la table des options.
98
+
99
+ = Je suis bloqué ! =
100
+
101
+ Ce cas peut provenir de plugins modifiant vos fichiers .htaccess pour ajouter ou modifier des règles, ou d'une ancienne configuration de WordPress MU non mise à jour depuis l'ajout de Multisite.
102
+
103
+ La première étape consiste à vérifier votre fichier .htaccess et à le comparer à un fichier .htaccess normal, pour voir si le problème provient de ce fichier.
104
+
105
+ = English =
106
+
107
  = I forgot my login url! =
108
 
109
  Either go to your MySQL database and look for the value of `whl_page` in the options table, or remove the `wps-hide-login` folder from your `plugins` folder, log in through wp-login.php and reinstall the plugin.
117
 
118
  == Changelog ==
119
 
120
+ = 1.2.3 =
121
+ * Fix: change 403 to 404 error on wp-admin
122
+ * Fix: activate plugin
123
+ * Enhancement: Third party wpserveur
124
+
125
  = 1.2.2 =
126
  * Enhancement: Compatibility 4.9.x
127
 
wps-hide-login.php CHANGED
@@ -1,530 +1,51 @@
1
  <?php
2
  /*
3
  Plugin Name: WPS Hide Login
4
- Plugin URI: https://github.com/Tabrisrp/wps-hide-login
5
  Description: Protect your website by changing the login URL and preventing access to wp-login.php page and wp-admin directory while not logged-in
6
- Author: Remy Perona for WPServeur
7
- Author URI: http://profiles.wordpress.org/tabrisrp/
8
- Version: 1.2.2
9
  Requires at least: 4.1
10
  Tested up to: 4.9
11
- Text Domain: wps-hide-login
12
  License: GPLv2 or later
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
  */
15
 
16
- if ( defined( 'ABSPATH' ) && ! class_exists( 'WPS_Hide_Login' ) ) {
17
-
18
- class WPS_Hide_Login {
19
-
20
- private $wp_login_php;
21
-
22
- /**
23
- * Instance of this class.
24
- *
25
- * @since 1.0.0
26
- *
27
- * @var object
28
- */
29
- protected static $instance = null;
30
-
31
- private function basename() {
32
-
33
- return plugin_basename( __FILE__ );
34
-
35
- }
36
-
37
- private function path() {
38
-
39
- return trailingslashit( dirname( __FILE__ ) );
40
-
41
- }
42
-
43
- private function use_trailing_slashes() {
44
-
45
- return ( '/' === substr( get_option( 'permalink_structure' ), - 1, 1 ) );
46
-
47
- }
48
-
49
- private function user_trailingslashit( $string ) {
50
-
51
- return $this->use_trailing_slashes() ? trailingslashit( $string ) : untrailingslashit( $string );
52
-
53
- }
54
-
55
- private function wp_template_loader() {
56
-
57
- global $pagenow;
58
-
59
- $pagenow = 'index.php';
60
-
61
- if ( ! defined( 'WP_USE_THEMES' ) ) {
62
-
63
- define( 'WP_USE_THEMES', true );
64
-
65
- }
66
-
67
- wp();
68
-
69
- if ( $_SERVER['REQUEST_URI'] === $this->user_trailingslashit( str_repeat( '-/', 10 ) ) ) {
70
-
71
- $_SERVER['REQUEST_URI'] = $this->user_trailingslashit( '/wp-login-php/' );
72
-
73
- }
74
-
75
- require_once( ABSPATH . WPINC . '/template-loader.php' );
76
-
77
- die;
78
-
79
- }
80
-
81
- private function new_login_slug() {
82
-
83
- if ( $slug = get_option( 'whl_page' ) ) {
84
- return $slug;
85
- } else if ( ( is_multisite() && is_plugin_active_for_network( $this->basename() ) && ( $slug = get_site_option( 'whl_page', 'login' ) ) ) ) {
86
- return $slug;
87
- } else if ( $slug = 'login' ) {
88
- return $slug;
89
- }
90
-
91
- }
92
-
93
- public function new_login_url( $scheme = null ) {
94
-
95
- if ( get_option( 'permalink_structure' ) ) {
96
-
97
- return $this->user_trailingslashit( home_url( '/', $scheme ) . $this->new_login_slug() );
98
-
99
- } else {
100
-
101
- return home_url( '/', $scheme ) . '?' . $this->new_login_slug();
102
-
103
- }
104
-
105
- }
106
-
107
- public function __construct() {
108
- add_action( 'plugins_loaded', array( $this, 'whl_load_textdomain' ), 9 );
109
-
110
- global $wp_version;
111
-
112
- if ( version_compare( $wp_version, '4.0-RC1-src', '<' ) ) {
113
- add_action( 'admin_notices', array( $this, 'admin_notices_incompatible' ) );
114
- add_action( 'network_admin_notices', array( $this, 'admin_notices_incompatible' ) );
115
-
116
- return;
117
- }
118
-
119
-
120
- if ( is_multisite() && ! function_exists( 'is_plugin_active_for_network' ) || ! function_exists( 'is_plugin_active' ) ) {
121
- require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
122
-
123
- }
124
-
125
- if ( is_plugin_active_for_network( 'rename-wp-login/rename-wp-login.php' ) ) {
126
- deactivate_plugins( plugin_basename( __FILE__ ) );
127
- add_action( 'network_admin_notices', array( $this, 'admin_notices_plugin_conflict' ) );
128
- if ( isset( $_GET['activate'] ) ) {
129
- unset( $_GET['activate'] );
130
- }
131
-
132
- return;
133
- }
134
-
135
- if ( is_plugin_active( 'rename-wp-login/rename-wp-login.php' ) ) {
136
- deactivate_plugins( plugin_basename( __FILE__ ) );
137
- add_action( 'admin_notices', array( $this, 'admin_notices_plugin_conflict' ) );
138
- if ( isset( $_GET['activate'] ) ) {
139
- unset( $_GET['activate'] );
140
- }
141
-
142
- return;
143
- }
144
-
145
- register_activation_hook( $this->basename(), array( $this, 'activate' ) );
146
-
147
- if ( is_multisite() && is_plugin_active_for_network( $this->basename() ) ) {
148
- add_action( 'wpmu_options', array( $this, 'wpmu_options' ) );
149
- add_action( 'update_wpmu_options', array( $this, 'update_wpmu_options' ) );
150
-
151
- add_filter( 'network_admin_plugin_action_links_' . $this->basename(), array(
152
- $this,
153
- 'plugin_action_links'
154
- ) );
155
- }
156
-
157
- add_action( 'admin_init', array( $this, 'admin_init' ) );
158
- add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 2 );
159
- add_action( 'admin_notices', array( $this, 'admin_notices' ) );
160
- add_action( 'network_admin_notices', array( $this, 'admin_notices' ) );
161
- add_action( 'wp_loaded', array( $this, 'wp_loaded' ) );
162
- add_action( 'setup_theme', array( $this, 'setup_theme' ), 1 );
163
-
164
- add_filter( 'plugin_action_links_' . $this->basename(), array( $this, 'plugin_action_links' ) );
165
- add_filter( 'site_url', array( $this, 'site_url' ), 10, 4 );
166
- add_filter( 'network_site_url', array( $this, 'network_site_url' ), 10, 3 );
167
- add_filter( 'wp_redirect', array( $this, 'wp_redirect' ), 10, 2 );
168
- add_filter( 'site_option_welcome_email', array( $this, 'welcome_email' ) );
169
-
170
- remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
171
-
172
- }
173
-
174
- /**
175
- * Return an instance of this class.
176
- *
177
- * @since 1.0.0
178
- *
179
- * @return object A single instance of this class.
180
- */
181
- public static function get_instance() {
182
-
183
- // If the single instance hasn't been set, set it now.
184
- if ( null == self::$instance ) {
185
- self::$instance = new self;
186
- }
187
-
188
- return self::$instance;
189
- }
190
-
191
- public function admin_notices_incompatible() {
192
-
193
- echo '<div class="error notice is-dismissible"><p>' . __( 'Please upgrade to the latest version of WordPress to activate', 'wps-hide-login' ) . ' <strong>' . __( 'WPS Hide Login', 'wps-hide-login' ) . '</strong>.</p></div>';
194
-
195
- }
196
-
197
- public function admin_notices_plugin_conflict() {
198
-
199
- echo '<div class="error notice is-dismissible"><p>' . __( 'WPS Hide Login could not be activated because you already have Rename wp-login.php active. Please uninstall rename wp-login.php to use WPS Hide Login', 'wps-hide-login' ) . '</p></div>';
200
-
201
- }
202
-
203
- public function activate() {
204
-
205
- add_option( 'whl_redirect', '1' );
206
-
207
- delete_option( 'whl_admin' );
208
-
209
- }
210
-
211
- public function wpmu_options() {
212
-
213
- $out = '';
214
-
215
- $out .= '<h3>' . __( 'WPS Hide Login', 'wps-hide-login' ) . '</h3>';
216
- $out .= '<p>' . __( 'This option allows you to set a networkwide default, which can be overridden by individual sites. Simply go to to the site’s permalink settings to change the url.', 'wps-hide-login' ) . '</p>';
217
- $out .= '<p>' . sprintf( __( 'Need help? Try the <a href="%1$s" target="_blank">support forum</a>. This plugin is kindly brought to you by <a href="%2$s" target="_blank">WPServeur</a>.', 'wps-hide-login' ), 'http://wordpress.org/support/plugin/wps-hide-login/', 'https://www.wpserveur.net' ) . '</p>';
218
- $out .= '<table class="form-table">';
219
- $out .= '<tr valign="top">';
220
- $out .= '<th scope="row"><label for="whl_page">' . __( 'Networkwide default', 'wps-hide-login' ) . '</label></th>';
221
- $out .= '<td><input id="whl_page" type="text" name="whl_page" value="' . esc_attr( get_site_option( 'whl_page', 'login' ) ) . '"></td>';
222
- $out .= '</tr>';
223
- $out .= '</table>';
224
-
225
- echo $out;
226
-
227
- }
228
-
229
- public function update_wpmu_options() {
230
- if ( check_admin_referer( 'siteoptions' ) ) {
231
- if ( ( $whl_page = sanitize_title_with_dashes( $_POST['whl_page'] ) )
232
- && strpos( $whl_page, 'wp-login' ) === false
233
- && ! in_array( $whl_page, $this->forbidden_slugs() ) ) {
234
-
235
- update_site_option( 'whl_page', $whl_page );
236
-
237
- }
238
- }
239
- }
240
-
241
- public function admin_init() {
242
-
243
- global $pagenow;
244
-
245
- add_settings_section(
246
- 'wps-hide-login-section',
247
- 'WPS Hide Login',
248
- array( $this, 'whl_section_desc' ),
249
- 'general'
250
- );
251
-
252
- add_settings_field(
253
- 'whl_page',
254
- '<label for="whl_page">' . __( 'Login url', 'wps-hide-login' ) . '</label>',
255
- array( $this, 'whl_page_input' ),
256
- 'general',
257
- 'wps-hide-login-section'
258
- );
259
-
260
- register_setting( 'general', 'whl_page', 'sanitize_title_with_dashes' );
261
-
262
- if ( get_option( 'whl_redirect' ) ) {
263
-
264
- delete_option( 'whl_redirect' );
265
-
266
- if ( is_multisite()
267
- && is_super_admin()
268
- && is_plugin_active_for_network( $this->basename() ) ) {
269
-
270
- $redirect = network_admin_url( 'settings.php#whl-page-input' );
271
-
272
- } else {
273
-
274
- $redirect = admin_url( 'options-general.php#whl-page-input' );
275
-
276
- }
277
-
278
- wp_safe_redirect( $redirect );
279
-
280
- die;
281
-
282
- }
283
-
284
- }
285
-
286
- public function whl_section_desc() {
287
-
288
- $out = '';
289
-
290
- if ( ! is_multisite()
291
- || is_super_admin() ) {
292
-
293
- $out .= '<p>' . sprintf( __( 'Need help? Try the <a href="%1$s" target="_blank">support forum</a>. This plugin is kindly brought to you by <a href="%2$s" target="_blank">WPServeur</a>.', 'wps-hide-login' ), 'http://wordpress.org/support/plugin/wps-hide-login/', 'https://www.wpserveur.net' ) . '</p>';
294
-
295
- }
296
-
297
- if ( is_multisite()
298
- && is_super_admin()
299
- && is_plugin_active_for_network( $this->basename() ) ) {
300
-
301
- $out .= '<p>' . sprintf( __( 'To set a networkwide default, go to <a href="%s">Network Settings</a>.', 'wps-hide-login' ), network_admin_url( 'settings.php#whl-page-input' ) ) . '</p>';
302
-
303
- }
304
-
305
- echo $out;
306
-
307
- }
308
-
309
- public function whl_page_input() {
310
-
311
- if ( get_option( 'permalink_structure' ) ) {
312
-
313
- echo '<code>' . trailingslashit( home_url() ) . '</code> <input id="whl_page" type="text" name="whl_page" value="' . $this->new_login_slug() . '">' . ( $this->use_trailing_slashes() ? ' <code>/</code>' : '' );
314
-
315
- } else {
316
-
317
- echo '<code>' . trailingslashit( home_url() ) . '?</code> <input id="whl_page" type="text" name="whl_page" value="' . $this->new_login_slug() . '">';
318
-
319
- }
320
-
321
- }
322
-
323
- public function admin_notices() {
324
-
325
- global $pagenow;
326
-
327
- $out = '';
328
-
329
- if ( ! is_network_admin()
330
- && $pagenow === 'options-general.php'
331
- && isset( $_GET['settings-updated'] )
332
- && ! isset( $_GET['page'] ) ) {
333
-
334
- echo '<div class="updated notice is-dismissible"><p>' . sprintf( __( 'Your login page is now here: <strong><a href="%1$s">%2$s</a></strong>. Bookmark this page!', 'wps-hide-login' ), $this->new_login_url(), $this->new_login_url() ) . '</p></div>';
335
-
336
- }
337
-
338
- }
339
-
340
- public function plugin_action_links( $links ) {
341
-
342
- if ( is_network_admin()
343
- && is_plugin_active_for_network( $this->basename() ) ) {
344
-
345
- array_unshift( $links, '<a href="' . network_admin_url( 'settings.php#whl-page-input' ) . '">' . __( 'Settings', 'wps-hide-login' ) . '</a>' );
346
-
347
- } elseif ( ! is_network_admin() ) {
348
-
349
- array_unshift( $links, '<a href="' . admin_url( 'options-general.php#whl-page-input' ) . '">' . __( 'Settings', 'wps-hide-login' ) . '</a>' );
350
-
351
- }
352
-
353
- return $links;
354
-
355
- }
356
-
357
- public function plugins_loaded() {
358
-
359
- global $pagenow;
360
-
361
- if ( ! is_multisite()
362
- && ( strpos( $_SERVER['REQUEST_URI'], 'wp-signup' ) !== false
363
- || strpos( $_SERVER['REQUEST_URI'], 'wp-activate' ) ) !== false ) {
364
-
365
- wp_die( __( 'This feature is not enabled.', 'wps-hide-login' ) );
366
-
367
- }
368
-
369
- $request = parse_url( $_SERVER['REQUEST_URI'] );
370
-
371
- if ( ( strpos( rawurldecode( $_SERVER['REQUEST_URI'] ), 'wp-login.php' ) !== false
372
- || untrailingslashit( $request['path'] ) === site_url( 'wp-login', 'relative' ) )
373
- && ! is_admin() ) {
374
-
375
- $this->wp_login_php = true;
376
-
377
- $_SERVER['REQUEST_URI'] = $this->user_trailingslashit( '/' . str_repeat( '-/', 10 ) );
378
-
379
- $pagenow = 'index.php';
380
-
381
- } elseif ( untrailingslashit( $request['path'] ) === home_url( $this->new_login_slug(), 'relative' )
382
- || ( ! get_option( 'permalink_structure' )
383
- && isset( $_GET[ $this->new_login_slug() ] )
384
- && empty( $_GET[ $this->new_login_slug() ] ) ) ) {
385
-
386
- $pagenow = 'wp-login.php';
387
-
388
- }
389
-
390
- }
391
-
392
- public function setup_theme() {
393
- global $pagenow;
394
-
395
- if ( ! is_user_logged_in() && 'customize.php' === $pagenow ) {
396
- wp_die( __( 'This has been disabled', 'wps-hide-login' ), 403 );
397
- }
398
- }
399
-
400
- public function wp_loaded() {
401
-
402
- global $pagenow;
403
-
404
- if ( is_admin() && ! is_user_logged_in() && ! defined( 'DOING_AJAX' ) && $pagenow !== 'admin-post.php' ) {
405
- wp_die( __( 'This has been disabled', 'wps-hide-login' ), 403 );
406
- }
407
-
408
- $request = parse_url( $_SERVER['REQUEST_URI'] );
409
-
410
- if ( $pagenow === 'wp-login.php'
411
- && $request['path'] !== $this->user_trailingslashit( $request['path'] )
412
- && get_option( 'permalink_structure' ) ) {
413
-
414
- wp_safe_redirect( $this->user_trailingslashit( $this->new_login_url() )
415
- . ( ! empty( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '' ) );
416
-
417
- die;
418
-
419
- } elseif ( $this->wp_login_php ) {
420
-
421
- if ( ( $referer = wp_get_referer() )
422
- && strpos( $referer, 'wp-activate.php' ) !== false
423
- && ( $referer = parse_url( $referer ) )
424
- && ! empty( $referer['query'] ) ) {
425
-
426
- parse_str( $referer['query'], $referer );
427
-
428
- if ( ! empty( $referer['key'] )
429
- && ( $result = wpmu_activate_signup( $referer['key'] ) )
430
- && is_wp_error( $result )
431
- && ( $result->get_error_code() === 'already_active'
432
- || $result->get_error_code() === 'blog_taken' ) ) {
433
-
434
- wp_safe_redirect( $this->new_login_url()
435
- . ( ! empty( $_SERVER['QUERY_STRING'] ) ? '?' . $_SERVER['QUERY_STRING'] : '' ) );
436
-
437
- die;
438
-
439
- }
440
-
441
- }
442
-
443
- $this->wp_template_loader();
444
-
445
- } elseif ( $pagenow === 'wp-login.php' ) {
446
- global $error, $interim_login, $action, $user_login;
447
-
448
- if ( is_user_logged_in() && ! isset( $_REQUEST['action'] ) ) {
449
- wp_safe_redirect( admin_url() );
450
- die();
451
- }
452
-
453
- @require_once ABSPATH . 'wp-login.php';
454
-
455
- die;
456
-
457
- }
458
-
459
- }
460
-
461
- public function site_url( $url, $path, $scheme, $blog_id ) {
462
-
463
- return $this->filter_wp_login_php( $url, $scheme );
464
-
465
- }
466
-
467
- public function network_site_url( $url, $path, $scheme ) {
468
-
469
- return $this->filter_wp_login_php( $url, $scheme );
470
-
471
- }
472
-
473
- public function wp_redirect( $location, $status ) {
474
-
475
- return $this->filter_wp_login_php( $location );
476
-
477
- }
478
-
479
- public function filter_wp_login_php( $url, $scheme = null ) {
480
-
481
- if ( strpos( $url, 'wp-login.php' ) !== false ) {
482
-
483
- if ( is_ssl() ) {
484
-
485
- $scheme = 'https';
486
-
487
- }
488
-
489
- $args = explode( '?', $url );
490
-
491
- if ( isset( $args[1] ) ) {
492
-
493
- parse_str( $args[1], $args );
494
-
495
- $url = add_query_arg( $args, $this->new_login_url( $scheme ) );
496
-
497
- } else {
498
-
499
- $url = $this->new_login_url( $scheme );
500
-
501
- }
502
-
503
- }
504
-
505
- return $url;
506
-
507
- }
508
 
509
- public function welcome_email( $value ) {
 
 
510
 
511
- return $value = str_replace( 'wp-login.php', trailingslashit( get_site_option( 'whl_page', 'login' ) ), $value );
 
 
512
 
 
 
 
 
 
513
  }
 
 
514
 
515
- public function forbidden_slugs() {
516
-
517
- $wp = new WP;
518
-
519
- return array_merge( $wp->public_query_vars, $wp->private_query_vars );
520
 
521
- }
 
 
 
522
 
523
- public function whl_load_textdomain() {
524
- load_plugin_textdomain( 'wps-hide-login', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
525
- }
526
 
527
- }
 
 
528
 
529
- add_action( 'plugins_loaded', array( 'WPS_Hide_Login', 'get_instance' ), 1 );
530
- }
1
  <?php
2
  /*
3
  Plugin Name: WPS Hide Login
 
4
  Description: Protect your website by changing the login URL and preventing access to wp-login.php page and wp-admin directory while not logged-in
5
+ Author: WPServeur, NicolasKulka, tabrisrp
6
+ Version: 1.2.3
 
7
  Requires at least: 4.1
8
  Tested up to: 4.9
 
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
12
 
13
+ // don't load directly
14
+ if ( ! defined( 'ABSPATH' ) ) {
15
+ die( '-1' );
16
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
+ // Plugin constants
19
+ define( 'WPS_HIDE_LOGIN_VERSION', '1.2.3' );
20
+ define( 'WPS_HIDE_LOGIN_FOLDER', 'wps-hide-login' );
21
 
22
+ define( 'WPS_HIDE_LOGIN_URL', plugin_dir_url( __FILE__ ) );
23
+ define( 'WPS_HIDE_LOGIN_DIR', plugin_dir_path( __FILE__ ) );
24
+ define( 'WPS_HIDE_LOGIN_BASENAME', plugin_basename( __FILE__ ) );
25
 
26
+ // Function for easy load files
27
+ function wps_hide_login_load_files( $dir, $files, $prefix = '' ) {
28
+ foreach ( $files as $file ) {
29
+ if ( is_file( $dir . $prefix . $file . '.php' ) ) {
30
+ require_once( $dir . $prefix . $file . '.php' );
31
  }
32
+ }
33
+ }
34
 
35
+ wps_hide_login_load_files( WPS_HIDE_LOGIN_DIR . '3rd-party/', array(
36
+ '3rd-party'
37
+ ) );
 
 
38
 
39
+ // Plugin client classes
40
+ wps_hide_login_load_files( WPS_HIDE_LOGIN_DIR . 'classes/', array(
41
+ 'plugin',
42
+ ) );
43
 
44
+ register_activation_hook( __FILE__, array( 'WPS_Hide_Login', 'activate' ) );
 
 
45
 
46
+ add_action( 'plugins_loaded', 'plugins_loaded_wps_hide_login_plugin' );
47
+ function plugins_loaded_wps_hide_login_plugin() {
48
+ new WPS_Hide_Login;
49
 
50
+ load_plugin_textdomain( 'wpserveur-hide-login', false, dirname( WPS_HIDE_LOGIN_BASENAME ) . '/languages' );
51
+ }