Protect Your Admin - Version 1.3

Version Description

  • Added an option for define to admin login page logo
    • Added an option for define to wp-login page background-color
    • Fixed some minor css issues
Download this release

Release Info

Developer india-web-developer
Plugin Icon 128x128 Protect Your Admin
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

Files changed (4) hide show
  1. css/pwa-admin-min.css +1 -1
  2. protect-wp-admin.php +15 -3
  3. pwa-class.php +22 -0
  4. readme.txt +17 -4
css/pwa-admin-min.css CHANGED
@@ -2,4 +2,4 @@
2
  * Protect WP-Admin (C)
3
  * @Raghunath Gurjar
4
  * */
5
- #pwa-tab-menu {width:50%; padding:1%;background: none repeat scroll 0 0 #ccc;}#pwa-tab-menu a {background: none repeat scroll 0 0 #DCA808; border: 0 none;color: #FFFFFF;display: inline-block;font-size: 16px;font-weight: bold;padding: 12px 20px;opacity:0.5;}#pwa-tab-menu a:hover{cursor:pointer;background: none repeat scroll 0 0 #DCA808;opacity:1;}#pwa-tab-menu a.active{ background: none repeat scroll 0 0 #DCA808;opacity:1;}#pwa-settings-form-admin .submit-btn {width: 100%; display: inline-block; padding-top: 10px; margin-top: 10px; border-top: 1px dashed #DCA808;}#pwa-settings-form-admin .submit-btn .button-primary{cursor:pointer;height:35px;}#pwa-settings-form-admin .csbwfs-setting p label {min-width:75px;display:inline-block;}#div-pwa-support img {width:auto; height:auto;}#pwa-settings-form-admin ul {list-style:inside}#pwa-settings-form-admin #div-pwa-support .contact-author{ background: none repeat scroll 0 0 #DC22FF;border: 0 none;color: #FFFFFF;display: inline-block;font-size: 12px; font-weight: bold;padding: 2px 5px;text-decoration: none;}
2
  * Protect WP-Admin (C)
3
  * @Raghunath Gurjar
4
  * */
