WP Hide & Security Enhancer - Version 1.4.5.1

Version Description

  • Media Galery src images fix
  • Use separate variables for holding replacements to avoid key overwrite
Download this release

Release Info

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

Code changes from version 1.4.5 to 1.4.5.1

include/functions.class.php CHANGED
@@ -1217,9 +1217,19 @@
1217
  return $text;
1218
 
1219
  //exclude scheme to match urls without it
1220
- $_replacements = array();
1221
- $_relative_url_replacements = array();
1222
- $_relative_domain_url_replacements = array();
 
 
 
 
 
 
 
 
 
 
1223
 
1224
  $home_url = home_url();
1225
  $home_url_parsed = parse_url($home_url);
@@ -1229,19 +1239,19 @@
1229
  foreach($replacements as $old_url => $new_url)
1230
  {
1231
  //add quote to make sure it's actualy a link value and is right at the start of text
1232
- $_relative_url_replacements[ '"' . str_ireplace( $home_url, "", $old_url) ] = '"' . str_ireplace( $home_url, "", $new_url);
1233
- $_relative_url_replacements[ "'" . str_ireplace( $home_url, "", $old_url) ] = "'" . str_ireplace( $home_url, "", $new_url);
1234
 
1235
- $_relative_domain_url_replacements[ '"' . str_ireplace( $domain_url, "", $old_url) ] = '"' . str_ireplace( $domain_url, "", $new_url);
1236
- $_relative_domain_url_replacements[ "'" . str_ireplace( $domain_url, "", $old_url) ] = "'" . str_ireplace( $domain_url, "", $new_url);
1237
- $_relative_domain_url_replacements[ '"' . str_ireplace( $domain_url_ssl, "", $old_url) ] = '"' . str_ireplace( $domain_url_ssl, "", $new_url);
1238
- $_relative_domain_url_replacements[ "'" . str_ireplace( $domain_url_ssl, "", $old_url) ] = "'" . str_ireplace( $domain_url_ssl, "", $new_url);
1239
 
1240
  //match urls without protocol
1241
  $_old_url = str_ireplace( array('http:', 'https:'), "", $old_url);
1242
  $_new_url = str_ireplace( array('http:', 'https:'), "", $new_url);
1243
 
1244
- $_replacements[$_old_url] = $_new_url;
1245
 
1246
  $_old_url = str_ireplace( array('http://', 'https://'), "", $old_url);
1247
  $_new_url = str_ireplace( array('http://', 'https://'), "", $new_url);
@@ -1250,13 +1260,52 @@
1250
  }
1251
 
1252
 
 
 
 
 
 
 
1253
  $text = str_ireplace( array_keys($_replacements), array_values($_replacements) ,$text );
1254
 
1255
- //relative tp domain urls replacements; using subfolder e.g. 127.0.0.1/wp01/wordpress_site, this will be /wp01/wordpress_site
1256
- $text = str_ireplace( array_keys($_relative_domain_url_replacements), array_values($_relative_domain_url_replacements) ,$text );
1257
- //relative urls replacements
1258
- $text = str_ireplace( array_keys($_relative_url_replacements), array_values($_relative_url_replacements) ,$text );
1259
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1260
 
1261
  //check for json encoded urls
1262
  foreach($_replacements as $old_url => $new_url)
1217
  return $text;
1218
 
1219
  //exclude scheme to match urls without it
1220
+ $_replacements = array();
1221
+ //no protocol
1222
+ $_replacements_np = array();
1223
+
1224
+ //single quote ; double quote
1225
+ $_relative_url_replacements_sq = array();
1226
+ $_relative_url_replacements_dq = array();
1227
+
1228
+ //single quote ; double quote / domain url / domain ssl
1229
+ $_relative_domain_url_replacements_sq = array();
1230
+ $_relative_domain_url_replacements_dq = array();
1231
+ $_relative_domain_url_replacements_ssl_sq = array();
1232
+ $_relative_domain_url_replacements_ssl_dq = array();
1233
 
1234
  $home_url = home_url();
1235
  $home_url_parsed = parse_url($home_url);
1239
  foreach($replacements as $old_url => $new_url)
1240
  {
1241
  //add quote to make sure it's actualy a link value and is right at the start of text
1242
+ $_relative_url_replacements_dq[ '"' . str_ireplace( $home_url, "", $old_url) ] = '"' . str_ireplace( $home_url, "", $new_url);
1243
+ $_relative_url_replacements_sq[ "'" . str_ireplace( $home_url, "", $old_url) ] = "'" . str_ireplace( $home_url, "", $new_url);
1244
 
1245
+ $_relative_domain_url_replacements_dq[ '"' . str_ireplace( $domain_url, "", $old_url) ] = '"' . str_ireplace( $domain_url, "", $new_url);
1246
+ $_relative_domain_url_replacements_sq[ "'" . str_ireplace( $domain_url, "", $old_url) ] = "'" . str_ireplace( $domain_url, "", $new_url);
1247
+ $_relative_domain_url_replacements_ssl_dq[ '"' . str_ireplace( $domain_url_ssl, "", $old_url) ] = '"' . str_ireplace( $domain_url_ssl, "", $new_url);
1248
+ $_relative_domain_url_replacements_ssl_sq[ "'" . str_ireplace( $domain_url_ssl, "", $old_url) ] = "'" . str_ireplace( $domain_url_ssl, "", $new_url);
1249
 
1250
  //match urls without protocol
1251
  $_old_url = str_ireplace( array('http:', 'https:'), "", $old_url);
1252
  $_new_url = str_ireplace( array('http:', 'https:'), "", $new_url);
1253
 
1254
+ $_replacements_np[$_old_url] = $_new_url;
1255
 
1256
  $_old_url = str_ireplace( array('http://', 'https://'), "", $old_url);
1257
  $_new_url = str_ireplace( array('http://', 'https://'), "", $new_url);
1260
  }
