Rename wp-login.php - Version 2.2.4

Version Description

  • Fixed SSL issues.
  • Set REQUEST_URI back.
  • Check if wp-login.php functions exist to avoid future fatal errors.
Download this release

Release Info

Developer avryl
Plugin Icon 128x128 Rename wp-login.php
Version 2.2.4
Comparing to
See all releases

Code changes from version 2.2.3 to 2.2.4

Files changed (3) hide show
  1. readme.md +7 -1
  2. readme.txt +7 -1
  3. rename-wp-login.php +34 -17
readme.md CHANGED
@@ -4,7 +4,7 @@
4
  **Tags:** rename, login, wp-login, wp-login.php, brute force attacks, custom login url, security
5
  **Requires at least:** 3.8
6
  **Tested up to:** 3.8.1
7
- **Stable tag:** 2.2.3
8
  **License:** GPLv2 or later
9
  **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -55,6 +55,12 @@ Either go to your MySQL database and look for the value of `rwl_page` in the opt
55
 
56
  ## Changelog
57
 
 
 
 
 
 
 
58
  ### 2.2.3
59
 
60
  * Fixed URL filters.
4
  **Tags:** rename, login, wp-login, wp-login.php, brute force attacks, custom login url, security
5
  **Requires at least:** 3.8
6
  **Tested up to:** 3.8.1
7
+ **Stable tag:** 2.2.4
8
  **License:** GPLv2 or later
9
  **License URI:** http://www.gnu.org/licenses/gpl-2.0.html
10
 
55
 
56
  ## Changelog
57
 
58
+ ### 2.2.4
59
+
60
+ * Fixed SSL issues.
61
+ * Set REQUEST_URI back.
62
+ * Check if wp-login.php functions exist to avoid future fatal errors.
63
+
64
  ### 2.2.3
65
 
66
  * Fixed URL filters.
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
5
  Tags: rename, login, wp-login, wp-login.php, brute force attacks, custom login url, security
6
  Requires at least: 3.8
7
  Tested up to: 3.8.1
8
- Stable tag: 2.2.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -60,6 +60,12 @@ Either go to your MySQL database and look for the value of `rwl_page` in the opt
60
 
61
  == Changelog ==
62
 
 
 
 
 
 
 
63
  = 2.2.3 =
64
 
65
  * Fixed URL filters.
5
  Tags: rename, login, wp-login, wp-login.php, brute force attacks, custom login url, security
6
  Requires at least: 3.8
7
  Tested up to: 3.8.1
8
+ Stable tag: 2.2.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
60
 
61
  == Changelog ==
62
 
63
+ = 2.2.4 =
64
+
65
+ * Fixed SSL issues.
66
+ * Set REQUEST_URI back.
67
+ * Check if wp-login.php functions exist to avoid future fatal errors.
68
+
69
  = 2.2.3 =
70
 
71
  * Fixed URL filters.
rename-wp-login.php CHANGED
@@ -6,14 +6,19 @@ Plugin URI: http://wordpress.org/plugins/rename-wp-login/
6
  Description: Change wp-login.php to whatever you want. It can also prevent a lot of brute force attacks.
7
  Author: avryl
8
  Author URI: http://profiles.wordpress.org/avryl/
9
- Version: 2.2.3
10
  Text Domain: rename-wp-login
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
  */
14
 
