Hide My WP Ghost – Security Plugin - Version 4.0.11

Version Description

(03 Sept 2020 ) = * Update - Remove version parameter from CSS and JS URLs containing the plus sign * Update - Added {rand} in Text Mapping to show random string on change * Update - Added {blank} in Text Mapping to show an empty string on change * Update - Compatibility with last version WP Fastest Cache plugin * Fix - Added a fix for noredirect param on infinite loops * Fix - Load the 404 not found files correctly

Download this release

Release Info

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

Code changes from version 4.0.08 to 4.0.11

classes/Error.php CHANGED
@@ -53,6 +53,14 @@ class HMW_Classes_Error extends HMW_Classes_FrontController {
53
  'text' => $error);
54
  }
55
 
 
 
 
 
 
 
 
 
56
  /**
57
  * This hook will show the error in WP header
58
  */
53
  'text' => $error);
54
  }
55
 
56
+ /**
57
+ * Return if error
58
+ * @return bool
59
+ */
60
+ public static function isError() {
61
+ return !empty(self::$errors);
62
+ }
63
+
64
  /**
65
  * This hook will show the error in WP header
66
  */
classes/Tools.php CHANGED
@@ -320,6 +320,15 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
320
  }
321
  }
322
 
 
 
 
 
 
 
 
 
 
323
 
324
  /**
325
  * Adds extra links to plugin page
@@ -657,6 +666,10 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
657
  public static function isApache() {
658
  global $is_apache;
659
 
 
 
 
 
660
  return $is_apache;
661
  }
662
 
@@ -681,7 +694,20 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
681
  * @return bool
682
  */
683
  public static function isLitespeed() {
684
- return ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false );
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  }
686
 
687
  /**
@@ -706,6 +732,7 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
706
  return self::$is_multisite;
707
  }
708
 
 
709
  /**
710
  * Returns true if server is nginx
711
  *
@@ -714,6 +741,10 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
714
  public static function isNginx() {
715
  global $is_nginx;
716
 
 
 
 
 
717
  return ( $is_nginx || ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false ) );
718
  }
719
 
@@ -744,6 +775,16 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
744
  return ( file_exists( ABSPATH . 'gd-config.php' ) );
745
  }
746
 
 
 
 
 
 
 
 
 
 
 
747
  /**
748
  * Returns true if server is IIS
749
  *
@@ -912,10 +953,6 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
912
  rocket_clean_cache_busting();
913
  }
914
 
915
- if ( function_exists( 'rocket_purge_cloudflare' ) ) {
916
- rocket_purge_cloudflare();
917
- }
918
-
919
  if ( function_exists( 'opcache_reset' ) ) {
920
  // Remove all opcache if enabled
921
  opcache_reset();
@@ -1190,6 +1227,15 @@ class HMW_Classes_Tools extends HMW_Classes_FrontController {
1190
  return "text/plain";
1191
  }
1192
 
 
 
 
 
 
 
 
 
 
1193
  /**
1194
  * Return false on hooks
1195
  *
320
  }
321
  }
322
 
323
+ /**
324
+ * Save the options into backup
325
+ */
326
+ public static function saveOptionsBackup(){
327
+ //Save the working options into backup
328
+ foreach ( self::$options as $key => $value ) {
329
+ HMW_Classes_Tools::saveOptions( $key, $value, true );
330
+ }
331
+ }
332
 
333
  /**
334
  * Adds extra links to plugin page
666
  public static function isApache() {
667
  global $is_apache;
668
 
669
+ if ( self::isFlywheel() ) { //force Nginx on Flywheel server
670
+ return false;
671
+ }
672
+
673
  return $is_apache;
674
  }
675
 
694
  * @return bool
695
  */
696
  public static function isLitespeed() {
697
+ $litespeed = false;
698
+ if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false ) {
699
+ $litespeed = true;
700
+ } elseif ( isset( $_SERVER['SERVER_NAME'] ) && stristr( $_SERVER['SERVER_NAME'], 'LiteSpeed' ) !== false ) {
701
+ $litespeed = true;
702
+ } elseif ( isset( $_SERVER['X-Litespeed-Cache-Control'] ) ) {
703
+ $litespeed = true;
704
+ }
705
+
706
+ if ( self::isFlywheel() ) {
707
+ return false;
708
+ }
709
+
710
+ return $litespeed;
711
  }
712
 