1261
 
1262
 
1263
+ /**
1264
+ * Main replaments
1265
+ *
1266
+ * @var mixed
1267
+ */
1268
+ $text = str_ireplace( array_keys($_replacements_np), array_values($_replacements_np) ,$text );
1269
  $text = str_ireplace( array_keys($_replacements), array_values($_replacements) ,$text );
1270
 
 
 
 
 
1271
 
1272
+ /**
1273
+ * Relative tp domain urls replacements; using subfolder e.g. 127.0.0.1/wp01/wordpress_site, this will be /wp01/wordpress_site
1274
+ *
1275
+ * @var mixed
1276
+ */
1277
+ $text = str_ireplace( array_keys($_relative_domain_url_replacements_sq), array_values($_relative_domain_url_replacements_sq) ,$text );
1278
+ $text = str_ireplace( array_keys($_relative_domain_url_replacements_dq), array_values($_relative_domain_url_replacements_dq) ,$text );
1279
+ $text = str_ireplace( array_keys($_relative_domain_url_replacements_ssl_sq), array_values($_relative_domain_url_replacements_ssl_sq) ,$text );
1280
+ $text = str_ireplace( array_keys($_relative_domain_url_replacements_ssl_dq), array_values($_relative_domain_url_replacements_ssl_dq) ,$text );
1281
+
1282
+
1283
+ /**
1284
+ * Relative urls replacements
1285
+ * @var mixed
1286
+ */
1287
+ //single quote
1288
+ $text = str_ireplace( array_keys($_relative_url_replacements_sq), array_values($_relative_url_replacements_sq) ,$text );
1289
+ $text = str_ireplace( array_keys($_relative_url_replacements_dq), array_values($_relative_url_replacements_dq) ,$text );
1290
+
1291
+
1292
+ //check for json encoded urls
1293
+ foreach($_replacements_np as $old_url => $new_url)
1294
+ {
1295
+ $old_url = trim(json_encode($old_url), '"');
1296
+ $new_url = trim(json_encode($new_url), '"');
1297
+
1298
+ $text = str_ireplace( $old_url, $new_url ,$text );
1299
+ }
1300
+
1301
+ //check for url encoded urls
1302
+ foreach($_replacements_np as $old_url => $new_url)
1303
+ {
1304
+ $old_url = trim(urlencode($old_url), '"');
1305
+ $new_url = trim(urlencode($new_url), '"');
1306
+
1307
+ $text = str_ireplace( $old_url, $new_url ,$text );
1308
+ }
1309
 
1310
  //check for json encoded urls
1311
  foreach($_replacements as $old_url => $new_url)
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.nsp-code.com/donate.php
4
  Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, ap-admin, admin hide
5
  Requires at least: 2.8
6
  Tested up to: 4.8
7
- Stable tag: 1.4.5
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.
@@ -243,6 +243,10 @@ Please get in touch with us and we'll do our best to include it for a next versi
243
 
244
  == Changelog ==
245
 
 
 
 
 
246
  = 1.4.5 =
247
  * Add replacements for urls which does not contain explicit protocol e.g. http: or https:
248
  * Avada cache URLs replacements support
4
  Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, ap-admin, admin hide
5
  Requires at least: 2.8
6
  Tested up to: 4.8
7
+ Stable tag: 1.4.5.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.
243
 
244
  == Changelog ==
245
 
246
+ = 1.4.5.1 =
247
+ * Media Galery src images fix
248
+ * Use separate variables for holding replacements to avoid key overwrite
249
+
250
  = 1.4.5 =
251
  * Add replacements for urls which does not contain explicit protocol e.g. http: or https:
252
  * Avada cache URLs replacements support
router/environment.php CHANGED
@@ -0,0 +1,2 @@
 
 
1
+ <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+ $environment_variable = '{"theme":{"folder_name":"twentyfifteen","mapped_name":"layout"},"child_theme":{"folder_name":"child-theme","mapped_name":"layout-child"},"allowed_paths":["F:\/htdocs\/wp-hide-demo\/wp-content\/themes"],"cache_path":"F:\/htdocs\/wp-hide-demo\/wp-content\/cache\/wph\/","site_wordpress_relative_path":"\/","wordpress_directory":"","site_relative_path":""}' ?>
wp-hide.php CHANGED
@@ -5,7 +5,7 @@ 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.4.5
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */
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.4.5.1
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */