Protect Your Admin - Version 3.0.2

Version Description

  • Tested with new wordpress version 4.9.8
    • Fixed some minor issues
Download this release

Release Info

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

Code changes from version 3.0.1 to 3.0.2

Files changed (5) hide show
  1. css/pwa-admin-min.css +1 -1
  2. lib/hooks.php +2 -1
  3. protect-wp-admin.php +54 -24
  4. pwa-class.php +1 -1
  5. readme.txt +10 -6
css/pwa-admin-min.css CHANGED
@@ -2,4 +2,4 @@
2
  * Protect WP-Admin (C)
3
  * @MR Web Solution
4
  * */
5
- #pwa-tab-menu {width:auto; padding:1%;}#pwa-tab-menu a {background: none repeat scroll 0 0 #DCA808; border: 0 none;color: #FFFFFF;display: inline-block;font-size: 14px;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:50%px; 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
  * @MR Web Solution
4
  * */
5
+ #pwa-tab-menu {width:auto; padding:1%;}#pwa-tab-menu a {background: none repeat scroll 0 0 #DCA808; border: 0 none;color: #FFFFFF;display: inline-block;font-size: 14px;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: #0073aa;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:50%px; 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;}
lib/hooks.php CHANGED
@@ -7,7 +7,8 @@
7
  * Hooks to overide option value before save it into database
8
  * ************************************/
9
  function pwa_update_field_rewrite_text( $new_value, $old_value ) {
10
- $new_value = str_replace('/','-',trim(stripslashes(strip_tags($old_value))));
 
11
  return $new_value;
12
  }
13
  add_filter( 'pre_update_option_pwa_rewrite_text', 'pwa_update_field_rewrite_text', 10, 2 );
7
  * Hooks to overide option value before save it into database
8
  * ************************************/
9
  function pwa_update_field_rewrite_text( $new_value, $old_value ) {
10
+ $new_value = ($new_value==$old_value) ? $old_value : $new_value;
11
+ $new_value = str_replace('/','-',trim(stripslashes(strip_tags($new_value))));
12
  return $new_value;
13
  }
14
  add_filter( 'pre_update_option_pwa_rewrite_text', 'pwa_update_field_rewrite_text', 10, 2 );