713
  /**
732
  return self::$is_multisite;
733
  }
734
 
735
+
736
  /**
737
  * Returns true if server is nginx
738
  *
741
  public static function isNginx() {
742
  global $is_nginx;
743
 
744
+ if ( self::isFlywheel() ) {
745
+ return true;
746
+ }
747
+
748
  return ( $is_nginx || ( isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false ) );
749
  }
750
 
775
  return ( file_exists( ABSPATH . 'gd-config.php' ) );
776
  }
777
 
778
+ /**
779
+ * Returns true if server is Wpengine
780
+ *
781
+ * @return boolean
782
+ */
783
+ public static function isFlywheel() {
784
+ return (isset( $_SERVER['SERVER_SOFTWARE'] ) && stristr( $_SERVER['SERVER_SOFTWARE'], 'Flywheel' ) !== false);
785
+ }
786
+
787
+
788
  /**
789
  * Returns true if server is IIS
790
  *
953
  rocket_clean_cache_busting();
954
  }
955
 
 
 
 
 
956
  if ( function_exists( 'opcache_reset' ) ) {
957
  // Remove all opcache if enabled
958
  opcache_reset();
1227
  return "text/plain";
1228
  }
1229
 
1230
+ /**
1231
+ * Generate a string
1232
+ * @param int $length
1233
+ * @return bool|string
1234
+ */
1235
+ public static function generateRandomString( $length = 10 ) {
1236
+ return substr( str_shuffle( str_repeat( $x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil( $length / strlen( $x ) ) ) ), 1, $length );
1237
+ }
1238
+
1239
  /**
1240
  * Return false on hooks
1241
  *
controllers/Rewrite.php CHANGED
@@ -1,301 +1,315 @@
1
  <?php
2
- defined('ABSPATH') || die('Cheatin\' uh?');
3
 
4
  class HMW_Controllers_Rewrite extends HMW_Classes_FrontController {
5
 
6
- public function __construct() {
7
- parent::__construct();
8
-
9
- if (defined('HMW_DISABLE') && HMW_DISABLE) {
10
- return;
11
- }
12
-
13
- //Start the buffer only if priority is set
14
- if (HMW_PRIORITY) {
15
- $this->model->startBuffer();
16
- }
17
-
18
- //Init the main hooks
19
- $this->initHooks();
20
- }
21
-
22
- /**
23
- * Init the hooks for hide my wp
24
- */
25
- public function initHooks() {
26
- if (HMW_Classes_Tools::isPermalinkStructure()) {
27
- if (HMW_Classes_Tools::isApache() && !HMW_Classes_Tools::isModeRewrite()) {
28
- return;
29
- }
30
-
31
- if (!HMW_Classes_Tools::getOption('error') && !HMW_Classes_Tools::getOption('logout')) {
32
- //rename the author if set so
33
- add_filter('author_rewrite_rules', array($this->model, 'author_url'), 99, 1);
34
- }
35
-
36
- add_filter('query_vars', array($this->model, 'addParams'), 1, 1);
37
- add_action('login_init', array($this->model, 'login_init'), 1);
38
- add_filter( 'login_redirect', array($this->model, 'sanitize_login_redirect'), 9, 3 );
39
- add_filter( 'wp_redirect', array($this->model, 'sanitize_redirect'), PHP_INT_MAX, 2 );
40
- add_action('login_head', array($this->model, 'login_head'), PHP_INT_MAX);
41
- add_action('wp_logout', array($this->model, 'wp_logout'), PHP_INT_MAX);
42
-
43
- //change the admin url
44
- add_filter('lostpassword_url', array($this->model, 'lostpassword_url'), PHP_INT_MAX, 1);
45
- add_filter('register', array($this->model, 'register_url'), PHP_INT_MAX, 1);
46
- add_filter('login_url', array($this->model, 'login_url'), PHP_INT_MAX, 1);
47
- add_filter('logout_url', array($this->model, 'logout_url'), PHP_INT_MAX, 2);
48
- add_filter('admin_url', array($this->model, 'admin_url'), PHP_INT_MAX, 3);
49
- add_filter('network_admin_url', array($this->model, 'network_admin_url'), PHP_INT_MAX, 3);
50
- add_filter('site_url', array($this->model, 'site_url'), PHP_INT_MAX, 2);
51
- add_filter('network_site_url', array($this->model, 'site_url'), PHP_INT_MAX, 3);
52
- add_filter( 'wp_php_error_message', array($this->model, 'replace_error_message'), PHP_INT_MAX, 2 );
53
-
54
- //check and set the cookied for the modified urls
55
- HMW_Classes_ObjController::getClass('HMW_Models_Cookies');
56
- //load the compatibility class
57
- HMW_Classes_ObjController::getClass('HMW_Models_Compatibility');
58
- }
59
-
60
- //Load the PluginLoaded Hook
61
- add_action('plugins_loaded', array($this, 'hookPreload'), 1);
62
- //just to make sure it called in case plugins_loaded is not triggered
63
- add_action('template_redirect', array($this, 'hookPreload'), 1);
64
-
65
- //in case of broken URL, try to load it
66
- add_action('template_redirect', array(HMW_Classes_ObjController::getClass('HMW_Models_Files'), 'checkBrokenFile'), PHP_INT_MAX);
67
-
68
- }
69
-
70
-
71
- public function hookPreload() {
72
- //if plugin_loaded then remove template_redirect
73
- if (!did_action('template_redirect')) {
74
- remove_action('template_redirect', array($this, 'hookPreload'), 1);
75
- }
76
-
77
- include_once(ABSPATH . 'wp-admin/includes/plugin.php');
78
-
79
- //Make sure is permalink set up
80
- if (HMW_Classes_Tools::isPermalinkStructure()) {
81
- if (HMW_Classes_Tools::isApache() && !HMW_Classes_Tools::isModeRewrite()) {
82
- return;
83
- }
84
-
85
- //Don't go further if the safe parameter is set
86
- if (HMW_Classes_Tools::getIsset(HMW_Classes_Tools::getOption('hmw_disable_name'))) {
87
- if (HMW_Classes_Tools::getValue(HMW_Classes_Tools::getOption('hmw_disable_name')) == HMW_Classes_Tools::getOption('hmw_disable')) {
88
- return;
89
- }
90
- }
91
-
92
- //Build the find_replace list
93
- $this->model->buildRedirect();
94
-
95
- //don't let to rename and hide the current paths if logout is required
96
- if (HMW_Classes_Tools::getOption('error') || HMW_Classes_Tools::getOption('logout')) {
97
- return;
98
- }
99
-
100
- //stop here is the option is default.
101
- //the prvious code is needed for settings change and validation
102
- if (HMW_Classes_Tools::getOption('hmw_mode') == 'default') {
103
- return;
104
- }
105
-
106
- //Hide the paths in ajax
107
- if (HMW_Classes_Tools::isAjax()) {
108
- $this->model->startBuffer();
109
-
110
- //hide the URLs from admin and login
111
- add_action('init', array($this->model, 'hideUrls'), 99);
112
-
113
- return;
114
- }
115
-
116
- //Check Compatibilities with ther plugins
117
- HMW_Classes_ObjController::getClass('HMW_Models_Compatibility')->checkCompatibility();
118
-
119
- //Start the Buffer if not late loading
120
- $hmw_laterload = apply_filters('hmw_laterload', HMW_Classes_Tools::getOption('hmw_laterload'));
121
-
122
- //check lateload
123
- if ($hmw_laterload && !did_action('template_redirect')) {
124
- add_action('template_redirect', array($this->model, 'startBuffer'), PHP_INT_MAX);
125
- } else {
126
- //start the buffer now
127
- $this->model->startBuffer();
128
- }
129
-
130
- //Check the buffer on shutdown
131
- if (HMW_Classes_Tools::getOption('hmw_shutdown_load')) {
132
- add_action('shutdown', array($this->model, 'shutDownBuffer'), 0);
133
- }
134
-
135
- //hide the URLs from admin and login
136
- add_action('init', array($this->model, 'hideUrls'), 99);
137
-
138
- //hide headers added by plugins
139
- add_action('template_redirect', array($this->model, 'hideHeaders'), PHP_INT_MAX);
140
-
141
- if (!is_admin()) {
142
- if ( HMW_Classes_Tools::getOption( 'hmw_hide_version' ) ) {
143
- add_filter( 'the_generator', array( 'HMW_Classes_Tools', 'returnFalse' ), 99, 1 );
144
- remove_action( 'wp_head', 'wp_generator' );
145
- remove_action( 'wp_head', 'wp_resource_hints', 2 );
146
- }
147
-
148
- if (HMW_Classes_Tools::getOption('hmw_disable_emojicons')) {
149
- //disable the emoji icons
150
- $this->disable_emojicons();
151
- }
152
-
153
- if (HMW_Classes_Tools::getOption('hmw_disable_rest_api')) {
154
- //disable the rest_api
155
- if (!HMW_Classes_Tools::isPluginActive('contact-form-7/wp-contact-form-7.php')) {
156
- if (!function_exists('is_user_logged_in') || (function_exists('is_user_logged_in') && !is_user_logged_in())) {
157
- $this->disable_rest_api();
158
- }
159
- }
160
- }
161
-
162
- if (HMW_Classes_Tools::getOption('hmw_disable_xmlrpc')) {
163
- add_filter('xmlrpc_enabled', array('HMW_Classes_Tools', 'returnFalse'));
164
- }
165
-
166
- if (HMW_Classes_Tools::getOption('hmw_disable_embeds')) {
167
- //disable the embeds
168
- $this->disable_embeds();
169
- }
170
-
171
- //Windows Live Write
172
- if (HMW_Classes_Tools::getOption('hmw_disable_manifest')) {
173
- //disable the embeds
174
- $this->disable_manifest();
175
- }
176
-
177
- //Really Simple Discovery
178
- if (HMW_Classes_Tools::getOption('hmw_hide_header')) {
179
- $this->disable_rds();
180
- }
181
-
182
- if (HMW_Classes_Tools::getOption('hmw_hide_comments')) {
183
- $this->disable_comments();
184
- }
185
-
186
- //Disable Database Debug
187
- if (HMW_Classes_Tools::getOption('hmw_disable_debug')) {
188
- global $wpdb;
189
- $wpdb->hide_errors();
190
- }
191
- }
192
-
193
- }
194
-
195
-
196
- }
197
-
198
-
199
- /**
200
- * On admin init
201
- * Load the Menu
202
- * If the user changes the Permalink to default ... prevent errors
203
- */
204
- public function hookInit() {
205
- if (HMW_Classes_Tools::getIsset(HMW_Classes_Tools::getOption('hmw_disable_name'))) {
206
- if (HMW_Classes_Tools::getValue(HMW_Classes_Tools::getOption('hmw_disable_name')) == HMW_Classes_Tools::getOption('hmw_disable')) {
207
- return;
208
- }
209
- }
210
-
211
- //If the user changes the Permalink to default ... prevent errors
212
- if (!HMW_Classes_Tools::isPermalinkStructure()) {
213
- if (current_user_can('manage_options')) {
214
- if (HMW_Classes_Tools::$default['hmw_admin_url'] <> HMW_Classes_Tools::getOption('hmw_admin_url')) {
215
- $this->model->flushChanges();
216
- }
217
- }
218
- }
219
-
220
- //Show the menu for admins only
221
- if (current_user_can('manage_options')) {
222
- HMW_Classes_ObjController::getClass('HMW_Controllers_Menu')->hookInit();
223
- }
224
-
225
-
226
- }
227
-
228
-
229
- /**
230
- * Disable the emoji icons
231
- */
232
- public function disable_emojicons() {
233
-
234
- // all actions related to emojis
235
- remove_action('admin_print_styles', 'print_emoji_styles');
236
- remove_action('wp_head', 'print_emoji_detection_script', 7);
237
- remove_action('admin_print_scripts', 'print_emoji_detection_script');
238
- remove_action('wp_print_styles', 'print_emoji_styles');
239
- remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
240
- remove_filter('the_content_feed', 'wp_staticize_emoji');
241
- remove_filter('comment_text_rss', 'wp_staticize_emoji');
242
- add_filter('emoji_svg_url', array('HMW_Classes_Tools','returnFalse'));
243
-
244
- // filter to remove TinyMCE emojis
245
- add_filter('tiny_mce_plugins', array($this, 'disable_emojicons_tinymce'));
246
- }
247
-
248
- function disable_emojicons_tinymce($plugins) {
249
- if (is_array($plugins)) {
250
- return array_diff($plugins, array('wpemoji'));
251
- } else {
252
- return array();
253
- }
254
- }
255
-
256
- /**
257
- * Disable the Rest Api access
258
- */
259
- public function disable_rest_api() {
260
- remove_action('init', 'rest_api_init');
261
- remove_action('rest_api_init', 'rest_api_default_filters', 10);
262
- remove_action('wp_head', 'rest_output_link_wp_head', 10);
263
- remove_action('parse_request', 'rest_api_loaded');
264
- }
265
-
266
- /**
267
- * Disable the embeds
268
- */
269
- public function disable_embeds() {
270
- // Remove the REST API endpoint.
271
- remove_action('rest_api_init', 'wp_oembed_register_route');
272
-
273
- // Turn off oEmbed auto discovery.
274
- // Don't filter oEmbed results.
275
- remove_filter('oembed_dataparse', 'wp_filter_oembed_result', 10);
276
-
277
- // Remove oEmbed discovery links.
278
- remove_action('wp_head', 'wp_oembed_add_discovery_links');
279
-
280
- // Remove oEmbed-specific JavaScript from the front-end and back-end.
281
- remove_action('wp_head', 'wp_oembed_add_host_js');
282
- }
283
-
284
- /**
285
- * Disable Windows Live Write
286
- */
287
- public function disable_manifest() {
288
- remove_action('wp_head', 'wlwmanifest_link');
289
- }
290
-
291
- /**
292
- * Disable Really Simple Discovery
293
- */
294
- public function disable_rds() {
295
- remove_action('wp_head', 'rsd_link');
296
- }
297
-
298
- public function disable_comments(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  global $wp_super_cache_comments;
300
  remove_all_filters( 'w3tc_footer_comment' );
301
  $wp_super_cache_comments = false;
1
  <?php
2
+ defined( 'ABSPATH' ) || die( 'Cheatin\' uh?' );
3
 
4
  class HMW_Controllers_Rewrite extends HMW_Classes_FrontController {
5
 
6
+ public function __construct() {
7
+ parent::__construct();
8
+
9
+ if ( defined( 'HMW_DISABLE' ) && HMW_DISABLE ) {
10
+ return;
11
+ }
12
+
13
+ //Start the buffer only if priority is set
14
+ if ( HMW_PRIORITY ) {
15
+ $this->model->startBuffer();
16
+ }
17
+
18
+ //Init the main hooks
19
+ $this->initHooks();
20
+ }
21
+
22
+ /**
23
+ * Init the hooks for hide my wp
24
+ */
25
+ public function initHooks() {
26
+ if ( HMW_Classes_Tools::isPermalinkStructure() ) {
27
+ if ( HMW_Classes_Tools::isApache() && ! HMW_Classes_Tools::isModeRewrite() ) {
28
+ return;
29
+ }
30
+
31
+ if ( ! HMW_Classes_Tools::getOption( 'error' ) && ! HMW_Classes_Tools::getOption( 'logout' ) ) {
32
+ //rename the author if set so
33
+ add_filter( 'author_rewrite_rules', array( $this->model, 'author_url' ), 99, 1 );
34
+ }
35
+
36
+ add_filter( 'query_vars', array( $this->model, 'addParams' ), 1, 1 );
37
+ add_action( 'login_init', array( $this->model, 'login_init' ), 1 );
38
+ add_filter( 'login_redirect', array( $this->model, 'sanitize_login_redirect' ), 9, 3 );
39
+ add_filter( 'wp_redirect', array( $this->model, 'sanitize_redirect' ), PHP_INT_MAX, 2 );
40
+
41
+ if ( HMW_Classes_Tools::isWpengine() && PHP_VERSION_ID >= 70400 ) {
42
+ add_filter( 'wp_redirect', array( $this->model, 'loopCheck' ), PHP_INT_MAX, 1 );
43
+ }
44
+
45
+ add_action( 'login_head', array( $this->model, 'login_head' ), PHP_INT_MAX );
46
+ add_action( 'wp_logout', array( $this->model, 'wp_logout' ), PHP_INT_MAX );
47
+
48
+ //change the admin url
49
+ add_filter( 'lostpassword_url', array( $this->model, 'lostpassword_url' ), PHP_INT_MAX, 1 );
50
+ add_filter( 'register', array( $this->model, 'register_url' ), PHP_INT_MAX, 1 );
51
+ add_filter( 'login_url', array( $this->model, 'login_url' ), PHP_INT_MAX, 1 );
52
+ add_filter( 'logout_url', array( $this->model, 'logout_url' ), PHP_INT_MAX, 2 );
53
+ add_filter( 'admin_url', array( $this->model, 'admin_url' ), PHP_INT_MAX, 3 );
54
+ add_filter( 'network_admin_url', array( $this->model, 'network_admin_url' ), PHP_INT_MAX, 3 );
55
+ add_filter( 'site_url', array( $this->model, 'site_url' ), PHP_INT_MAX, 2 );
56
+ add_filter( 'network_site_url', array( $this->model, 'site_url' ), PHP_INT_MAX, 3 );
57
+ add_filter( 'wp_php_error_message', array( $this->model, 'replace_error_message' ), PHP_INT_MAX, 2 );
58
+
59
+ //check and set the cookied for the modified urls
60
+ HMW_Classes_ObjController::getClass( 'HMW_Models_Cookies' );
61
+ //load the compatibility class
62
+ HMW_Classes_ObjController::getClass( 'HMW_Models_Compatibility' );
63
+ }
64
+
65
+ //Load the PluginLoaded Hook
66
+ add_action( 'plugins_loaded', array( $this, 'hookPreload' ), 1 );
67
+ //just to make sure it called in case plugins_loaded is not triggered
68
+ add_action( 'template_redirect', array( $this, 'hookPreload' ), 1 );
69
+
70
+ //in case of broken URL, try to load it
71
+ add_action( 'template_redirect', array(
72
+ HMW_Classes_ObjController::getClass( 'HMW_Models_Files' ),
73
+ 'checkBrokenFile'
74
+ ), PHP_INT_MAX );
75
+
76
+ }
77
+
78
+
79
+ public function hookPreload() {
80
+ //if plugin_loaded then remove template_redirect
81
+ if ( ! did_action( 'template_redirect' ) ) {
82
+ remove_action( 'template_redirect', array( $this, 'hookPreload' ), 1 );
83
+ }
84
+
85
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
86
+
87
+ //Make sure is permalink set up
88
+ if ( HMW_Classes_Tools::isPermalinkStructure() ) {
89
+ if ( HMW_Classes_Tools::isApache() && ! HMW_Classes_Tools::isModeRewrite() ) {
90
+ return;
91
+ }
92
+
93
+ //Don't go further if the safe parameter is set
94
+ if ( HMW_Classes_Tools::getIsset( HMW_Classes_Tools::getOption( 'hmw_disable_name' ) ) ) {
95
+ if ( HMW_Classes_Tools::getValue( HMW_Classes_Tools::getOption( 'hmw_disable_name' ) ) == HMW_Classes_Tools::getOption( 'hmw_disable' ) ) {
96
+ return;
97
+ }
98
+ }
99
+
100
+ //Build the find_replace list
101
+ $this->model->buildRedirect();
102
+
103
+ //don't let to rename and hide the current paths if logout is required
104
+ if ( HMW_Classes_Tools::getOption( 'error' ) || HMW_Classes_Tools::getOption( 'logout' ) ) {
105
+ return;
106
+ }
107
+
108
+ //stop here is the option is default.
109
+ //the prvious code is needed for settings change and validation
110
+ if ( HMW_Classes_Tools::getOption( 'hmw_mode' ) == 'default' ) {
111
+ return;
112
+ }
113
+
114
+ //Hide the paths in ajax
115
+ if ( HMW_Classes_Tools::isAjax() ) {
116
+ $this->model->startBuffer();
117
+
118
+ //hide the URLs from admin and login
119
+ add_action( 'init', array( $this->model, 'hideUrls' ), 99 );
120
+
121
+ return;
122
+ }
123
+
124
+ //Check Compatibilities with ther plugins
125
+ HMW_Classes_ObjController::getClass( 'HMW_Models_Compatibility' )->checkCompatibility();
126
+
127
+ //Start the Buffer if not late loading
128
+ $hmw_laterload = apply_filters( 'hmw_laterload', HMW_Classes_Tools::getOption( 'hmw_laterload' ) );
129
+
130
+ //check lateload
131
+ if ( $hmw_laterload && ! did_action( 'template_redirect' ) ) {
132
+ add_action( 'template_redirect', array( $this->model, 'startBuffer' ), PHP_INT_MAX );
133
+ } else {
134
+ //start the buffer now
135
+ $this->model->startBuffer();
136
+ }
137
+
138
+ //Check the buffer on shutdown
139
+ if ( HMW_Classes_Tools::getOption( 'hmw_shutdown_load' ) ) {
140
+ add_action( 'shutdown', array( $this->model, 'shutDownBuffer' ), 0 );
141
+ }
142
+
143
+ //hide the URLs from admin and login
144
+ add_action( 'init', array( $this->model, 'hideUrls' ), 99 );
145
+
146
+ //hide headers added by plugins
147
+ add_action( 'template_redirect', array( $this->model, 'hideHeaders' ), PHP_INT_MAX );
148
+
149
+ if ( ! is_admin() ) {
150
+ if ( HMW_Classes_Tools::getOption( 'hmw_hide_version' ) ) {
151
+ add_filter( 'the_generator', array( 'HMW_Classes_Tools', 'returnFalse' ), 99, 1 );
152
+ remove_action( 'wp_head', 'wp_generator' );
153
+ remove_action( 'wp_head', 'wp_resource_hints', 2 );
154
+ }
155
+
156
+ if ( HMW_Classes_Tools::getOption( 'hmw_disable_emojicons' ) ) {
157
+ //disable the emoji icons
158
+ $this->disable_emojicons();
159
+ }
160
+
161
+ if ( HMW_Classes_Tools::getOption( 'hmw_disable_rest_api' ) ) {
162
+ //disable the rest_api
163
+ if ( ! HMW_Classes_Tools::isPluginActive( 'contact-form-7/wp-contact-form-7.php' ) ) {
164
+ if ( ! function_exists( 'is_user_logged_in' ) || ( function_exists( 'is_user_logged_in' ) && ! is_user_logged_in() ) ) {
165
+ $this->disable_rest_api();
166
+ }
167
+ }
168
+ }
169
+
170
+ if ( HMW_Classes_Tools::getOption( 'hmw_disable_xmlrpc' ) ) {
171
+ add_filter( 'xmlrpc_enabled', array( 'HMW_Classes_Tools', 'returnFalse' ) );
172
+ }
173
+
174
+ if ( HMW_Classes_Tools::getOption( 'hmw_disable_embeds' ) ) {
175
+ //disable the embeds
176
+ $this->disable_embeds();
177
+ }
178
+
179
+ //Windows Live Write
180
+ if ( HMW_Classes_Tools::getOption( 'hmw_disable_manifest' ) ) {
181
+ //disable the embeds
182
+ $this->disable_manifest();
183
+ }
184
+
185
+ //Really Simple Discovery
186
+ if ( HMW_Classes_Tools::getOption( 'hmw_hide_header' ) ) {
187
+ $this->disable_rds();
188
+ }
189
+
190
+ if ( HMW_Classes_Tools::getOption( 'hmw_hide_comments' ) ) {
191
+ $this->disable_comments();
192
+ }
193
+
194
+ //Disable Database Debug
195
+ if ( HMW_Classes_Tools::getOption( 'hmw_disable_debug' ) ) {
196
+ global $wpdb;
197
+ $wpdb->hide_errors();
198
+ }
199
+ }
200
+
201
+ }
202
+
203
+
204
+ }
205
+
206
+
207
+ /**
208
+ * On admin init
209
+ * Load the Menu
210
+ * If the user changes the Permalink to default ... prevent errors
211
+ */
212
+ public function hookInit() {
213
+ if ( HMW_Classes_Tools::getIsset( HMW_Classes_Tools::getOption( 'hmw_disable_name' ) ) ) {
214
+ if ( HMW_Classes_Tools::getValue( HMW_Classes_Tools::getOption( 'hmw_disable_name' ) ) == HMW_Classes_Tools::getOption( 'hmw_disable' ) ) {
215
+ return;
216
+ }
217
+ }
218
+
219
+ //If the user changes the Permalink to default ... prevent errors
220
+ if ( ! HMW_Classes_Tools::isPermalinkStructure() ) {
221
+ if ( current_user_can( 'manage_options' ) ) {
222
+ if ( HMW_Classes_Tools::$default['hmw_admin_url'] <> HMW_Classes_Tools::getOption( 'hmw_admin_url' ) ) {
223
+ $this->model->flushChanges();
224
+ }
225
+ }
226
+ }
227
+
228
+ //Show the menu for admins only
229
+ if ( current_user_can( 'manage_options' ) ) {
230
+ HMW_Classes_ObjController::getClass( 'HMW_Controllers_Menu' )->hookInit();
231
+ }
232
+
233
+
234
+ }
235
+
236
+
237
+ /**
238
+ * Disable the emoji icons
239
+ */
240
+ public function disable_emojicons() {
241
+
242
+ // all actions related to emojis
243
+ remove_action( 'admin_print_styles', 'print_emoji_styles' );
244
+ remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
245
+ remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
246
+ remove_action( 'wp_print_styles', 'print_emoji_styles' );
247
+ remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
248
+ remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
249
+ remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
250
+ add_filter( 'emoji_svg_url', array( 'HMW_Classes_Tools', 'returnFalse' ) );
251
+
252
+ // filter to remove TinyMCE emojis
253
+ add_filter( 'tiny_mce_plugins', array( $this, 'disable_emojicons_tinymce' ) );
254
+ }
255
+
256
+ function disable_emojicons_tinymce( $plugins ) {
257
+ if ( is_array( $plugins ) ) {
258
+ return array_diff( $plugins, array( 'wpemoji' ) );
259
+ } else {
260
+ return array();
261
+ }
262
+ }
263
+
264
+ /**
265
+ * Disable the Rest Api access
266
+ */
267
+ public function disable_rest_api() {
268
+ remove_action( 'init', 'rest_api_init' );
269
+ remove_action( 'rest_api_init', 'rest_api_default_filters', 10 );
270
+ remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
271
+ remove_action( 'parse_request', 'rest_api_loaded' );
272
+ remove_action( 'template_redirect', 'rest_output_link_header', 11 );
273
+ }
274
+
275
+ /**
276
+ * Disable the embeds
277
+ */
278
+ public function disable_embeds() {
279
+ // Remove the REST API endpoint.
280
+ remove_action( 'rest_api_init', 'wp_oembed_register_route' );
281
+
282
+ // Turn off oEmbed auto discovery.
283
+ // Don't filter oEmbed results.
284
+ remove_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10 );
285
+
286
+ // Remove oEmbed discovery links.
287
+ remove_action( 'wp_head', 'wp_oembed_add_discovery_links' );
288
+
289
+ // Remove oEmbed-specific JavaScript from the front-end and back-end.
290
+ remove_action( 'wp_head', 'wp_oembed_add_host_js' );
291
+ }
292
+
293
+ /**
294
+ * Disable Windows Live Write
295
+ */
296
+ public function disable_manifest() {
297
+ remove_action( 'wp_head', 'wlwmanifest_link' );
298
+ }
299
+
300
+ /**
301
+ * Disable Really Simple Discovery
302
+ */
303
+ public function disable_rds() {
304
+ remove_action( 'wp_head', 'rsd_link' );
305
+ remove_action( 'wp_head', 'wp_shortlink_wp_head' );
306
+ }
307
+
308
+
309
+ /**
310
+ * Disable the commend from W3 Total Cache
311
+ */
312
+ public function disable_comments() {
313
  global $wp_super_cache_comments;
314
  remove_all_filters( 'w3tc_footer_comment' );
315
  $wp_super_cache_comments = false;
controllers/Settings.php CHANGED
@@ -64,11 +64,11 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
64
  HMW_Classes_ObjController::getClass( 'HMW_Models_Compatibility' )->getAlerts();
65
 
66
  //Load the css for Settings
67
- if(is_rtl()) {
68
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'popper.min' );
69
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'bootstrap.rtl.min' );
70
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'rtl' );
71
- }else{
72
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'popper.min' );
73
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'bootstrap.min' );
74
  }
