WP Hide & Security Enhancer - Version 1.3.9.2

Version Description

  • Fix: Use of undefined constant WPH_VERSION
Download this release

Release Info

Developer nsp-code
Plugin Icon 128x128 WP Hide & Security Enhancer
Version 1.3.9.2
Comparing to
See all releases

Code changes from version 1.3.9.1 to 1.3.9.2

include/functions.class.php CHANGED
@@ -259,6 +259,47 @@
259
  wp_redirect($new_location);
260
  die();
261
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
262
 
263
 
264
  function settings_changed_check_for_cache_plugins()
259
  wp_redirect($new_location);
260
  die();
261
  }
262
+
263
+
264
+ /**
265
+ * Attempt to copy the mu loader within mu-plugins folder
266
+ *
267
+ */
268
+ static function copy_mu_loader( $force_overwrite = FALSE )
269
+ {
270
+
271
+ //check if mu-plugins folder exists
272
+ if(! is_dir( WPMU_PLUGIN_DIR ))
273
+ {
274
+ if (! wp_mkdir_p( WPMU_PLUGIN_DIR ) )
275
+ return;
276
+ }
277
+
278
+ //check if file actually exists already
279
+ if( ! $force_overwrite )
280
+ {
281
+ if( file_exists(WPMU_PLUGIN_DIR . '/wp-hide-loader.php' ))
282
+ return;
283
+ }
284
+
285
+ //attempt to copy the file
286
+ @copy( WP_PLUGIN_DIR . '/wp-hide-security-enhancer/mu-loader/wp-hide-loader.php', WPMU_PLUGIN_DIR . '/wp-hide-loader.php' );
287
+ }
288
+
289
+
290
+ /**
291
+ * Attempt to remove the mu loader
292
+ *
293
+ */
294
+ static function unlink_mu_loader()
295
+ {
296
+ //check if file actually exists already
297
+ if( !file_exists(WPMU_PLUGIN_DIR . '/wp-hide-loader.php' ))
298
+ return;
299
+
300
+ //attempt to copy the file
301
+ @unlink ( WPMU_PLUGIN_DIR . '/wp-hide-loader.php' );
302
+ }
303
 
304
 
305
  function settings_changed_check_for_cache_plugins()
include/update.class.php CHANGED
@@ -18,8 +18,23 @@
18
  {
19
  $version = isset($this->wph->settings['version']) ? $this->wph->settings['version'] : 1;
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  if (version_compare($version, WPH_VERSION, '<'))
22
  {
 
 
23
 
24
  if(version_compare($version, '1.1', '<'))
25
  {
@@ -56,6 +71,7 @@
56
  {
57
  //flush rules
58
  add_action('wp_loaded', array($this, 'flush_rules') , -1);
 
59
 
60
  $version = '1.3';
61
  }
@@ -70,7 +86,8 @@
70
  if(version_compare($version, '1.3.2', '<'))
71
  {
72
  //flush rules
73
- add_action('wp_loaded', array($this, 'flush_rules') , -1);
 
74
 
75
  $version = '1.3.2';
76
  }
18
  {
19
  $version = isset($this->wph->settings['version']) ? $this->wph->settings['version'] : 1;
20
 
21
+ //make sure the WPH_VERSION constant is being defined,
22
+ //this issue occoured in version 1.3.9
23
+ //We set this for 1.3.9 as this is the code version whcih included the issue, all other version include the correnct data
24
+ if(!defined('WPH_VERSION') && defined('WPH_MULOADER'))
25
+ {
26
+ define('WPH_VERSION', '1.3.9');
27
+
28
+ //attempt to copy over the new version of wp-hide-loader.php
29
+ WPH_functions::copy_mu_loader( TRUE );
30
+
31
+ }
32
+
33
+
34
  if (version_compare($version, WPH_VERSION, '<'))
35
  {
36
+ //keep track of flushed rules to avoid doing it multiple times
37
+ $_triggered_flush_rules = FALSE;
38
 
39
  if(version_compare($version, '1.1', '<'))
40
  {
71
  {
72
  //flush rules
73
  add_action('wp_loaded', array($this, 'flush_rules') , -1);
74
+ $_triggered_flush_rules = TRUE;
75
 
76
  $version = '1.3';
77
  }
86
  if(version_compare($version, '1.3.2', '<'))
87
  {
88
  //flush rules
89
+ if( ! $_triggered_flush_rules )
90
+ add_action('wp_loaded', array($this, 'flush_rules') , -1);
91
 
92
  $version = '1.3.2';
93
  }
mu-loader/wp-hide-loader.php CHANGED
@@ -15,8 +15,10 @@
15
  if( !in_array( 'wp-hide-security-enhancer/wp-hide.php' , $active_plugins) )
16
  return FALSE;
17
 
18
- define('WPH_PATH', trailingslashit( dirname( WP_PLUGIN_DIR . '/wp-hide-security-enhancer/wp-hide.php' ) ) );
19
- define('WPH_MULOADER', TRUE);
 
 
20
 
21
  include_once(WPH_PATH . '/include/wph.class.php');
22
  include_once(WPH_PATH . '/include/functions.class.php');
15
  if( !in_array( 'wp-hide-security-enhancer/wp-hide.php' , $active_plugins) )
16
  return FALSE;
17
 
18
+ define('WPH_VERSION', '1.3.9');
19
+ define('WPH_PATH', trailingslashit( dirname( WP_PLUGIN_DIR . '/wp-hide-security-enhancer/wp-hide.php' ) ) );
20
+ define('WPH_MULOADER', TRUE);
21
+ define('WPH_MULOADER_VERSION', '1.1');
22
 
23
  include_once(WPH_PATH . '/include/wph.class.php');
24
  include_once(WPH_PATH . '/include/functions.class.php');
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.nsp-code.com/donate.php
4
  Tags: hide, security, improve security, hacking, wp hide, wordpress hide, custom login url, wp-loging.php, ap-admin
5
  Requires at least: 2.8
6
  Tested up to: 4.7.1
7
- Stable tag: 1.3.9.1
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
@@ -239,8 +239,11 @@ Please get in touch with us and we'll do our best to include it for a next versi
239
 
240
  == Changelog ==
241
 
 
 
 
242
  = 1.3.9.1 =
243
- * fix: Child theme settings not showing up
244
  * Use register_theme_directory if empty $wp_theme_directories
245
  * Plugin Options validation improvements for unique slug
246
 
4
  Tags: hide, security, improve security, hacking, wp hide, wordpress hide, custom login url, wp-loging.php, ap-admin
5
  Requires at least: 2.8
6
  Tested up to: 4.7.1
7
+ Stable tag: 1.3.9.2
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
239
 
240
  == Changelog ==
241
 
242
+ = 1.3.9.2 =
243
+ * Fix: Use of undefined constant WPH_VERSION
244
+
245
  = 1.3.9.1 =
246
+ * Fix: Child theme settings not showing up
247
  * Use register_theme_directory if empty $wp_theme_directories
248
  * Plugin Options validation improvements for unique slug
249
 
wp-hide.php CHANGED
@@ -5,16 +5,16 @@ Plugin URI: http://www.nsp-code.com
5
  Description: Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
6
  Author: Nsp Code
7
  Author URI: http://www.nsp-code.com
8
- Version: 1.3.9.1
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */
12
-
13
- define('WPH_VERSION', '1.3.9');
14
-
15
  if(!defined('WPH_PATH'))
16
  {
17
 
 
18
  define('WPH_PATH', plugin_dir_path(__FILE__));
19
  include_once(WPH_PATH . '/include/wph.class.php');
20
  include_once(WPH_PATH . '/include/functions.class.php');
@@ -23,7 +23,7 @@ Domain Path: /languages/
23
  include_once(WPH_PATH . '/include/module.component.class.php');
24
 
25
  //attempt to copy over the loader to mu-plugins which will be used starting next loading
26
- WPH_copy_mu_loader();
27
 
28
  global $wph;
29
  $wph = new WPH();
@@ -34,6 +34,7 @@ Domain Path: /languages/
34
  *
35
  */
36
  ob_start(array($wph, 'ob_start_callback'));
 
37
  }
38
 
39
 
@@ -68,46 +69,19 @@ Domain Path: /languages/
68
 
69
  function WPH_deactivated()
70
  {
 
71
  global $wph;
72
 
73
  $wph->uninstall = TRUE;
74
  flush_rewrite_rules();
75
 
76
  //replace the mu-loader
77
- WPH_unlink_mu_loader();
78
 
79
  //redirect to old url
80
 
81
  }
82
-
83
-
84
- function WPH_copy_mu_loader()
85
- {
86
-
87
- //check if mu-plugins folder exists
88
- if(! is_dir( WPMU_PLUGIN_DIR ))
89
- {
90
- if (! wp_mkdir_p( WPMU_PLUGIN_DIR ) )
91
- return;
92
- }
93
-
94
- //check if file actually exists already
95
- if( file_exists(WPMU_PLUGIN_DIR . '/wp-hide-loader.php' ))
96
- return;
97
-
98
- //attempt to copy the file
99
- @copy( WP_PLUGIN_DIR . '/wp-hide-security-enhancer/mu-loader/wp-hide-loader.php', WPMU_PLUGIN_DIR . '/wp-hide-loader.php' );
100
- }
101
 
102
- function WPH_unlink_mu_loader()
103
- {
104
- //check if file actually exists already
105
- if( !file_exists(WPMU_PLUGIN_DIR . '/wp-hide-loader.php' ))
106
- return;
107
-
108
- //attempt to copy the file
109
- @unlink ( WPMU_PLUGIN_DIR . '/wp-hide-loader.php' );
110
- }
111
 
112
  define('WPH_URL', plugins_url('', __FILE__));
113
 
5
  Description: Hide and increase Security for your WordPress website instance using smart techniques. No files are changed on your server.
6
  Author: Nsp Code
7
  Author URI: http://www.nsp-code.com
8
+ Version: 1.3.9.2
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */
12
+
13
+ //if mu-plugins component not being loaded trigger a later init
 
14
  if(!defined('WPH_PATH'))
15
  {
16
 
17
+ define('WPH_VERSION', '1.3.9');
18
  define('WPH_PATH', plugin_dir_path(__FILE__));
19
  include_once(WPH_PATH . '/include/wph.class.php');
20
  include_once(WPH_PATH . '/include/functions.class.php');
23
  include_once(WPH_PATH . '/include/module.component.class.php');
24
 
25
  //attempt to copy over the loader to mu-plugins which will be used starting next loading
26
+ WPH_functions::copy_mu_loader();
27
 
28
  global $wph;
29
  $wph = new WPH();
34
  *
35
  */
36
  ob_start(array($wph, 'ob_start_callback'));
37
+
38
  }
39
 
40
 
69
 
70
  function WPH_deactivated()
71
  {
72
+
73
  global $wph;
74
 
75
  $wph->uninstall = TRUE;
76
  flush_rewrite_rules();
77
 
78
  //replace the mu-loader
79
+ WPH_functions::unlink_mu_loader();
80
 
81
  //redirect to old url
82
 
83
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
 
 
 
 
 
 
 
 
 
85
 
86
  define('WPH_URL', plugins_url('', __FILE__));
87