Hide My WP Ghost – Security Plugin - Version 4.1.06

Version Description

(26 April 2021)= * Update - Added compatibility with builders Oxygen, Elementor, Thrive, Bricks * Update - Added extra security in backend * Update - Added the option to prevent WordPress redirects and slow the website speed when the config rules are not loading * Fix - Brute Force warning when blocks the IP in function get_blocked_ips * Fix - Changed the form submittion action read due to config.json file permission on some servers

Download this release

Release Info

Developer johndarrel
Plugin Icon 128x128 Hide My WP Ghost – Security Plugin
Version 4.1.06
Comparing to
See all releases

Code changes from version 4.1.05 to 4.1.06

classes/Tools.php CHANGED
@@ -105,6 +105,7 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
105
  'logout' => false,
106
  'error' => false,
107
  'rewrites' => 0,
 
108
  'test_frontend' => false,
109
  'changes' => false,
110
  'admin_notice' => array(),
@@ -383,7 +384,7 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
383
  */
384
  public function hookActionlink( $links, $file ) {
385
 
386
- if ( $file == basename(realpath(dirname( __FILE__ ) . '/..')) . '/index.php' ) {
387
  $link = '<a href="https://hidemywpghost.com/wordpress_update" title="Hide My WP Ghost" target="_blank" style="color:#11967A; font-weight: bold">' . __( 'Upgrade to Premium', _HMW_PLUGIN_NAME_ ) . '</a>';
388
  $link .= ' | ';
389
  $link .= '<a href="' . self::getSettingsUrl() . '" title="Hide My Wp Settings">' . __( 'Settings', _HMW_PLUGIN_NAME_ ) . '</a>';
@@ -1079,7 +1080,7 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
1079
  $wp_fastest_cache->deleteCache();
1080
  }
1081
 
1082
- }catch (Exception $e){
1083
 
1084
  }
1085
 
@@ -1476,10 +1477,10 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
1476
  // The WordPress filesystem.
1477
  global $wp_filesystem;
1478
 
1479
- if ( !$wp_filesystem || empty( $wp_filesystem ) ) {
1480
  $credentials = array();
1481
 
1482
- if ( !defined( 'FS_METHOD' ) ) {
1483
  define( 'FS_METHOD', 'direct' );
1484
  }
1485
 
@@ -1494,7 +1495,7 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
1494
  // Set FTP port.
1495
  if ( strpos( $credentials['hostname'], ':' ) && null !== $credentials['hostname'] ) {
1496
  list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 );
1497
- if ( !is_numeric( $credentials['port'] ) ) {
1498
  unset( $credentials['port'] );
1499
  }
1500
  } else {
@@ -1502,9 +1503,9 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
1502
  }
1503
 
1504
  // Set connection type.