15
- if ( ! class_exists( 'Rename_WP_Login' )
16
- && defined( 'ABSPATH' ) ) {
 
 
 
 
 
17
 
18
  class Rename_WP_Login {
19
 
@@ -59,8 +64,14 @@ if ( ! class_exists( 'Rename_WP_Login' )
59
 
60
  wp();
61
 
 
 
 
 
 
 
62
  require_once( ABSPATH . WPINC . '/template-loader.php' );
63
-
64
  die;
65
 
66
  }
@@ -79,17 +90,17 @@ if ( ! class_exists( 'Rename_WP_Login' )
79
 
80
  }
81
 
82
- public function new_login_url() {
83
 
84
  if ( get_option( 'permalink_structure' ) ) {
85
 
86
- return $this->user_trailingslashit( trailingslashit( home_url() ) . $this->new_login_slug() );
87
 
88
  }
89
 
90
  else {
91
 
92
- return trailingslashit( home_url() ) . '?' . $this->new_login_slug();
93
 
94
  }
95
 
@@ -133,7 +144,7 @@ if ( ! class_exists( 'Rename_WP_Login' )
133
  add_action( 'update_wpmu_options', array( $this, 'update_wpmu_options' ) );
134
 
135
  }
136
-
137
  add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 1 );
138
  add_action( 'wp_loaded', array( $this, 'wp_loaded' ) );
139
 
@@ -317,7 +328,7 @@ if ( ! class_exists( 'Rename_WP_Login' )
317
  }
318
 
319
  public function rwl_page_input() {
320
-
321
  if ( get_option( 'permalink_structure' ) ) {
322
 
323
  echo '<code>' . trailingslashit( home_url() ) . '</code> <input id="rwl-page-input" type="text" name="rwl_page" value="' . $this->new_login_slug() . '">' . ( $this->use_trailing_slashes() ? ' <code>/</code>' : '' );
@@ -410,9 +421,9 @@ if ( ! class_exists( 'Rename_WP_Login' )
410
  && ! is_admin() ) {
411
 
412
  $this->wp_login_php = true;
413
-
414
- $_SERVER['REQUEST_URI'] = str_repeat( '-/', 10 );
415
-
416
  $pagenow = 'index.php';
417
 
418
  }
@@ -494,13 +505,13 @@ if ( ! class_exists( 'Rename_WP_Login' )
494
 
495
  public function site_url( $url, $path, $scheme, $blog_id ) {
496
 
497
- return $this->filter_wp_login_php( $url );
498
 
499
  }
500
 
501
  public function network_site_url( $url, $path, $scheme ) {
502
 
503
- return $this->filter_wp_login_php( $url );
504
 
505
  }
506
 
@@ -510,23 +521,29 @@ if ( ! class_exists( 'Rename_WP_Login' )
510
 
511
  }
512
 
513
- public function filter_wp_login_php( $url ) {
514
 
515
  if ( strpos( $url, 'wp-login.php' ) !== false ) {
516
 
 
 
 
 
 
 
517
  $args = explode( '?', $url );
518
 
519
  if ( isset( $args[1] ) ) {
520
 
521
  parse_str( $args[1], $args );
522
 
523
- $url = add_query_arg( $args, $this->new_login_url() );
524
 
525
  }
526
 
527
  else {
528
 
529
- $url = $this->new_login_url();
530
 
531
  }
532
 
6
  Description: Change wp-login.php to whatever you want. It can also prevent a lot of brute force attacks.
7
  Author: avryl
8
  Author URI: http://profiles.wordpress.org/avryl/
9
+ Version: 2.2.4
10
  Text Domain: rename-wp-login
11
  License: GPLv2 or later
12
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
  */
14
 
15
+ if ( defined( 'ABSPATH' )
16
+ && ! class_exists( 'Rename_WP_Login' )
17
+ && ! function_exists( 'login_header' )
18
+ && ! function_exists( 'login_footer' )
19
+ && ! function_exists( 'wp_shake_js' )
20
+ && ! function_exists( 'wp_login_viewport_meta' )
21
+ && ! function_exists( 'retrieve_password' ) ) {
22
 
23
  class Rename_WP_Login {
24
 
64
 
65
  wp();
66
 
67
+ if ( $_SERVER['REQUEST_URI'] === str_repeat( '*', 10 ) ) {
68
+
69
+ $_SERVER['REQUEST_URI'] = 'wp-login.php';
70
+
71
+ }
72
+
73
  require_once( ABSPATH . WPINC . '/template-loader.php' );
74
+
75
  die;
76
 
77
  }
90
 
91
  }
92
 
93
+ public function new_login_url( $scheme ) {
94
 
95
  if ( get_option( 'permalink_structure' ) ) {
96
 
97
+ return $this->user_trailingslashit( home_url( '/', $scheme ) . $this->new_login_slug() );
98
 
99
  }
100
 
101
  else {
102
 
103
+ return home_url( '/', $scheme ) . '?' . $this->new_login_slug();
104
 
105
  }
106
 
144
  add_action( 'update_wpmu_options', array( $this, 'update_wpmu_options' ) );
145
 
146
  }
147
+
148
  add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 1 );
149
  add_action( 'wp_loaded', array( $this, 'wp_loaded' ) );
150
 
328
  }
329
 
330
  public function rwl_page_input() {
331
+
332
  if ( get_option( 'permalink_structure' ) ) {
333
 
334
  echo '<code>' . trailingslashit( home_url() ) . '</code> <input id="rwl-page-input" type="text" name="rwl_page" value="' . $this->new_login_slug() . '">' . ( $this->use_trailing_slashes() ? ' <code>/</code>' : '' );
421
  && ! is_admin() ) {
422
 
423
  $this->wp_login_php = true;
424
+
425
+ $_SERVER['REQUEST_URI'] = str_repeat( '*', 10 );
426
+
427
  $pagenow = 'index.php';
428
 
429
  }
505
 
506
  public function site_url( $url, $path, $scheme, $blog_id ) {
507
 
508
+ return $this->filter_wp_login_php( $url, $scheme );
509
 
510
  }
511
 
512
  public function network_site_url( $url, $path, $scheme ) {
513
 
514
+ return $this->filter_wp_login_php( $url, $scheme );
515
 
516
  }
517
 
521
 
522
  }
523
 
524
+ public function filter_wp_login_php( $url, $scheme = null ) {
525
 
526
  if ( strpos( $url, 'wp-login.php' ) !== false ) {
527
 
528
+ if ( is_ssl() ) {
529
+
530
+ $scheme = 'https';
531
+
532
+ }
533
+
534
  $args = explode( '?', $url );
535
 
536
  if ( isset( $args[1] ) ) {
537
 
538
  parse_str( $args[1], $args );
539
 
540
+ $url = add_query_arg( $args, $this->new_login_url( $scheme ) );
541
 
542
  }
543
 
544
  else {
545
 
546
+ $url = $this->new_login_url( $scheme );
547
 
548
  }
549