@@ -78,7 +78,7 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
78
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'settings' );
79
 
80
  //Show Hide My WP Offer
81
- if ( HMW_Classes_Tools::getOption( 'hmw_mode' ) == 'lite' && date('d') >= 15 && date('d') <= 31) {
82
  HMW_Classes_Error::setError( sprintf( __( '%sLimited Time Offer%s: Get %s65%% OFF%s today on Hide My WP Ghost 5 Websites License. %sHurry Up!%s', _HMW_PLUGIN_NAME_ ), '<a href="https://wpplugins.tips/buy/5_websites_special" target="_blank" style="font-weight: bold"><strong style="color: red">', '</strong></a>', '<a href="https://wpplugins.tips/buy/5_websites_special" target="_blank" style="font-weight: bold"><strong style="color: red">', '</strong></a>', '<a href="https://wpplugins.tips/buy/5_websites_special" target="_blank" style="font-weight: bold">', '</a>' ) );
83
  }
84
 
@@ -252,10 +252,7 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
252
 
253
  if ( ! HMW_Classes_Tools::getOption( 'logout' ) || HMW_Classes_Tools::getOption( 'hmw_mode' ) == 'default' ) {
254
  //Save the working options into backup
255
- $options = HMW_Classes_Tools::getOptions();
256
- foreach ( $options as $key => $value ) {
257
- HMW_Classes_Tools::saveOptions( $key, $value, true );
258
- }
259
  }
