Version Description
- Update WordPress API settings
Download this release
Release Info
Developer | nunosarmento |
Plugin | Change wp-admin login |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.9 to 1.1.0
- change-wp-admin-login.php +16 -13
- includes/class-change-wp-admin-login.php +18 -16
- readme.txt +21 -7
change-wp-admin-login.php
CHANGED
@@ -3,27 +3,30 @@
|
|
3 |
Plugin Name: Change wp-admin login
|
4 |
Plugin URI: https://wordpress.org/plugins/change-wp-admin-login/
|
5 |
Description: Change wp-admin login to whatever you want. example: http://www.example.com/my-login. Go under Settings and then click on "Permalinks" and change your URL under "Change wp-admin login".
|
6 |
-
Version: 1.0
|
7 |
Author: Nuno Morais Sarmento
|
8 |
Author URI: https://www.nuno-sarmento.com
|
9 |
Text Domain: change-wp-admin-login
|
10 |
Domain Path: /languages
|
11 |
-
License: GPL2
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
23 |
|
24 |
-
You should have received a copy of the GNU General Public License
|
25 |
-
along with this program; if not, write to the Free Software
|
26 |
-
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
27 |
*/
|
28 |
|
29 |
/* Do not access this file directly */
|
3 |
Plugin Name: Change wp-admin login
|
4 |
Plugin URI: https://wordpress.org/plugins/change-wp-admin-login/
|
5 |
Description: Change wp-admin login to whatever you want. example: http://www.example.com/my-login. Go under Settings and then click on "Permalinks" and change your URL under "Change wp-admin login".
|
6 |
+
Version: 1.1.0
|
7 |
Author: Nuno Morais Sarmento
|
8 |
Author URI: https://www.nuno-sarmento.com
|
9 |
Text Domain: change-wp-admin-login
|
10 |
Domain Path: /languages
|
|
|
11 |
|
12 |
+
Copyright 2022 Nuno Sarmento (email : hello@nuno-sarmento.com)
|
13 |
+
This program is free software; you can redistribute it and/or modify
|
14 |
+
it under the terms of the GNU General Public License as published by
|
15 |
+
the Free Software Foundation; either version 2 of the License, or
|
16 |
+
(at your option) any later version.
|
17 |
|
18 |
+
This program is distributed in the hope that it will be useful,
|
19 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
20 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
21 |
+
GNU General Public License for more details.
|
22 |
|
23 |
+
You should have received a copy of the GNU General Public License
|
24 |
+
along with this program; if not, write to the Free Software
|
25 |
+
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
26 |
+
|
27 |
+
// Acknowledgements to Ella van Durpe (https://wordpress.org/plugins/rename-wp-login/), some of whose code was used
|
28 |
+
// in the development of this plug-in. This plugin (https://wordpress.org/plugins/rename-wp-login/) don't have any copyright policy.
|
29 |
|
|
|
|
|
|
|
30 |
*/
|
31 |
|
32 |
/* Do not access this file directly */
|
includes/class-change-wp-admin-login.php
CHANGED
@@ -186,20 +186,21 @@ if ( defined( 'ABSPATH' ) && ! class_exists( 'Change_WP_Admin_Login' ) ) {
|
|
186 |
'change-wp-admin-login-section'
|
187 |
);
|
188 |
|
189 |
-
register_setting( 'permalink','rwl_page_input');
|
190 |
-
register_setting( 'permalink','rwl_redirect_field');
|
191 |
|
|
|
|
|
192 |
|
193 |
-
if( isset($_POST['
|
194 |
-
|
195 |
-
|
196 |
-
|
|
|
197 |
|
198 |
if( isset($_POST['permalink_structure']) && isset( $_POST['rwl_page'] ) ){
|
199 |
if (
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
) {
|
204 |
if ( is_multisite() && $rwl_page === get_site_option( 'rwl_page', 'login' ) ) {
|
205 |
delete_option( 'rwl_page' );
|
@@ -209,20 +210,21 @@ if ( defined( 'ABSPATH' ) && ! class_exists( 'Change_WP_Admin_Login' ) ) {
|
|
209 |
}
|
210 |
}
|
211 |
|
212 |
-
|
213 |
if ( get_option( 'rwl_redirect' ) ) {
|
214 |
-
|
215 |
|
216 |
-
|
217 |
$redirect = network_admin_url( 'settings.php#rwl-page-input' );
|
218 |
-
|
219 |
$redirect = admin_url( 'options-permalink.php#rwl-page-input' );
|
220 |
-
|
221 |
|
222 |
-
|
223 |
|
224 |
-
|
|
|
225 |
}
|
|
|
226 |
}
|
227 |
|
228 |
public function rwl_section_desc() {
|
186 |
'change-wp-admin-login-section'
|
187 |
);
|
188 |
|
|
|
|
|
189 |
|
190 |
+
register_setting( 'permalink','rwl_page_input');
|
191 |
+
register_setting( 'permalink','rwl_redirect_field');
|
192 |
|
193 |
+
if (current_user_can('manage_options') && isset($_POST['_wpnonce']) && wp_verify_nonce($_POST['_wpnonce'], 'update-permalink')) {
|
194 |
+
if( isset($_POST['permalink_structure']) && isset( $_POST['rwl_redirect_field'] ) ){
|
195 |
+
$short_domain = sanitize_title_with_dashes(wp_unslash( $_POST['rwl_redirect_field'] ));
|
196 |
+
update_option( 'rwl_redirect_field', $short_domain );
|
197 |
+
}
|
198 |
|
199 |
if( isset($_POST['permalink_structure']) && isset( $_POST['rwl_page'] ) ){
|
200 |
if (
|
201 |
+
( $rwl_page = sanitize_title_with_dashes( $_POST['rwl_page'] ) ) &&
|
202 |
+
strpos( $rwl_page, 'wp-login' ) === false &&
|
203 |
+
! in_array( $rwl_page, $this->forbidden_slugs() )
|
204 |
) {
|
205 |
if ( is_multisite() && $rwl_page === get_site_option( 'rwl_page', 'login' ) ) {
|
206 |
delete_option( 'rwl_page' );
|
210 |
}
|
211 |
}
|
212 |
|
|
|
213 |
if ( get_option( 'rwl_redirect' ) ) {
|
214 |
+
delete_option( 'rwl_redirect' );
|
215 |
|
216 |
+
if ( is_multisite() && is_super_admin() && is_plugin_active_for_network( $this->basename() ) ) {
|
217 |
$redirect = network_admin_url( 'settings.php#rwl-page-input' );
|
218 |
+
} else {
|
219 |
$redirect = admin_url( 'options-permalink.php#rwl-page-input' );
|
220 |
+
}
|
221 |
|
222 |
+
wp_safe_redirect( $redirect );
|
223 |
|
224 |
+
die;
|
225 |
+
}
|
226 |
}
|
227 |
+
|
228 |
}
|
229 |
|
230 |
public function rwl_section_desc() {
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Tags: change wp-login, rename wp-login, wp-admin, login, wp-login,
|
|
3 |
Contributors: nunosarmento
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 6.0
|
6 |
-
Stable tag: 1.0
|
7 |
License: GPL-2.0+
|
8 |
|
9 |
|
@@ -11,9 +11,22 @@ License: GPL-2.0+
|
|
11 |
|
12 |
*Change wp-admin login* is a light plugin that allows you easily and safely to change wp-admin to anything you want. It does not rename or change files in core. It simply intercepts page requests and works on any WordPress website. After you activate this plugin the wp-admin directory and wp-login.php page will become unavailable, so you should bookmark or remember the url. Disable this plugin brings your site back exactly to the state it was before.
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
Go under Settings and then click on "Permalinks" and change your URL under "Change wp-admin login".
|
15 |
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
== New Feature ==
|
19 |
|
@@ -21,13 +34,11 @@ Add redirect custom field:
|
|
21 |
|
22 |
When someone tries to access the wp-login.php page or the wp-admin directory while not logged in will be redirect to the page that you defined on the redirect custom field.
|
23 |
|
24 |
-
If you leave the redirect field empty the plugin will add a redirect to the homepage.
|
25 |
-
|
26 |
-
== How to use the plugin ==
|
27 |
|
28 |
-
|
29 |
|
30 |
-
|
31 |
|
32 |
|
33 |
== Installation ==
|
@@ -103,3 +114,6 @@ No, BuddyPress has their own wp-admin redirect functions.
|
|
103 |
|
104 |
= 1.0.9 =
|
105 |
* fix security issue
|
|
|
|
|
|
3 |
Contributors: nunosarmento
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 6.0
|
6 |
+
Stable tag: 1.1.0
|
7 |
License: GPL-2.0+
|
8 |
|
9 |
|
11 |
|
12 |
*Change wp-admin login* is a light plugin that allows you easily and safely to change wp-admin to anything you want. It does not rename or change files in core. It simply intercepts page requests and works on any WordPress website. After you activate this plugin the wp-admin directory and wp-login.php page will become unavailable, so you should bookmark or remember the url. Disable this plugin brings your site back exactly to the state it was before.
|
13 |
|
14 |
+
|
15 |
+
== Support ==
|
16 |
+
|
17 |
+
**Like this plugin?** Please [Rate It](https://wordpress.org/support/plugin/change-wp-admin-login/reviews/?filter=5) or [Buy me a coffee](https://ko-fi.com/nunosarmento)
|
18 |
+
|
19 |
+
**Have a problem?** Please write a message in the [WordPress Support Forum](https://wordpress.org/support/plugin/change-wp-admin-login/)
|
20 |
+
|
21 |
+
|
22 |
+
== How to use the plugin ==
|
23 |
+
|
24 |
Go under Settings and then click on "Permalinks" and change your URL under "Change wp-admin login".
|
25 |
|
26 |
+
Step 1: Add new login URL
|
27 |
+
|
28 |
+
Step 2: Add redirect URL
|
29 |
+
|
30 |
|
31 |
== New Feature ==
|
32 |
|
34 |
|
35 |
When someone tries to access the wp-login.php page or the wp-admin directory while not logged in will be redirect to the page that you defined on the redirect custom field.
|
36 |
|
37 |
+
If you leave the redirect field empty the plugin will add a default redirect to the homepage.
|
|
|
|
|
38 |
|
39 |
+
== Credits ==
|
40 |
|
41 |
+
This plugin was forked/adapted/fixed/updated from this plugin https://wordpress.org/plugins/rename-wp-login/ - @ellatrix thank you for starting the base of my plugin.
|
42 |
|
43 |
|
44 |
== Installation ==
|
114 |
|
115 |
= 1.0.9 =
|
116 |
* fix security issue
|
117 |
+
|
118 |
+
= 1.1.0 =
|
119 |
+
* Update WordPress API settings
|