protect-wp-admin.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.mrwebsolution.in/
5
  Description: The "protect-wp-admin" is a very help full plugin to make wordpress admin more secure. Protect WP-Admin plugin is provide an options to change wp-admin url and make the login page private(directly user can't access the login page).
6
  Author: MR Web Solution
7
  Author URI: http://www.mrwebsolution.in/
8
- Version: 3.0.1
9
  */
10
 
11
  /*** Protect WP-Admin Copyright 2017 (email : raghunath.0087@gmail.com)
@@ -35,6 +35,32 @@ function init_pwa_admin_menu(){
35
  add_options_page('Protect WP-Admin','Protect WP-Admin','manage_options','pwa-settings','init_pwa_admin_option_page');
36
  }
37
  endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  /** Define Action to register "Protect WP-Admin" Options */
39
  add_action('admin_init','init_pwa_options_fields');
40
  /** Register "Protect WP-Admin" options */
@@ -91,12 +117,12 @@ function init_pwa_admin_option_page(){
91
  <tr>
92
  <td valign="top">
93
 
94
- <p><label>Enable: </label><input type="checkbox" id="pwa_active" name="pwa_active" value='1' <?php if(get_option('pwa_active')!=''){ echo ' checked="checked"'; }?>/></p>
95
- <p id="adminurl"><label>New Slug: </label><br><input type="text" id="pwa_rewrite_text" size="20" name="pwa_rewrite_text" value="<?php echo esc_attr(get_option('pwa_rewrite_text')); ?>" placeholder="myadmin" size="30"><br><i>Add New Secure Admin URL Slug ( i.e myadmin )</i></p>
96
  <?php
97
  $getPwaOptions=get_pwa_setting_options();
98
  if((isset($getPwaOptions['pwa_active']) && '1'==$getPwaOptions['pwa_active']) && (isset($getPwaOptions['pwa_rewrite_text']) && $getPwaOptions['pwa_rewrite_text']!='')){
99
- echo "<br><p><strong>Your New Admin URL : </strong><br>".home_url($getPwaOptions['pwa_rewrite_text'])." | <strong><blink><a href='".home_url($getPwaOptions['pwa_rewrite_text'].'?preview=1')."' target='_blank'>CLICK HERE</a></blink></strong> to preview new admin URL.</p>";
100
 
101
  }
102
  ?>
@@ -158,25 +184,28 @@ function init_pwa_admin_option_page(){
158
  <p><a href="mailto:raghunath.0087@gmail.com" target="_blank" class="contact-author">Contact Author</a></p>
159
  </td>
160
  <td>
161
- <p><strong>My Other Plugins:</strong><br>
162
- <ol>
163
- <li><a href="https://wordpress.org/plugins/custom-share-buttons-with-floating-sidebar" target="_blank">Custom Share Buttons With Floating Sidebar</a></li>
164
- <li><a href="https://wordpress.org/plugins/protect-wp-admin/" target="_blank">Protect WP-Admin</a></li>
165
- <li><a href="https://wordpress.org/plugins/wp-categories-widget/" target="_blank">WP Categories Widget</a></li>
166
- <li><a href="https://wordpress.org/plugins/wp-protect-content/" target="_blank">WP Protect Content</a></li>
167
- <li><a href="https://wordpress.org/plugins/wp-version-remover/" target="_blank">WP Version Remover</a></li>
168
- <li><a href="https://wordpress.org/plugins/wp-posts-widget/" target="_blank">WP Post Widget</a></li>
169
- <li><a href="https://wordpress.org/plugins/wp-importer" target="_blank">WP Importer</a></li>
170
- <li><a href="https://wordpress.org/plugins/wp-csv-importer/" target="_blank">WP CSV Importer</a></li>
171
- <li><a href="https://wordpress.org/plugins/wp-testimonial/" target="_blank">WP Testimonial</a></li>
172
- <li><a href="https://wordpress.org/plugins/wc-sales-count-manager/" target="_blank">WooCommerce Sales Count Manager</a></li>
173
- <li><a href="https://wordpress.org/plugins/wp-social-buttons/" target="_blank">WP Social Buttons</a></li>
174
- <li><a href="https://wordpress.org/plugins/wp-youtube-gallery/" target="_blank">WP Youtube Gallery</a></li>
175
- <li><a href="https://wordpress.org/plugins/tweets-slider/" target="_blank">Tweets Slider</a></li>
176
- <li><a href="https://wordpress.org/plugins/rg-responsive-gallery/" target="_blank">RG Responsive Slider</a></li>
177
- <li><a href="https://wordpress.org/plugins/cf7-advance-security" target="_blank">Contact Form 7 Advance Security WP-Admin</a></li>
178
- <li><a href="https://wordpress.org/plugins/wp-easy-recipe/" target="_blank">WP Easy Recipe</a></li>
179
- </ol>
 
 
 
180
  </p></td>
181
  </tr>
182
  </table>
@@ -258,10 +287,11 @@ echo $script='<script type="text/javascript">
258
 
259
  if(($el[0].checked) && pwaActive==""){
260
  //alert(pwaActive);
261
- if (confirm("1. Have you updated your permalink settings?\n\n2. Have you checked writable permission on htaccess file?\n\nIf your answer is YES then Click OK to continue")){
262
  return true;
263
  }else
264
  {
 
265
  return false;
266
  }
267
  }
5
  Description: The "protect-wp-admin" is a very help full plugin to make wordpress admin more secure. Protect WP-Admin plugin is provide an options to change wp-admin url and make the login page private(directly user can't access the login page).
6
  Author: MR Web Solution
7
  Author URI: http://www.mrwebsolution.in/
8
+ Version: 3.0.2
9
  */
10
 
11
  /*** Protect WP-Admin Copyright 2017 (email : raghunath.0087@gmail.com)
35
  add_options_page('Protect WP-Admin','Protect WP-Admin','manage_options','pwa-settings','init_pwa_admin_option_page');
36
  }
37
  endif;
38
+
39
+ /**
40
+ * hook to add link under adminmenu bar
41
+ */
42
+ add_action( 'admin_bar_menu', 'toolbar_link_to_pwa', 999 );
43
+ function toolbar_link_to_pwa( $wp_admin_bar ) {
44
+ $args = array(
45
+ 'id' => 'pwa_menu_bar',
46
+ 'title' => 'Protect WP Admin',
47
+ 'href' => admin_url('options-general.php?page=pwa-settings'),
48
+ 'meta' => array( 'class' => 'pwa-toolbar-page' )
49
+ );
50
+ $wp_admin_bar->add_node( $args );
51
+ //second lavel
52
+ $wp_admin_bar->add_node( array(
53
+ 'id' => 'pwa-second-sub-item',
54
+ 'parent' => 'pwa_menu_bar',
55
+ 'title' => 'Settings',
56
+ 'href' => admin_url('options-general.php?page=pwa-settings'),
57
+ 'meta' => array(
58
+ 'title' => __('Settings'),
59
+ 'target' => '_self',
60
+ 'class' => 'pwa_menu_item_class'
61
+ ),
62
+ ));
63
+ }
64
  /** Define Action to register "Protect WP-Admin" Options */
65
  add_action('admin_init','init_pwa_options_fields');
66
  /** Register "Protect WP-Admin" options */
117
  <tr>
118
  <td valign="top">
119
 
120
+ <p><input type="checkbox" id="pwa_active" name="pwa_active" value='1' <?php if(get_option('pwa_active')!=''){ echo ' checked="checked"'; }?>/> <label>Enable </label></p>
121
+ <p id="adminurl"><label>New admin url slug: </label><br><input type="text" id="pwa_rewrite_text" size="40" name="pwa_rewrite_text" value="<?php echo esc_attr(get_option('pwa_rewrite_text')); ?>" placeholder="myadmin" size="30"><br><i>Enter new admin slug to make wp-login page more secure( i.e myadmin )</i></p>
122
  <?php
123
  $getPwaOptions=get_pwa_setting_options();
124
  if((isset($getPwaOptions['pwa_active']) && '1'==$getPwaOptions['pwa_active']) && (isset($getPwaOptions['pwa_rewrite_text']) && $getPwaOptions['pwa_rewrite_text']!='')){
125
+ echo "<br><strong>Note:</strong><br> <p>Please check new admin url before logout.<br><strong><blink><a href='".home_url($getPwaOptions['pwa_rewrite_text'].'?preview=1')."' target='_blank'>CLICK HERE</a></blink></strong> to preview new admin URL.</p>";
126
 
127
  }
128
  ?>
184
  <p><a href="mailto:raghunath.0087@gmail.com" target="_blank" class="contact-author">Contact Author</a></p>
185
  </td>
186
  <td>
187
+ <p><strong>Our Other Plugins:</strong><br>
188
+ <ol>
189
+ <li><a href="https://wordpress.org/plugins/custom-share-buttons-with-floating-sidebar" target="_blank">Custom Share Buttons With Floating Sidebar</a></li>
190
+ <li><a href="https://wordpress.org/plugins/seo-manager/" target="_blank">SEO Manager</a></li>
191
+ <li><a href="https://wordpress.org/plugins/protect-wp-admin/" target="_blank">Protect WP-Admin</a></li>
192
+ <li><a href="https://wordpress.org/plugins/wp-sales-notifier/" target="_blank">WP Sales Notifier</a></li>
193
+ <li><a href="https://wordpress.org/plugins/wp-tracking-manager/" target="_blank">WP Tracking Manager</a></li>
194
+ <li><a href="https://wordpress.org/plugins/wp-categories-widget/" target="_blank">WP Categories Widget</a></li>
195
+ <li><a href="https://wordpress.org/plugins/wp-protect-content/" target="_blank">WP Protect Content</a></li>
196
+ <li><a href="https://wordpress.org/plugins/wp-version-remover/" target="_blank">WP Version Remover</a></li>
197
+ <li><a href="https://wordpress.org/plugins/wp-posts-widget/" target="_blank">WP Post Widget</a></li>
198
+ <li><a href="https://wordpress.org/plugins/wp-importer" target="_blank">WP Importer</a></li>
199
+ <li><a href="https://wordpress.org/plugins/wp-csv-importer/" target="_blank">WP CSV Importer</a></li>
200
+ <li><a href="https://wordpress.org/plugins/wp-testimonial/" target="_blank">WP Testimonial</a></li>
201
+ <li><a href="https://wordpress.org/plugins/wc-sales-count-manager/" target="_blank">WooCommerce Sales Count Manager</a></li>
202
+ <li><a href="https://wordpress.org/plugins/wp-social-buttons/" target="_blank">WP Social Buttons</a></li>
203
+ <li><a href="https://wordpress.org/plugins/wp-youtube-gallery/" target="_blank">WP Youtube Gallery</a></li>
204
+ <li><a href="https://wordpress.org/plugins/tweets-slider/" target="_blank">Tweets Slider</a></li>
205
+ <li><a href="https://wordpress.org/plugins/rg-responsive-gallery/" target="_blank">RG Responsive Slider</a></li>
206
+ <li><a href="https://wordpress.org/plugins/cf7-advance-security" target="_blank">Contact Form 7 Advance Security WP-Admin</a></li>
207
+ <li><a href="https://wordpress.org/plugins/wp-easy-recipe/" target="_blank">WP Easy Recipe</a></li>
208
+ </ol>
209
  </p></td>
210
  </tr>
211
  </table>
287
 
288
  if(($el[0].checked) && pwaActive==""){
289
  //alert(pwaActive);
290
+ if (confirm("1. Have you updated permalink settings to SEO friendly URL\n\nIf your answer is YES then Click OK to continue")){
291
  return true;
292
  }else
293
  {
294
+ location.href="'.admin_url('options-permalink.php').'";
295
  return false;
296
  }
297
  }
pwa-class.php CHANGED
@@ -81,7 +81,7 @@ endif;
81
  if(!function_exists('init_pwa_admin_rewrite_rules')):
82
  function init_pwa_admin_rewrite_rules() {
83
  $getPwaOptions=get_pwa_setting_options();
84
- if(isset($getPwaOptions['pwa_active']) && ''!=$getPwaOptions['pwa_rewrite_text']){
85
  $newurl=strip_tags($getPwaOptions['pwa_rewrite_text']);
86
  add_rewrite_rule( $newurl.'/?$', 'wp-login.php', 'top' );
87
  add_rewrite_rule( $newurl.'/register/?$', 'wp-login.php?action=register', 'top' );
81
  if(!function_exists('init_pwa_admin_rewrite_rules')):
82
  function init_pwa_admin_rewrite_rules() {
83
  $getPwaOptions=get_pwa_setting_options();
84
+ if(isset($getPwaOptions['pwa_active']) && (isset($getPwaOptions['pwa_rewrite_text']) && $getPwaOptions['pwa_rewrite_text']!='')){
85
  $newurl=strip_tags($getPwaOptions['pwa_rewrite_text']);
86
  add_rewrite_rule( $newurl.'/?$', 'wp-login.php', 'top' );
87
  add_rewrite_rule( $newurl.'/register/?$', 'wp-login.php?action=register', 'top' );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors:india-web-developer
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZEMSYQUZRUK6A
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: 4.0
6
- Tested up to: 4.9.7
7
- Stable tag: 3.0.1
8
 
9
  Protect Your Website Admin Against Hackers & Modify Login Page Design
10
 
@@ -47,10 +47,10 @@ It is extremely important to back up your database before beginning the activate
47
  We have also released an add-on for Protect-WP-Admin which not only demonstrates the flexibility of Protect-WP-Admin, but also adds some important features
48
 
49
  * Login Attempt Counter
50
- * An option for define to login page logo URL
51
- * An option for manage login page CSS from admin
52
- * An option for change to username of any user from admin
53
- * An option for define custom redirect url for defalut wp-admin url
54
  * Faster support
55
 
56
 
@@ -122,6 +122,10 @@ Don not forgot to update the "newadmin" slug with your new admin slug (that you
122
 
123
 
124
  == Changelog ==
 
 
 
 
125
  = 3.0.1 =
126
  * Fixed admin access issues
127
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZEMSYQUZRUK6A
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: 4.0
6
+ Tested up to: 4.9.8
7
+ Stable tag: 3.0.2
8
 
9
  Protect Your Website Admin Against Hackers & Modify Login Page Design
10
 
47
  We have also released an add-on for Protect-WP-Admin which not only demonstrates the flexibility of Protect-WP-Admin, but also adds some important features
48
 
49
  * Login Attempt Counter
50
+ * An option to define login page logo URL
51
+ * An option to manage login page CSS from admin
52
+ * An option to change username of any user from admin
53
+ * An option to define custom redirect url for defalut wp-admin url
54
  * Faster support
55
 
56
 
122
 
123
 
124
  == Changelog ==
125
+ = 3.0.2 =
126
+ * Tested with new wordpress version 4.9.8
127
+ * Fixed some minor issues
128
+
129
  = 3.0.1 =
130
  * Fixed admin access issues
131