260
 
261
 
@@ -265,23 +262,25 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
265
  //Flush the changes
266
  HMW_Classes_ObjController::getClass( 'HMW_Models_Rewrite' )->flushChanges();
267
 
268
- HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
 
269
 
270
- //Redirect to the new admin URL
271
- if ( HMW_Classes_Tools::getOption( 'logout' ) ) {
272
 
273
- //Set the cookies for the current path
274
- $cookies = HMW_Classes_ObjController::newInstance( 'HMW_Models_Cookies' );
275
 
276
- if ( $cookies->setCookiesCurrentPath() ) {
277
- HMW_Classes_Tools::saveOptions( 'logout', false );
278
- //activate frontend test
279
- HMW_Classes_Tools::saveOptions( 'test_frontend', true );
280
 
281
- remove_all_filters( 'wp_redirect' );
282
- remove_all_filters( 'admin_url' );
283
- wp_safe_redirect( HMW_Classes_Tools::getSettingsUrl() );
284
- exit();
 
285
  }
286
  }
287
  }
@@ -294,6 +293,12 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
294
  }
295
 
296
  if ( ! HMW_Classes_Tools::getOption( 'error' ) ) {
 
 
 
 
 
 
297
  //Clear the cache if there are no errors
298
  HMW_Classes_Tools::emptyCache();
299
  HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
@@ -323,8 +328,8 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
323
  }