1505
- if ( (defined( 'FTP_SSL' ) && FTP_SSL) && 'ftpext' === $method ) {
1506
  $credentials['connection_type'] = 'ftps';
1507
- } elseif ( !array_filter( $credentials ) ) {
1508
  $credentials['connection_type'] = null;
1509
  } else {
1510
  $credentials['connection_type'] = 'ftp';
105
  'logout' => false,
106
  'error' => false,
107
  'rewrites' => 0,
108
+ 'prevent_slow_loading' => 0,
109
  'test_frontend' => false,
110
  'changes' => false,
111
  'admin_notice' => array(),
384
  */
385
  public function hookActionlink( $links, $file ) {
386
 
387
+ if ( $file == basename( realpath( dirname( __FILE__ ) . '/..' ) ) . '/index.php' ) {
388
  $link = '<a href="https://hidemywpghost.com/wordpress_update" title="Hide My WP Ghost" target="_blank" style="color:#11967A; font-weight: bold">' . __( 'Upgrade to Premium', _HMW_PLUGIN_NAME_ ) . '</a>';
389
  $link .= ' | ';
390
  $link .= '<a href="' . self::getSettingsUrl() . '" title="Hide My Wp Settings">' . __( 'Settings', _HMW_PLUGIN_NAME_ ) . '</a>';
1080
  $wp_fastest_cache->deleteCache();
1081
  }
1082
 
1083
+ } catch ( Exception $e ) {
1084
 
1085
  }
1086
 
1477
  // The WordPress filesystem.
1478
  global $wp_filesystem;
1479
 
1480
+ if ( ! $wp_filesystem || empty( $wp_filesystem ) ) {
1481
  $credentials = array();
1482
 
1483
+ if ( ! defined( 'FS_METHOD' ) ) {
1484
  define( 'FS_METHOD', 'direct' );
1485
  }
1486
 
1495
  // Set FTP port.
1496
  if ( strpos( $credentials['hostname'], ':' ) && null !== $credentials['hostname'] ) {
1497
  list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 );
1498
+ if ( ! is_numeric( $credentials['port'] ) ) {
1499
  unset( $credentials['port'] );
1500
  }
1501
  } else {
1503
  }
1504
 
1505
  // Set connection type.
1506
+ if ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $method ) {
1507
  $credentials['connection_type'] = 'ftps';
1508
+ } elseif ( ! array_filter( $credentials ) ) {
1509
  $credentials['connection_type'] = null;
1510
  } else {
1511
  $credentials['connection_type'] = 'ftp';
controllers/Rewrite.php CHANGED
@@ -10,6 +10,11 @@ class HMW_Controllers_Rewrite extends HMW_Classes_FrontController {
10
  return;
11
  }
12
 
 
 
 
 
 
13
  //Start the buffer only if priority is set
14
  if ( HMW_PRIORITY ) {
15
  $this->model->startBuffer();
10
  return;
11
  }
12
 
13
+ //prevent slow websites due to misconfiguration in the config file
14
+ if(HMW_Classes_Tools::getOption( 'prevent_slow_loading' ) && (int)HMW_Classes_Tools::getOption( 'rewrites' ) > 1){
15
+ return;
16
+ }
17
+
18
  //Start the buffer only if priority is set
19
  if ( HMW_PRIORITY ) {
20
  $this->model->startBuffer();
index.php CHANGED
@@ -6,7 +6,7 @@
6
  Plugin Name: Hide My WP Ghost Lite
7
  Plugin URI: https://wordpress.org/plugins/hide-my-wp/
8
  Description: The best solution for WordPress Security. Hide wp-admin, wp-login, wp-content, plugins, themes etc. Add Firewall, Brute Force protection & more. <br /> <a href="https://hidemywpghost.com/wordpress" target="_blank"><strong>Unlock all features</strong></a>
9
- Version: 4.1.05
10
  Author: WPPlugins - WordPress Security Plugins
11
  Author URI: https://hidemywp.co
12
  License: GPLv2 or later
@@ -16,7 +16,7 @@
16
  */
17
 
18
  if (defined( 'NONCE_KEY' ) && defined( 'ABSPATH' ) && ! defined( 'HMW_VERSION' ) ) {
19
- define( 'HMW_VERSION', '4.1.05' );
20
  /* Call config files */
21
  require( dirname( __FILE__ ) . '/config/config.php' );
22
 
6
  Plugin Name: Hide My WP Ghost Lite
7
  Plugin URI: https://wordpress.org/plugins/hide-my-wp/
8
  Description: The best solution for WordPress Security. Hide wp-admin, wp-login, wp-content, plugins, themes etc. Add Firewall, Brute Force protection & more. <br /> <a href="https://hidemywpghost.com/wordpress" target="_blank"><strong>Unlock all features</strong></a>
9
+ Version: 4.1.06
10
  Author: WPPlugins - WordPress Security Plugins
11
  Author URI: https://hidemywp.co
12
  License: GPLv2 or later
16
  */
17
 
18
  if (defined( 'NONCE_KEY' ) && defined( 'ABSPATH' ) && ! defined( 'HMW_VERSION' ) ) {
19
+ define( 'HMW_VERSION', '4.1.06' );
20
  /* Call config files */
21
  require( dirname( __FILE__ ) . '/config/config.php' );
22
 
models/Compatibility.php CHANGED
@@ -141,6 +141,30 @@ class HMW_Models_Compatibility {
141
  return;
142
  }
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  if ( ! is_admin() ) {
145
 
146
  //compatibility with Wp Maintenance plugin
141
  return;
142
  }
143
 
144
+ //Check the compatibility with builders
145
+ //Don't load when on builder editor
146
+ //Compatibility with Oxygen Plugin, Elementor, Thrive and more
147
+ if ( function_exists( 'is_user_logged_in' ) && is_user_logged_in() ) {
148
+ $builder_paramas = array(
149
+ 'fl_builder',
150
+ 'vcv-action',
151
+ 'et_fb',
152
+ 'ct_builder',
153
+ 'tve',
154
+ 'preview',
155
+ 'elementor-preview',
156
+ 'uxb_iframe',
157
+ );
158
+
159
+ foreach ( $builder_paramas as $param ) {
160
+ if ( HMW_Classes_Tools::getValue( $param, false ) ) {
161
+ add_filter( 'hmw_laterload', array( 'HMW_Classes_Tools', 'returnFalse' ) );
162
+ add_filter( 'hmw_process_buffer', array( 'HMW_Classes_Tools', 'returnFalse' ) );
163
+ return;
164
+ }
165
+ }
166
+ }
167
+
168
  if ( ! is_admin() ) {
169
 
170
  //compatibility with Wp Maintenance plugin
readme.txt CHANGED
@@ -363,6 +363,13 @@ Enjoy!
363
  8. Hide Your WP Site from Theme Detectors like wpthemedetector.com
364
 
365
  == Changelog ==
 
 
 
 
 
 
 
366
  = 4.1.05 (15 Feb 2021) =
367
  * Update - Update Security for the last updates and WP requirements
368
  * Update - Optimize JS library from third party plugins
363
  8. Hide Your WP Site from Theme Detectors like wpthemedetector.com
364
 
365
  == Changelog ==
366
+ = 4.1.06 (26 April 2021)=
367
+ * Update - Added compatibility with builders Oxygen, Elementor, Thrive, Bricks
368
+ * Update - Added extra security in backend
369
+ * Update - Added the option to prevent WordPress redirects and slow the website speed when the config rules are not loading
370
+ * Fix - Brute Force warning when blocks the IP in function get_blocked_ips
371
+ * Fix - Changed the form submittion action read due to config.json file permission on some servers
372
+
373
  = 4.1.05 (15 Feb 2021) =
374
  * Update - Update Security for the last updates and WP requirements
375
  * Update - Optimize JS library from third party plugins
view/Advanced.php CHANGED
@@ -54,6 +54,18 @@
54
  </div>
55
  <?php } ?>
56
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
57
  </div>
58
  </div>
59
  <div class="card p-0 col-sm-12 tab-panel">
@@ -102,6 +114,8 @@
102
  </div>
103
  </div>
104
  </div>
 
 
105
  <?php } ?>
106
 
107
 
54
  </div>
55
  <?php } ?>
56
  <?php } ?>
57
+
58
+ <div class="col-sm-12 row mb-1 ml-2">
59
+ <div class="checker col-sm-12 row my-2 py-1">
60
+ <div class="col-sm-12 p-0 switch switch-sm">
61
+ <input type="hidden" name="prevent_slow_loading" value="0"/>
62
+ <input type="checkbox" id="prevent_slow_loading" name="prevent_slow_loading" class="switch" <?php echo( HMW_Classes_Tools::getOption( 'prevent_slow_loading' ) ? 'checked="checked"' : '' ) ?> value="1"/>
63
+ <label for="prevent_slow_loading"><?php _e( 'Prevent Slow Loading Website', _HMW_PLUGIN_NAME_ ); ?></label>
64
+ <a href="https://hidemywpghost.com/kb/advanced-wp-security/#prevent_slow_loading" target="_blank" class="d-inline-block ml-2"><i class="fa fa-question-circle"></i></a>
65
+ <div class="offset-1 text-black-50"><?php _e( "Don't load the plugin if the rewrite rules are not loading correctly in the config file.", _HMW_PLUGIN_NAME_ ); ?><?php _e( '(not recommended)', _HMW_PLUGIN_NAME_ ); ?></div>
66
+ </div>
67
+ </div>
68
+ </div>
69
  </div>
70
  </div>
71
  <div class="card p-0 col-sm-12 tab-panel">
114
  </div>
115
  </div>
116
  </div>
117
+
118
+
119
  <?php } ?>
120
 
121