5
+ #pwa-tab-menu {width:70%; padding:1%;background: none repeat scroll 0 0 #ccc;}#pwa-tab-menu a {background: none repeat scroll 0 0 #DCA808; border: 0 none;color: #FFFFFF;display: inline-block;font-size: 16px;font-weight: bold;padding: 12px 35px;opacity:0.5;}#pwa-tab-menu a:hover{cursor:pointer;background: none repeat scroll 0 0 #DCA808;opacity:1;}#pwa-tab-menu a.active{ background: none repeat scroll 0 0 #DCA808;opacity:1;}#pwa-settings-form-admin .submit-btn {width: 100%; display: inline-block; padding-top: 10px; margin-top: 10px; border-top: 1px dashed #DCA808;}#pwa-settings-form-admin .submit-btn .button-primary{cursor:pointer;height:35px;}#pwa-settings-form-admin .csbwfs-setting p label {min-width:75px;display:inline-block;}#div-pwa-support img {width:auto; height:auto;}#pwa-settings-form-admin ul {list-style:inside}#pwa-settings-form-admin #div-pwa-support .contact-author{ background: none repeat scroll 0 0 #DC22FF;border: 0 none;color: #FFFFFF;display: inline-block;font-size: 12px; font-weight: bold;padding: 2px 5px;text-decoration: none;}
protect-wp-admin.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.mrwebsolution.in/
5
  Description: "protect-wp-admin" is a very help full plugin to make wordpress admin more secure. Protect WP-Admin plugin is provide the options for change the wp-admin url and make the login page private(directly user can't access the login page).
6
  Author: Raghunath
7
  Author URI: http://www.mrwebsolution.in/
8
- Version: 1.2
9
  */
10
 
11
  /*** Copyright 2014 Raghunath (email : raghunath.0087@gmail.com)
@@ -47,6 +47,8 @@ function init_pwa_options_fields(){
47
  register_setting('pwa_setting_options','pwa_restrict');
48
  register_setting('pwa_setting_options','pwa_logout');
49
  register_setting('pwa_setting_options','pwa_allow_custom_users');
 
 
50
  }
51
 
52
 
@@ -82,7 +84,7 @@ function init_pwa_admin_option_page(){
82
  <!-- Start Options Form -->
83
  <form action="options.php" method="post" id="pwa-settings-form-admin">
84
  <input type="hidden" id="check_permalink" value="<?php echo count($tt);?>">
85
- <div id="pwa-tab-menu"><a id="pwa-general" class="pwa-tab-links active" >General</a> <a id="pwa-advance" class="pwa-tab-links">Advance Settings</a> <a id="pwa-support" class="pwa-tab-links">Support</a> </div>
86
 
87
  <div class="pwa-setting">
88
  <!-- General Setting -->
@@ -92,6 +94,13 @@ function init_pwa_admin_option_page(){
92
  <p id="adminurl"><label>Admin Slug: </label><input type="text" id="pwa_rewrite_text" name="pwa_rewrite_text" value="<?php echo esc_attr(get_option('pwa_rewrite_text')); ?>" placeholder="Add New Secure Admin URL Slug ( i.e /myadmin )" size="30"></p>
93
  </div>
94
 
 
 
 
 
 
 
 
95
  <!-- Advance Setting -->
96
  <div class="pwa-tab" id="div-pwa-advance">
97
  <h2>Advance Settings</h2>
@@ -99,9 +108,10 @@ function init_pwa_admin_option_page(){
99
  <p><input type="checkbox" id="pwa_restrict" name="pwa_restrict" value='1' <?php if(get_option('pwa_restrict')!=''){ echo ' checked="checked"'; }?>/> <label>Restrict registered non-admin users from wp-admin :</label></p>
100
  <p><input type="checkbox" id="pwa_logout" name="pwa_logout" value='1' <?php if(get_option('pwa_logout')==''){ echo ''; }else{echo 'checked="checked"';}?>/> <label>Logout Admin After Add/Update New Admin URL(Optional) :</label> (This is only for security purpose)</p>
101
  <p><label>Allow access to non-admin users:</label><input type="text" id="pwa_allow_custom_users" name="pwa_allow_custom_users" value="<?php echo esc_attr(get_option('pwa_allow_custom_users')); ?>" placeholder="1,2,3"> (<i>Add comma seprated ids</i>)</p>
102
-
103
  </div>
104
 
 
105
  <!-- Support -->
106
  <div class="last author pwa-tab" id="div-pwa-support">
107
  <h2>Plugin Support</h2>
@@ -221,6 +231,8 @@ function init_uninstall_pwa_plugins(){
221
  delete_option('pwa_restrict');
222
  delete_option('pwa_logout');
223
  delete_option('pwa_allow_custom_users');
 
 
224
  }
225
  require dirname(__FILE__).'/pwa-class.php';
226
 
5
  Description: "protect-wp-admin" is a very help full plugin to make wordpress admin more secure. Protect WP-Admin plugin is provide the options for change the wp-admin url and make the login page private(directly user can't access the login page).
6
  Author: Raghunath
7
  Author URI: http://www.mrwebsolution.in/
8
+ Version: 1.3
9
  */
10
 
11
  /*** Copyright 2014 Raghunath (email : raghunath.0087@gmail.com)
47
  register_setting('pwa_setting_options','pwa_restrict');
48
  register_setting('pwa_setting_options','pwa_logout');
49
  register_setting('pwa_setting_options','pwa_allow_custom_users');
50
+ register_setting('pwa_setting_options','pwa_logo_path');
51
+ register_setting('pwa_setting_options','pwa_login_page_bg_color');
52
  }
53
 
54
 
84
  <!-- Start Options Form -->
85
  <form action="options.php" method="post" id="pwa-settings-form-admin">
86
  <input type="hidden" id="check_permalink" value="<?php echo count($tt);?>">
87
+ <div id="pwa-tab-menu"><a id="pwa-general" class="pwa-tab-links active" >General</a> <a id="pwa-admin-style" class="pwa-tab-links">Admin Style</a> <a id="pwa-advance" class="pwa-tab-links">Advance Settings</a> <a id="pwa-support" class="pwa-tab-links">Support</a> </div>
88
 
89
  <div class="pwa-setting">
90
  <!-- General Setting -->
94
  <p id="adminurl"><label>Admin Slug: </label><input type="text" id="pwa_rewrite_text" name="pwa_rewrite_text" value="<?php echo esc_attr(get_option('pwa_rewrite_text')); ?>" placeholder="Add New Secure Admin URL Slug ( i.e /myadmin )" size="30"></p>
95
  </div>
96
 
97
+ <!-- Admin Style -->
98
+ <div class="last author pwa-tab" id="div-pwa-admin-style">
99
+ <h2>Admin Style Settings</h2>
100
+ <p id="adminurl"><label>Define Logo Path: </label><input type="text" id="pwa_logo_path" name="pwa_logo_path" value="<?php echo esc_attr(get_option('pwa_logo_path')); ?>" placeholder="Add Custom Logo Image Path" size="30">(<i>Change WordPress Default Login Logo </i>)</p>
101
+ <p id="adminurl"><label>Body Background Color: </label><input type="text" id="pwa_login_page_bg_color" name="pwa_login_page_bg_color" value="<?php echo esc_attr(get_option('pwa_login_page_bg_color')); ?>" placeholder="#444444" size="30"></p>
102
+ </div>
103
+
104
  <!-- Advance Setting -->
105
  <div class="pwa-tab" id="div-pwa-advance">
106
  <h2>Advance Settings</h2>
108
  <p><input type="checkbox" id="pwa_restrict" name="pwa_restrict" value='1' <?php if(get_option('pwa_restrict')!=''){ echo ' checked="checked"'; }?>/> <label>Restrict registered non-admin users from wp-admin :</label></p>
109
  <p><input type="checkbox" id="pwa_logout" name="pwa_logout" value='1' <?php if(get_option('pwa_logout')==''){ echo ''; }else{echo 'checked="checked"';}?>/> <label>Logout Admin After Add/Update New Admin URL(Optional) :</label> (This is only for security purpose)</p>
110
  <p><label>Allow access to non-admin users:</label><input type="text" id="pwa_allow_custom_users" name="pwa_allow_custom_users" value="<?php echo esc_attr(get_option('pwa_allow_custom_users')); ?>" placeholder="1,2,3"> (<i>Add comma seprated ids</i>)</p>
111
+
112
  </div>
113
 
114
+
115
  <!-- Support -->
116
  <div class="last author pwa-tab" id="div-pwa-support">
117
  <h2>Plugin Support</h2>
231
  delete_option('pwa_restrict');
232
  delete_option('pwa_logout');
233
  delete_option('pwa_allow_custom_users');
234
+ delete_option('pwa_logo_path');
235
+ delete_option('pwa_login_page_bg_color');
236
  }
237
  require dirname(__FILE__).'/pwa-class.php';
238
 
pwa-class.php CHANGED
@@ -133,4 +133,26 @@ function pwa_get_current_page_url($s, $use_forwarded_host=false)
133
  {
134
  return pwa_current_path_protocol($s, $use_forwarded_host) . $s['REQUEST_URI'];
135
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  ?>
133
  {
134
  return pwa_current_path_protocol($s, $use_forwarded_host) . $s['REQUEST_URI'];
135
  }
136
+
137
+
138
+ //if(isset($getPwaOptions['pwa_logo_path'])):
139
+
140
+ /* Change Wordpress Default Logo */
141
+ function pwa_update_login_page_logo() {
142
+ $getPwaOptions=get_pwa_setting_options();
143
+
144
+ echo '<style type="text/css"> /* Protect WP-Admin Style*/';
145
+
146
+ if(isset($getPwaOptions['pwa_logo_path']) && $getPwaOptions['pwa_logo_path']!='')
147
+ echo ' h1 a { background-image:url('.$getPwaOptions['pwa_logo_path'].') !important; }';
148
+
149
+ if(isset($getPwaOptions['pwa_login_page_bg_color']) && $getPwaOptions['pwa_login_page_bg_color']!='')
150
+ echo ' body.login-action-login,html{ background:'.$getPwaOptions['pwa_login_page_bg_color'].' !important; height: 100% !important;}';
151
+
152
+ echo '</style>';
153
+
154
+ }
155
+ add_action('login_head', 'pwa_update_login_page_logo');
156
+
157
+
158
  ?>
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
- === Protect WP-Admin ===
2
  Contributors:india-web-developer
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WN785E5V492L4
4
  Tags: Protect WP-Admin,wp-admin,Protect wordpress admin,Secure Admin,Admin,Scure Wordpress Admin,Rename Admin URL, Rename Wordpress Admin URL,Change wp-admin url,Change Admin URL,Change Admin Path,Restrict wp-admin
5
  Requires at least: 3.0
6
  Tested up to: 4.1
7
- Stable tag: 1.2
8
 
9
- Protect Your Website Admin Against Hackers!. Change default Admin URL To Secure Admin URL (i.e http://yourdomain.com/myadmin)
10
 
11
  == Description ==
12
 
@@ -22,11 +22,14 @@ All queries for the classic "/wp-admin/" and "wp-login.php" files will be redire
22
 
23
  The plugin also comes with some access filters, allowing webmasters to restrict guest and registered users access to wp-admin, just in case you want some of your editors to log in the classic way.
24
 
 
 
25
  = Features =
26
 
27
  * Rename/Change wp-admin url to new url (i.e http://yourdomain.com/myadmin)
28
  * Restrict guest users for access to wp-admin
29
  * Restrict registered non-admin users from wp-admin
 
30
 
31
 
32
  == Installation ==
@@ -64,10 +67,20 @@ Don not forgot to update the "newadmin" slug with your new admin slug (that you
64
 
65
  1. screenshot-1.png
66
 
67
- 2. screenshot-2.png
 
 
68
 
 
 
 
69
 
70
  == Changelog ==
 
 
 
 
 
71
 
72
  = 1.2 =
73
  * Added new option for allow admin access to non-admin users
1
+ === Protect Your Admin ===
2
  Contributors:india-web-developer
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WN785E5V492L4
4
  Tags: Protect WP-Admin,wp-admin,Protect wordpress admin,Secure Admin,Admin,Scure Wordpress Admin,Rename Admin URL, Rename Wordpress Admin URL,Change wp-admin url,Change Admin URL,Change Admin Path,Restrict wp-admin
5
  Requires at least: 3.0
6
  Tested up to: 4.1
7
+ Stable tag: 1.3
8
 
9
+ Protect Your Website Admin Against Hackers and Modify Login Page Style
10
 
11
  == Description ==
12
 
22
 
23
  The plugin also comes with some access filters, allowing webmasters to restrict guest and registered users access to wp-admin, just in case you want some of your editors to log in the classic way.
24
 
25
+ You can modify the login page style by change background color and also you can update logo image.
26
+
27
  = Features =
28
 
29
  * Rename/Change wp-admin url to new url (i.e http://yourdomain.com/myadmin)
30
  * Restrict guest users for access to wp-admin
31
  * Restrict registered non-admin users from wp-admin
32
+ * Change Logo and body background color on wp-login page
33
 
34
 
35
  == Installation ==
67
 
68
  1. screenshot-1.png
69
 
70
+ 2. screenshot-2.png
71
+
72
+ 3. screenshot-3.png
73
 
74
+ 4. screenshot-4.png
75
+
76
+ 5. screenshot-5.png
77
 
78
  == Changelog ==
79
+
80
+ = 1.3 =
81
+ * Added an option for define to admin login page logo
82
+ * Added an option for define to wp-login page background-color
83
+ * Fixed some minor css issues
84
 
85
  = 1.2 =
86
  * Added new option for allow admin access to non-admin users