324
  foreach ( $hmw_text_mapping_from as $index => $from ) {
325
  if ( $hmw_text_mapping_from[ $index ] <> '' && $hmw_text_mapping_to[ $index ] <> '' ) {
326
- $hmw_text_mapping_from[ $index ] = preg_replace( '/[^A-Za-z0-9-_\/\.]/', '', $hmw_text_mapping_from[ $index ] );
327
- $hmw_text_mapping_to[ $index ] = preg_replace( '/[^A-Za-z0-9-_\/\.]/', '', $hmw_text_mapping_to[ $index ] );
328
 
329
  if ( ! isset( $hmw_text_mapping['from'] ) || ! in_array( $hmw_text_mapping_from[ $index ], (array) $hmw_text_mapping['from'] ) ) {
330
  //Don't save the wp-posts for Woodmart theme
@@ -350,6 +355,12 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
350
 
351
  //Clear the cache if there are no errors
352
  if ( ! HMW_Classes_Tools::getOption( 'error' ) ) {
 
 
 
 
 
 
353
  //Clear the cache if there are no errors
354
  HMW_Classes_Tools::emptyCache();
355
  HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
@@ -362,6 +373,12 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
362
 
363
  //Clear the cache if there are no errors
364
  if ( ! HMW_Classes_Tools::getOption( 'error' ) ) {
 
 
 
 
 
 
365
  //Clear the cache if there are no errors
366
  HMW_Classes_Tools::emptyCache();
367
  HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
@@ -403,20 +420,16 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
403
  case 'hmw_savedefault':
404
  HMW_Classes_Tools::saveOptions( 'logout', false );
405
 
406
- $options = HMW_Classes_Tools::getOptions();
407
- foreach ( $options as $key => $value ) {
408
- HMW_Classes_Tools::saveOptions( $key, $value, true );
409
- }
410
  break;
411
  case 'hmw_confirm':
412
  HMW_Classes_Tools::saveOptions( 'error', false );
413
  HMW_Classes_Tools::saveOptions( 'logout', false );
414
  HMW_Classes_Tools::saveOptions( 'test_frontend', false );
415
 
416
- //save to safe mode in case of db
417
- foreach ( HMW_Classes_Tools::$options as $key => $value ) {
418
- HMW_Classes_Tools::saveOptions( $key, $value, true );
419
- }
420
 
421
  //Send email notification about the path changed
422
  HMW_Classes_ObjController::getClass( 'HMW_Models_Rewrite' )->sendEmail();
@@ -433,10 +446,8 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
433
  //Send email notification about the path changed
434
  HMW_Classes_ObjController::getClass( 'HMW_Models_Rewrite' )->sendEmail();
435
 
436
- //save to safe mode in case of db
437
- foreach ( HMW_Classes_Tools::$options as $key => $value ) {
438
- HMW_Classes_Tools::saveOptions( $key, $value, true );
439
- }
440
 
441
  //Force the rechck security notification
442
  delete_option( 'hmw_securitycheck_time' );
@@ -477,10 +488,8 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
477
  HMW_Classes_Tools::saveOptions( 'error', false );
478
  HMW_Classes_Tools::checkApi();
479
 
480
- //Save the last safe data
481
- foreach ( HMW_Classes_Tools::$options as $key => $value ) {
482
- HMW_Classes_Tools::saveOptions( $key, $value, true );
483
- }
484
 
485
  } else {
486
  HMW_Classes_Error::setError( __( 'ERROR! Please make sure you use a valid token to connect the plugin with WPPlugins', _HMW_PLUGIN_NAME_ ) . " <br /> " );
@@ -497,10 +506,8 @@ class HMW_Controllers_Settings extends HMW_Classes_FrontController {
497
  HMW_Classes_Tools::saveOptions( 'hmw_token', md5( home_url() ) );
498
  HMW_Classes_Tools::saveOptions( 'error', false );
499
 
500
- //Save the last safe data
501
- foreach ( HMW_Classes_Tools::$options as $key => $value ) {
502
- HMW_Classes_Tools::saveOptions( $key, $value, true );
503
- }
504
 
505
  wp_redirect( $redirect_to );
506
  exit();
64
  HMW_Classes_ObjController::getClass( 'HMW_Models_Compatibility' )->getAlerts();
65
 
66
  //Load the css for Settings
67
+ if ( is_rtl() ) {
68
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'popper.min' );
69
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'bootstrap.rtl.min' );
70
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'rtl' );
71
+ } else {
72
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'popper.min' );
73
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'bootstrap.min' );
74
  }
78
  HMW_Classes_ObjController::getClass( 'HMW_Classes_DisplayController' )->loadMedia( 'settings' );
79
 
80
  //Show Hide My WP Offer
81
+ if ( HMW_Classes_Tools::getOption( 'hmw_mode' ) == 'lite' && date( 'd' ) >= 15 && date( 'd' ) <= 31 ) {
82
  HMW_Classes_Error::setError( sprintf( __( '%sLimited Time Offer%s: Get %s65%% OFF%s today on Hide My WP Ghost 5 Websites License. %sHurry Up!%s', _HMW_PLUGIN_NAME_ ), '<a href="https://wpplugins.tips/buy/5_websites_special" target="_blank" style="font-weight: bold"><strong style="color: red">', '</strong></a>', '<a href="https://wpplugins.tips/buy/5_websites_special" target="_blank" style="font-weight: bold"><strong style="color: red">', '</strong></a>', '<a href="https://wpplugins.tips/buy/5_websites_special" target="_blank" style="font-weight: bold">', '</a>' ) );
83
  }
84
 
252
 
253
  if ( ! HMW_Classes_Tools::getOption( 'logout' ) || HMW_Classes_Tools::getOption( 'hmw_mode' ) == 'default' ) {
254
  //Save the working options into backup
255
+ HMW_Classes_Tools::saveOptionsBackup();
 
 
 
256
  }
257
 
258
 
262
  //Flush the changes
263
  HMW_Classes_ObjController::getClass( 'HMW_Models_Rewrite' )->flushChanges();
264
 
265
+ if ( ! HMW_Classes_Error::isError() ) {
266
+ HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
267
 
268
+ //Redirect to the new admin URL
269
+ if ( HMW_Classes_Tools::getOption( 'logout' ) ) {
270
 
271
+ //Set the cookies for the current path
272
+ $cookies = HMW_Classes_ObjController::newInstance( 'HMW_Models_Cookies' );
273
 
274
+ if ( $cookies->setCookiesCurrentPath() ) {
275
+ HMW_Classes_Tools::saveOptions( 'logout', false );
276
+ //activate frontend test
277
+ HMW_Classes_Tools::saveOptions( 'test_frontend', true );
278
 
279
+ remove_all_filters( 'wp_redirect' );
280
+ remove_all_filters( 'admin_url' );
281
+ wp_safe_redirect( HMW_Classes_Tools::getSettingsUrl() );
282
+ exit();
283
+ }
284
  }
285
  }
286
  }
293
  }
294
 
295
  if ( ! HMW_Classes_Tools::getOption( 'error' ) ) {
296
+
297
+ if ( ! HMW_Classes_Tools::getOption( 'logout' ) ) {
298
+ //Save the working options into backup
299
+ HMW_Classes_Tools::saveOptionsBackup();
300
+ }
301
+
302
  //Clear the cache if there are no errors
303
  HMW_Classes_Tools::emptyCache();
304
  HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
328
  }
329
  foreach ( $hmw_text_mapping_from as $index => $from ) {
330
  if ( $hmw_text_mapping_from[ $index ] <> '' && $hmw_text_mapping_to[ $index ] <> '' ) {
331
+ $hmw_text_mapping_from[ $index ] = preg_replace( '/[^A-Za-z0-9-_\/\.\{\}]/', '', $hmw_text_mapping_from[ $index ] );
332
+ $hmw_text_mapping_to[ $index ] = preg_replace( '/[^A-Za-z0-9-_\/\.\{\}]/', '', $hmw_text_mapping_to[ $index ] );
333
 
334
  if ( ! isset( $hmw_text_mapping['from'] ) || ! in_array( $hmw_text_mapping_from[ $index ], (array) $hmw_text_mapping['from'] ) ) {
335
  //Don't save the wp-posts for Woodmart theme
355
 
356
  //Clear the cache if there are no errors
357
  if ( ! HMW_Classes_Tools::getOption( 'error' ) ) {
358
+
359
+ if ( ! HMW_Classes_Tools::getOption( 'logout' ) ) {
360
+ //Save the working options into backup
361
+ HMW_Classes_Tools::saveOptionsBackup();
362
+ }
363
+
364
  //Clear the cache if there are no errors
365
  HMW_Classes_Tools::emptyCache();
366
  HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
373
 
374
  //Clear the cache if there are no errors
375
  if ( ! HMW_Classes_Tools::getOption( 'error' ) ) {
376
+
377
+ if ( ! HMW_Classes_Tools::getOption( 'logout' ) ) {
378
+ //Save the working options into backup
379
+ HMW_Classes_Tools::saveOptionsBackup();
380
+ }
381
+
382
  //Clear the cache if there are no errors
383
  HMW_Classes_Tools::emptyCache();
384
  HMW_Classes_Error::setError( __( 'Saved' ), 'success' );
420
  case 'hmw_savedefault':
421
  HMW_Classes_Tools::saveOptions( 'logout', false );
422
 
423
+ //Save the working options into backup
424
+ HMW_Classes_Tools::saveOptionsBackup();
 
 
425
  break;
426
  case 'hmw_confirm':
427
  HMW_Classes_Tools::saveOptions( 'error', false );
428
  HMW_Classes_Tools::saveOptions( 'logout', false );
429
  HMW_Classes_Tools::saveOptions( 'test_frontend', false );
430
 
431
+ //Save the working options into backup
432
+ HMW_Classes_Tools::saveOptionsBackup();
 
 
433
 
434
  //Send email notification about the path changed
435
  HMW_Classes_ObjController::getClass( 'HMW_Models_Rewrite' )->sendEmail();
446
  //Send email notification about the path changed
447
  HMW_Classes_ObjController::getClass( 'HMW_Models_Rewrite' )->sendEmail();
448
 
449
+ //Save the working options into backup
450
+ HMW_Classes_Tools::saveOptionsBackup();
 
 
451
 
452
  //Force the rechck security notification
453
  delete_option( 'hmw_securitycheck_time' );
488
  HMW_Classes_Tools::saveOptions( 'error', false );
489
  HMW_Classes_Tools::checkApi();
490
 
491
+ //Save the working options into backup
492
+ HMW_Classes_Tools::saveOptionsBackup();
 
 
493
 
494
  } else {
495
  HMW_Classes_Error::setError( __( 'ERROR! Please make sure you use a valid token to connect the plugin with WPPlugins', _HMW_PLUGIN_NAME_ ) . " <br /> " );
506
  HMW_Classes_Tools::saveOptions( 'hmw_token', md5( home_url() ) );
507
  HMW_Classes_Tools::saveOptions( 'error', false );
508
 
509
+ //Save the working options into backup
510
+ HMW_Classes_Tools::saveOptionsBackup();
 
 
511
 
512
  wp_redirect( $redirect_to );
513
  exit();
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.0.08
10
  Author: WPPlugins - WordPress Security Plugins
11
  Author URI: https://wpplugins.tips
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.0.08' );
20
  /* Call config files */
21
  require( dirname( __FILE__ ) . '/debug/index.php' );
22
  require( dirname( __FILE__ ) . '/config/config.php' );
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.0.11
10
  Author: WPPlugins - WordPress Security Plugins
11
  Author URI: https://wpplugins.tips
12
  License: GPLv2 or later
16
  */
17
 
18
  if (defined( 'NONCE_KEY' ) && defined( 'ABSPATH' ) && ! defined( 'HMW_VERSION' ) ) {
19
+ define( 'HMW_VERSION', '4.0.11' );
20
  /* Call config files */
21
  require( dirname( __FILE__ ) . '/debug/index.php' );
22
  require( dirname( __FILE__ ) . '/config/config.php' );
models/Compatibility.php CHANGED
@@ -37,6 +37,17 @@ class HMW_Models_Compatibility {
37
  */
38
  public function checkCompatibilityOnLoad() {
39
 
 
 
 
 
 
 
 
 
 
 
 
40
  if ( ! is_admin() ) {
41
 
42
  try {
@@ -207,6 +218,12 @@ class HMW_Models_Compatibility {
207
 
208
  //Compatibility with Wp Fastest Cache
209
  if ( HMW_Classes_Tools::isPluginActive( 'wp-fastest-cache/wpFastestCache.php' ) ) {
 
 
 
 
 
 
210
  add_filter( 'hmw_laterload', array( 'HMW_Classes_Tools', 'returnTrue' ) );
211
  add_filter( 'hmw_process_buffer', array( 'HMW_Classes_Tools', 'returnTrue' ) );
212
 
37
  */
38
  public function checkCompatibilityOnLoad() {
39
 
40
+ if ( HMW_Classes_Tools::isPluginActive( 'ithemes-security-pro/ithemes-security-pro.php' ) ||
41
+ HMW_Classes_Tools::isPluginActive( 'better-wp-security/better-wp-security.php' )) {
42
+ $settings = get_option('itsec-storage');
43
+ if(isset($settings['hide-backend']['enabled']) && $settings['hide-backend']['enabled']) {
44
+ if ( isset( $settings['hide-backend']['slug'] ) && $settings['hide-backend']['slug'] <> '' ) {
45
+ defined( 'HMW_DEFAULT_LOGIN' ) || define( 'HMW_DEFAULT_LOGIN', $settings['hide-backend']['slug'] );
46
+ HMW_Classes_Tools::$options['hmw_login_url'] = HMW_Classes_Tools::$default['hmw_login_url'];
47
+ }
48
+ }
49
+ }
50
+
51
  if ( ! is_admin() ) {
52
 
53
  try {
218
 
219
  //Compatibility with Wp Fastest Cache
220
  if ( HMW_Classes_Tools::isPluginActive( 'wp-fastest-cache/wpFastestCache.php' ) ) {
221
+
222
+ add_filter( 'wpfc_buffer_callback_filter', array(
223
+ HMW_Classes_ObjController::getClass( 'HMW_Models_Rewrite' ),
224
+ 'find_replace'
225
+ ), PHP_INT_MAX );
226
+
227
  add_filter( 'hmw_laterload', array( 'HMW_Classes_Tools', 'returnTrue' ) );
228
  add_filter( 'hmw_process_buffer', array( 'HMW_Classes_Tools', 'returnTrue' ) );
229
 
models/Files.php CHANGED
@@ -213,6 +213,16 @@ class HMW_Models_Files {
213
  if ( isset( $hmw_text_mapping['from'] ) && !empty( $hmw_text_mapping['from'] ) &&
214
  isset( $hmw_text_mapping['to'] ) && !empty( $hmw_text_mapping['to'] ) ) {
215
 
 
 
 
 
 
 
 
 
 
 
216
  if ( HMW_Classes_Tools::getOption( 'hmw_mapping_classes' ) ) {
217
 
218
  foreach ( $hmw_text_mapping['from'] as $index => $from ) {
213
  if ( isset( $hmw_text_mapping['from'] ) && !empty( $hmw_text_mapping['from'] ) &&
214
  isset( $hmw_text_mapping['to'] ) && !empty( $hmw_text_mapping['to'] ) ) {
215
 
216
+ foreach ( $hmw_text_mapping['to'] as &$value ) {
217
+ if($value <> '') {
218
+ if (strpos( $value, '{rand}' ) !== false ) {
219
+ $value = str_replace( '{rand}', HMW_Classes_Tools::generateRandomString( 5 ), $value );
220
+ } elseif ( strpos( $value, '{blank}' ) !== false ) {
221
+ $value = str_replace( '{blank}', '', $value );
222
+ }
223
+ }
224
+ }
225
+
226
  if ( HMW_Classes_Tools::getOption( 'hmw_mapping_classes' ) ) {
227
 
228
  foreach ( $hmw_text_mapping['from'] as $index => $from ) {
models/Rewrite.php CHANGED
@@ -1376,7 +1376,7 @@ class HMW_Models_Rewrite {
1376
  }
1377
 
1378
  if ( $this->searchInString( $url, $paths ) ) {
1379
- if ( site_url( HMW_Classes_Tools::getOption( 'hmw_login_url' ), 'relative' ) <> $url) {
1380
  return add_query_arg( array( 'noredirect' => true ), site_url( HMW_Classes_Tools::getOption( 'hmw_login_url' ) ) );
1381
  }
1382
  }
@@ -1511,7 +1511,7 @@ class HMW_Models_Rewrite {
1511
 
1512
  if ( $this->searchInString( $url, $paths ) ) {
1513
 
1514
- if ( site_url( HMW_Classes_Tools::getOption( 'hmw_login_url' ), 'relative' ) <> $url) {
1515
  $this->getNotFound( $url );
1516
  }
1517
  }
@@ -1580,13 +1580,10 @@ class HMW_Models_Rewrite {
1580
  */
1581
  public function getNotFound( $url ) {
1582
  HMW_Debug::dump( $url );
1583
-
1584
  if ( HMW_Classes_Tools::getOption( 'hmw_url_redirect' ) == '404' ) {
1585
- global $wp_query;
1586
- $wp_query->is_404 = true;
1587
-
1588
- wp_validate_redirect( site_url( '404' ) );
1589
- wp_safe_redirect( site_url( '404' ) );
1590
  } elseif ( HMW_Classes_Tools::getOption( 'hmw_url_redirect' ) == '.' ) {
1591
  //redirect to front page
1592
  wp_redirect( site_url() );
@@ -1599,6 +1596,41 @@ class HMW_Models_Rewrite {
1599
  die();
1600
  }
1601
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1602
  /************************************* FIND AND REPLACE *****************************************/
1603
  /**
1604
  * Prepare the replace function
@@ -1711,7 +1743,7 @@ class HMW_Models_Rewrite {
1711
  //remove versions
1712
  if ( HMW_Classes_Tools::getOption( 'hmw_hide_version' ) ) {
1713
  $content = preg_replace( array(
1714
- '/[\?|&]ver=[0-9a-zA-Z._-]+/',
1715
  '/<meta[^>]*name=[\'"]generator[\'"][^>]*>/i',
1716
  '/<link[^>]*rel=[\'"]dns-prefetch[\'"][^>]*>/i'
1717
  ), '', $content );
@@ -1809,6 +1841,17 @@ class HMW_Models_Rewrite {
1809
  $hmw_text_mapping = json_decode( HMW_Classes_Tools::getOption( 'hmw_text_mapping' ), true );
1810
  if ( isset( $hmw_text_mapping['from'] ) && ! empty( $hmw_text_mapping['from'] ) &&
1811
  isset( $hmw_text_mapping['to'] ) && ! empty( $hmw_text_mapping['to'] ) ) {
 
 
 
 
 
 
 
 
 
 
 
1812
  $this->_findtextmapping = $hmw_text_mapping['from'];
1813
  $this->_replacetextmapping = $hmw_text_mapping['to'];
1814
 
1376
  }
1377
 
1378
  if ( $this->searchInString( $url, $paths ) ) {
1379
+ if ( site_url( HMW_Classes_Tools::getOption( 'hmw_login_url' ), 'relative' ) <> $url ) {
1380
  return add_query_arg( array( 'noredirect' => true ), site_url( HMW_Classes_Tools::getOption( 'hmw_login_url' ) ) );
1381
  }
1382
  }
1511
 
1512
  if ( $this->searchInString( $url, $paths ) ) {
1513
 
1514
+ if ( site_url( HMW_Classes_Tools::getOption( 'hmw_login_url' ), 'relative' ) <> $url ) {
1515
  $this->getNotFound( $url );
1516
  }
1517
  }
1580
  */
1581
  public function getNotFound( $url ) {
1582
  HMW_Debug::dump( $url );
 
1583
  if ( HMW_Classes_Tools::getOption( 'hmw_url_redirect' ) == '404' ) {
1584
+ $this->get404Page(true);
1585
+ } elseif ( HMW_Classes_Tools::getOption( 'hmw_url_redirect' ) == 'NFError' ) {
1586
+ $this->get404Page();
 
 
1587
  } elseif ( HMW_Classes_Tools::getOption( 'hmw_url_redirect' ) == '.' ) {
1588
  //redirect to front page
1589
  wp_redirect( site_url() );
1596
  die();
1597
  }
1598
 
1599
+ /**
1600
+ * Display 404 page to bump bots and bad guys
1601
+ *
1602
+ * @param bool $usetheme If true force displaying basic 404 page
1603
+ */
1604
+ function get404Page( $usetheme = false ) {
1605
+ global $wp_query;
1606
+
1607
+ if ( function_exists( 'status_header' ) ) {
1608
+ status_header( '404' );
1609
+ }
1610
+ if ( isset( $wp_query ) && is_object( $wp_query ) ) {
1611
+ $wp_query->set_404();
1612
+ }
1613
+ if ( $usetheme ) {
1614
+ $template = null;
1615
+ if ( function_exists( 'get_404_template' ) ) {
1616
+ $template = get_404_template();
1617
+ }
1618
+ if ( function_exists( 'apply_filters' ) ) {
1619
+ $template = apply_filters( 'hmwp_404_template', $template );
1620
+ }
1621
+ if ( $template && @file_exists( $template ) ) {
1622
+ ob_start();
1623
+ include( $template );
1624
+ echo $this->find_replace(ob_get_clean());
1625
+ exit;
1626
+ }
1627
+ }
1628
+
1629
+ header( 'HTTP/1.0 404 Not Found', true, 404 );
1630
+ echo '<html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL ' . esc_url( $_SERVER['REQUEST_URI'] ) . ' was not found on this server.</p></body></html>';
1631
+ exit;
1632
+ }
1633
+
1634
  /************************************* FIND AND REPLACE *****************************************/
1635
  /**
1636
  * Prepare the replace function
1743
  //remove versions
1744
  if ( HMW_Classes_Tools::getOption( 'hmw_hide_version' ) ) {
1745
  $content = preg_replace( array(
1746
+ '/[\?|&]ver=[0-9a-zA-Z\.\_\-\+]+/',
1747
  '/<meta[^>]*name=[\'"]generator[\'"][^>]*>/i',
1748
  '/<link[^>]*rel=[\'"]dns-prefetch[\'"][^>]*>/i'
1749
  ), '', $content );
1841
  $hmw_text_mapping = json_decode( HMW_Classes_Tools::getOption( 'hmw_text_mapping' ), true );
1842
  if ( isset( $hmw_text_mapping['from'] ) && ! empty( $hmw_text_mapping['from'] ) &&
1843
  isset( $hmw_text_mapping['to'] ) && ! empty( $hmw_text_mapping['to'] ) ) {
1844
+
1845
+ foreach ( $hmw_text_mapping['to'] as &$value ) {
1846
+ if($value <> '') {
1847
+ if (strpos( $value, '{rand}' ) !== false ) {
1848
+ $value = str_replace( '{rand}', HMW_Classes_Tools::generateRandomString( 5 ), $value );
1849
+ } elseif ( strpos( $value, '{blank}' ) !== false ) {
1850
+ $value = str_replace( '{blank}', '', $value );
1851
+ }
1852
+ }
1853
+ }
1854
+
1855
  $this->_findtextmapping = $hmw_text_mapping['from'];
1856
  $this->_replacetextmapping = $hmw_text_mapping['to'];
1857
 
models/Settings.php CHANGED
@@ -246,7 +246,8 @@ class HMW_Models_Settings {
246
 
247
  //Detect Invalid Names
248
  if ($validate) {
249
- if (!$this->invalidName($value)) { //if the name is valid
 
250
  //Detect Weak Names
251
  $this->weakName($value); //show weak names
252
  HMW_Classes_Tools::saveOptions($key, $value);
@@ -261,10 +262,11 @@ class HMW_Models_Settings {
261
 
262
  /**
263
  * Check invalid name and avoid errors
264
- * @param $name
 
265
  * @return bool
266
  */
267
- public function invalidName($name) {
268
  $invalid_paths = array(
269
  'index.php',
270
  'readme.html',
@@ -285,13 +287,17 @@ class HMW_Models_Settings {
285
  'xmlrpc.php',
286
  'content',
287
  'includes',
288
- 'plugins',
289
- 'themes',
290
  'css',
291
  'js',
292
  'font',
293
  'assets',
294
  );
 
 
 
 
 
 
295
  if (is_string($name) && strlen($name) > 1 && strlen($name) < 3) {
296
  HMW_Classes_Error::setError(sprintf(__("Short name detected: %s. You need to use unique paths with more than 4 chars to avoid WordPress errors.", _HMW_PLUGIN_NAME_), '<strong>' . $name . '</strong>'));
297
  return true;
246
 
247
  //Detect Invalid Names
248
  if ($validate) {
249
+ if (!$this->invalidName($key, $value)) { //if the name is valid
250
+
251
  //Detect Weak Names
252
  $this->weakName($value); //show weak names
253
  HMW_Classes_Tools::saveOptions($key, $value);
262
 
263
  /**
264
  * Check invalid name and avoid errors
265
+ * @param string $key Option name
266
+ * @param string $name Option value
267
  * @return bool
268
  */
269
+ public function invalidName($key, $name) {
270
  $invalid_paths = array(
271
  'index.php',
272
  'readme.html',
287
  'xmlrpc.php',
288
  'content',
289
  'includes',
 
 
290
  'css',
291
  'js',
292
  'font',
293
  'assets',
294
  );
295
+
296
+ if(($key <> 'hmw_themes_url' && $name == 'themes') || ($key <> 'hmw_upload_url' && $name == 'uploads')){
297
+ HMW_Classes_Error::setError(sprintf(__("Invalid name detected: %s. You need to use another name to avoid WordPress errors.", _HMW_PLUGIN_NAME_), '<strong>' . $name . '</strong>'));
298
+ return true;
299
+ }
300
+
301
  if (is_string($name) && strlen($name) > 1 && strlen($name) < 3) {
302
  HMW_Classes_Error::setError(sprintf(__("Short name detected: %s. You need to use unique paths with more than 4 chars to avoid WordPress errors.", _HMW_PLUGIN_NAME_), '<strong>' . $name . '</strong>'));
303
  return true;
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: johndarrel
3
  Tags: security, firewall, hide my wp, hide wp-admin, hide wp-login, hide wordpress, admin, ocultar mi wp, hide my site, hide my wordpress
4
  Requires at least: 4.3
5
  Tested up to: 5.5
6
- Requires PHP: 5.3
7
  Stable tag: trunk
8
  Donate link: https://wpplugins.tips/wordpress
9
  License: GPLv2 or later
@@ -305,6 +305,24 @@ Enjoy!
305
  8. Run a security check for your website and see all the vulnerabilities
306
 
307
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
308
  = 4.0.08 (13 Aug 2020 ) =
309
  * Update - WordPress Security Updates for WP 5.5
310
  * Update - Compatibility with WPML
3
  Tags: security, firewall, hide my wp, hide wp-admin, hide wp-login, hide wordpress, admin, ocultar mi wp, hide my site, hide my wordpress
4
  Requires at least: 4.3
5
  Tested up to: 5.5
6
+ Requires PHP: 5.6
7
  Stable tag: trunk
8
  Donate link: https://wpplugins.tips/wordpress
9
  License: GPLv2 or later
305
  8. Run a security check for your website and see all the vulnerabilities
306
 
307
  == Changelog ==
308
+ = 4.0.11 (03 Sept 2020 ) =
309
+ * Update - Remove version parameter from CSS and JS URLs containing the plus sign
310
+ * Update - Added {rand} in Text Mapping to show random string on change
311
+ * Update - Added {blank} in Text Mapping to show an empty string on change
312
+ * Update - Compatibility with last version WP Fastest Cache plugin
313
+ * Fix - Added a fix for noredirect param on infinite loops
314
+ * Fix - Load the 404 not found files correctly
315
+
316
+ = 4.0.10 (31 Aug 2020 ) =
317
+ * Fixed some errors cause by the last version
318
+ * Fix - Saving options in Mapping, Tweaks and Advanced when followed by Permalinks Changing abort
319
+
320
+ = 4.0.09 (27 Aug 2020 ) =
321
+ * Update - Added the version hook to remove the versions from CSS and JS
322
+ * Update - Load the login on WPEngine server with PHP7.4 when the login is set as /login
323
+ * Update - Detect Flywheel server and add the rules accordingly
324
+ * Update - Compatibility with IThemes Security on custom login
325
+
326
  = 4.0.08 (13 Aug 2020 ) =
327
  * Update - WordPress Security Updates for WP 5.5
328
  * Update - Compatibility with WPML
view/Advanced.php CHANGED
@@ -18,6 +18,7 @@
18
  <select name="hmw_url_redirect" class="form-control bg-input mb-1">
19
  <option value="." <?php selected('.', HMW_Classes_Tools::getOption('hmw_url_redirect'), true) ?>><?php _e("Front page", _HMW_PLUGIN_NAME_) ?></option>
20
  <option value="404" <?php selected('404', HMW_Classes_Tools::getOption('hmw_url_redirect'), true) ?> ><?php _e("404 page", _HMW_PLUGIN_NAME_) ?></option>
 
21
  <?php
22
  $pages = get_pages();
23
  foreach ($pages as $page) {
18
  <select name="hmw_url_redirect" class="form-control bg-input mb-1">
19
  <option value="." <?php selected('.', HMW_Classes_Tools::getOption('hmw_url_redirect'), true) ?>><?php _e("Front page", _HMW_PLUGIN_NAME_) ?></option>
20
  <option value="404" <?php selected('404', HMW_Classes_Tools::getOption('hmw_url_redirect'), true) ?> ><?php _e("404 page", _HMW_PLUGIN_NAME_) ?></option>
21
+ <option value="NFError" <?php selected('NFError', HMW_Classes_Tools::getOption('hmw_url_redirect'), true) ?> ><?php _e("404 HTML Error", _HMW_PLUGIN_NAME_) ?></option>
22
  <?php
23
  $pages = get_pages();
24
  foreach ($pages as $page) {
view/Permalinks.php CHANGED
@@ -119,7 +119,7 @@ if ( defined( 'HMW_DISABLE' ) && HMW_DISABLE ) {
119
  <h3 class="card-title bg-brown text-white p-2"><?php _e( 'Admin Settings', _HMW_PLUGIN_NAME_ ); ?>:</h3>
120
  <div class="card-body">
121
  <?php if ( defined( 'HMW_DEFAULT_ADMIN' ) && HMW_DEFAULT_ADMIN ) {
122
- echo ' <div class="text-danger col-sm-12 border-bottom border-light py-3 mx-0 my-3">' . sprintf( __( 'Your admin URL is changed by another plugin/theme in %s. To prevent errors, deactivate the other plugin who changes the admin path.', _HMW_PLUGIN_NAME_ ), '<strong>' . HMW_DEFAULT_ADMIN . '</strong>' ) . '</div>';
123
  echo '<input type="hidden" name="hmw_admin_url" value="' . HMW_Classes_Tools::$default['hmw_admin_url'] . '"/>';
124
  } else {
125
  if ( HMW_Classes_Tools::isGodaddy() ) {
@@ -171,7 +171,7 @@ if ( defined( 'HMW_DISABLE' ) && HMW_DISABLE ) {
171
  <h3 class="card-title bg-brown text-white p-2"><?php _e( 'Login Settings', _HMW_PLUGIN_NAME_ ); ?>:</h3>
172
  <div class="card-body">
173
  <?php if ( defined( 'HMW_DEFAULT_LOGIN' ) && HMW_DEFAULT_LOGIN ) {
174
- echo ' <div class="text-danger col-sm-12 border-bottom border-light py-3 mx-0 my-3">' . sprintf( __( 'Your login URL is changed by another plugin/theme in %s. To prevent errors, deactivate the other plugin who changes the login path.', _HMW_PLUGIN_NAME_ ), '<strong>' . HMW_DEFAULT_LOGIN . '</strong>' ) . '</div>';
175
  } else {
176
  ?>
177
  <div class="col-sm-12 row border-bottom border-light py-3 mx-1 my-3">
119
  <h3 class="card-title bg-brown text-white p-2"><?php _e( 'Admin Settings', _HMW_PLUGIN_NAME_ ); ?>:</h3>
120
  <div class="card-body">
121
  <?php if ( defined( 'HMW_DEFAULT_ADMIN' ) && HMW_DEFAULT_ADMIN ) {
122
+ echo ' <div class="text-danger col-sm-12 border-bottom border-light py-3 mx-0 my-3">' . sprintf( __( 'Your admin URL is changed by another plugin/theme in %s. To activate this option, disable the custom admin in the other plugin or deativate it.', _HMW_PLUGIN_NAME_ ), '<strong>' . HMW_DEFAULT_ADMIN . '</strong>' ) . '</div>';
123
  echo '<input type="hidden" name="hmw_admin_url" value="' . HMW_Classes_Tools::$default['hmw_admin_url'] . '"/>';
124
  } else {
125
  if ( HMW_Classes_Tools::isGodaddy() ) {
171
  <h3 class="card-title bg-brown text-white p-2"><?php _e( 'Login Settings', _HMW_PLUGIN_NAME_ ); ?>:</h3>
172
  <div class="card-body">
173
  <?php if ( defined( 'HMW_DEFAULT_LOGIN' ) && HMW_DEFAULT_LOGIN ) {
174
+ echo ' <div class="text-danger col-sm-12 border-bottom border-light py-3 mx-0 my-3">' . sprintf( __( 'Your login URL is changed by another plugin/theme in %s. To activate this option, disable the custom login in the other plugin or deativate it.', _HMW_PLUGIN_NAME_ ), '<strong>' . HMW_DEFAULT_LOGIN . '</strong>' ) . '</div>';
175
  } else {
176
  ?>
177
  <div class="col-sm-12 row border-bottom border-light py-3 mx-1 my-3">
view/js/settings.js CHANGED
@@ -225,7 +225,7 @@
225
  });
226
 
227
  $('#frontend_test_modal').on('hidden.bs.modal', function () {
228
- $('button[data-target=#frontend_test_modal]').hmw_loading(true);
229
  location.reload();
230
  })
231
 
225
  });
226
 
227
  $('#frontend_test_modal').on('hidden.bs.modal', function () {
228
+ $('button.frontend_test').hmw_loading(true);
229
  location.reload();
230
  })
231