WP Hide & Security Enhancer - Version 1.5.2

Version Description

  • Updated po language file
  • CDN support when using custom urls
  • Moved the action replacement for wp_redirect_admin_locations at init_adminurl()
  • Trigger the action replacement for wp_redirect_admin_locations only if new admin slug exists
  • Preserve absolute paths when doing relative replacements
  • Populate upload_dir() data with new url if apply
  • When doing reset, empty all options before fill in existing with default to ensure deprecated data is not being held anymore
Download this release

Release Info

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

Code changes from version 1.5.1.2 to 1.5.2

include/functions.class.php CHANGED
@@ -83,6 +83,8 @@
83
  //only for admins
84
  If ( ! current_user_can ( 'manage_options' ) )
85
  return FALSE;
 
 
86
 
87
  foreach($this->wph->modules as $module)
88
  {
@@ -1345,7 +1347,32 @@
1345
  $home_url = home_url();
1346
  $home_url_parsed = parse_url($home_url);
1347
  $domain_url = 'http://' . $home_url_parsed['host'];
1348
- $domain_url_ssl = 'https://' . $home_url_parsed['host'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1349
 
1350
  foreach($replacements as $old_url => $new_url)
1351
  {
@@ -1435,7 +1462,18 @@
1435
 
1436
  $text = str_ireplace( $old_url, $new_url ,$text );
1437
  }
1438
-
 
 
 
 
 
 
 
 
 
 
 
1439
  return $text;
1440
  }
1441
 
83
  //only for admins
84
  If ( ! current_user_can ( 'manage_options' ) )
85
  return FALSE;
86
+
87
+ $this->wph->settings['module_settings'] = array();
88
 
89
  foreach($this->wph->modules as $module)
90
  {
1347
  $home_url = home_url();
1348
  $home_url_parsed = parse_url($home_url);
1349
  $domain_url = 'http://' . $home_url_parsed['host'];
1350
+ $domain_url_ssl = 'https://' . $home_url_parsed['host'];
1351
+
1352
+ /**
1353
+ *
1354
+ * CDN
1355
+ *
1356
+ */
1357
+ $CDN_url = $this->get_module_item_setting('cdn_url');;
1358
+ if ( ! empty ( $CDN_url ) )
1359
+ {
1360
+ foreach($replacements as $old_url => $new_url)
1361
+ {
1362
+ $replacements[ str_replace($home_url_parsed['host'], $CDN_url, $old_url) ] = str_replace($home_url_parsed['host'], $CDN_url, $new_url);
1363
+ }
1364
+ }
1365
+
1366
+ /**
1367
+ * Preserve absolute paths
1368
+ *
1369
+ */
1370
+ $text = str_ireplace( ABSPATH, '%WPH-PLACEHOLDER-PRESERVE-ABSPATH%', $text);
1371
+ //jsonencoded
1372
+ $text = str_ireplace( trim(json_encode(ABSPATH), '"'), '%WPH-PLACEHOLDER-PRESERVE-JSON-ABSPATH%', $text);
1373
+ //urlencode
1374
+ $text = str_ireplace( trim(urlencode(ABSPATH), '"'), '%WPH-PLACEHOLDER-PRESERVE-URLENCODE-ABSPATH%', $text);
1375
+
1376
 
1377
  foreach($replacements as $old_url => $new_url)
1378
  {
1462
 
1463
  $text = str_ireplace( $old_url, $new_url ,$text );
1464
  }
1465
+
1466
+
1467
+ /**
1468
+ * Restore absolute paths
1469
+ */
1470
+ //Preserve absolute paths
1471
+ $text = str_ireplace( '%WPH-PLACEHOLDER-PRESERVE-ABSPATH%', ABSPATH, $text);
1472
+ //jsonencoded
1473
+ $text = str_ireplace( '%WPH-PLACEHOLDER-PRESERVE-JSON-ABSPATH%', trim(json_encode(ABSPATH), '"'), $text);
1474
+ //urlencode
1475
+ $text = str_ireplace( '%WPH-PLACEHOLDER-PRESERVE-URLENCODE-ABSPATH%', trim(urlencode(ABSPATH), '"'), $text);
1476
+
1477
  return $text;
1478
  }
1479
 
include/wph.class.php CHANGED
@@ -106,7 +106,6 @@
106
  */
107
  add_action( 'activated_plugin', array($this, 'activated_plugin'), 999, 2 );
108
 
109
- remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
110
 
111
  //change any links within email message
112
  add_filter('wp_mail', array($this, 'apply_for_wp_mail') , 999);
106
  */
107
  add_action( 'activated_plugin', array($this, 'activated_plugin'), 999, 2 );
108
 
 
109
 
110
  //change any links within email message
111
  add_filter('wp_mail', array($this, 'apply_for_wp_mail') , 999);
languages/wp-hide-security-enhancer.mo CHANGED
Binary file
languages/wp-hide-security-enhancer.po CHANGED
@@ -1,16 +1,18 @@
1
  msgid ""
2
  msgstr ""
3
- "Project-Id-Version: Post Types Order\n"
4
- "POT-Creation-Date: 2018-07-05 18:59+0200\n"
5
- "PO-Revision-Date: 2018-07-05 18:59+0200\n"
6
  "Last-Translator: NspCode <contact@nsp-code.com>\n"
7
- "Language-Team: \n"
 
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "X-Generator: Poedit 1.5.5\n"
12
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
- "X-Poedit-Basepath: ../\n"
 
14
  "X-Poedit-SearchPath-0: .\n"
15
 
16
  #: conflicts/wp-simple-firewall.php:93
@@ -24,168 +26,144 @@ msgstr ""
24
  msgid "Save"
25
  msgstr ""
26
 
27
- #: include/functions.class.php:228
28
  msgid "Value"
29
  msgstr ""
30
 
31
- #: include/functions.class.php:228
32
  msgid "set for"
33
  msgstr ""
34
 
35
- #: include/functions.class.php:228
36
  msgid "already in use for another option."
37
  msgstr ""
38
 
39
- #: include/functions.class.php:333
40
  msgid ""
41
  "W3 Total Cache Plugin is active, make sure you clear the cache for new "
42
  "changes to apply"
43
  msgstr ""
44
 
45
- #: include/functions.class.php:337
46
  msgid ""
47
  "WP Super Cache Plugin is active, make sure you clear the cache for new "
48
  "changes to apply"
49
  msgstr ""
50
 
51
- #: include/functions.class.php:342
52
  msgid ""
53
  "WP Fastest Cache Plugin is active, make sure you clear the cache for new "
54
  "changes to apply"
55
  msgstr ""
56
 
57
- #: include/functions.class.php:2088
58
  #, php-format
59
  msgid "The %1$s plugin header is deprecated. Use %2$s instead."
60
  msgstr ""
61
 
62
- #: include/functions.class.php:2173
63
  #, php-format
64
  msgid "By %s."
65
  msgstr ""
66
 
67
- #: include/functions.class.php:2450
68
  msgid ""
69
  "Help us to improve this plugin by sending any improvement suggestions and "
70
  "reporting any issues at "
71
  msgstr ""
72
 
73
- #: include/functions.class.php:2451
74
  msgid "Did you know there is a"
75
  msgstr ""
76
 
77
- #: include/functions.class.php:2451
78
  msgid "version of this plug-in?"
79
  msgstr ""
80
 
81
- #: include/functions.class.php:2452
82
  msgid ""
83
  "Did you find this plugin useful? Please support our work by spread the word "
84
  "about the code, or write an article about the plugin in your blog with a "
85
  "link to development site"
86
  msgstr ""
87
 
88
- #: include/wph.class.php:316
89
  msgid ""
90
  "Are you sure to reset all settings? All options will be removed. Manual "
91
  "remove of rewrite lines is required if no access from php"
92
  msgstr ""
93
 
94
- #: include/wph.class.php:353
95
  msgid ""
96
  "Your server run on WPEngine which works on Nginx rewrite rules, please check "
97
  "with WP Hide PRO version at."
98
  msgstr ""
99
 
100
- #: include/wph.class.php:358
101
  msgid ""
102
  "This plugin version can't handle MultiSite environment, please check with WP "
103
  "Hide PRO version at"
104
  msgstr ""
105
 
106
- #: include/wph.class.php:363
107
  msgid ""
108
  "Unable to launch WP Hide through mu-plugins/wp-hide-loader.php<br /> Please "
109
  "make sure this location is writable so the plugin create the required file."
110
  msgstr ""
111
 
112
- #: include/wph.class.php:369
113
  msgid ""
114
  "Permalink is required to be turned ON for WP Hide & Security Enhancer to work"
115
  msgstr ""
116
 
117
- #: include/wph.class.php:374
118
  msgid ""
119
  "<b>WP Hide</b> This plugin version can't handle this server type, please "
120
  "check with PRO version at"
121
  msgstr ""
122
 
123
- #: include/wph.class.php:385
124
  msgid ""
125
  "Unable to write custom rules to your .htaccess. Is this file writable? <br /"
126
  ">No changes are being applied."
127
  msgstr ""
128
 
129
- #: include/wph.class.php:388
130
  msgid ""
131
  "Unable to write custom rules to your web.config. Is this file writable? <br /"
132
  ">No changes are being applied."
133
  msgstr ""
134
 
135
- #: include/wph.class.php:396
136
  msgid ""
137
  "Unable to create cache folder. Is the wp-content writable? <br />No cache "
138
  "data will be available."
139
  msgstr ""
140
 
141
- #: include/wph.class.php:401
142
  msgid "All Settings where restored to default"
143
  msgstr ""
144
 
145
- #: include/wph.class.php:430
146
  msgid "Settings saved"
147
  msgstr ""
148
 
149
- #: include/wph.class.php:472
150
  msgid "Cache cleared"
151
  msgstr ""
152
 
153
- #: include/wph.class.php:787
154
  msgid "Unable to create environment static file. Is "
155
  msgstr ""
156
 
157
- #: include/wph.class.php:787
158
  msgid "writable"
159
  msgstr ""
160
 
161
- #: include/wph.class.php:787
162
  msgid "will not work correctly, so where turned off."
163
  msgstr ""
164
 
165
- #: modules/module-admin.php:45
166
- msgid "Admin"
167
- msgstr ""
168
-
169
- #: modules/module-admin.php:57
170
- msgid "WP Hide & Security Enhancer - Admin"
171
- msgstr ""
172
-
173
- #: modules/module-general.php:66
174
- msgid "General / Html"
175
- msgstr ""
176
-
177
- #: modules/module-general.php:78
178
- msgid "WP Hide & Security Enhancer - General / Html"
179
- msgstr ""
180
-
181
- #: modules/module-rewrite.php:71 modules/module-rewrite.php:82
182
- msgid "Rewrite"
183
- msgstr ""
184
-
185
- #: modules/module-rewrite.php:82
186
- msgid "WP Hide & Security Enhancer"
187
- msgstr ""
188
-
189
  #: modules/components/admin-admin_url.php:16
190
  msgid "New Admin Url"
191
  msgstr ""
@@ -353,25 +331,25 @@ msgstr ""
353
  msgid "No"
354
  msgstr ""
355
 
356
- #: modules/components/admin-admin_url.php:188
357
  msgid "Hello"
358
  msgstr ""
359
 
360
- #: modules/components/admin-admin_url.php:189
361
  msgid ""
362
  "This is an automated message to inform that your login url has been changed "
363
  "at"
364
  msgstr ""
365
 
366
- #: modules/components/admin-admin_url.php:190
367
  msgid "The new login url is"
368
  msgstr ""
369
 
370
- #: modules/components/admin-admin_url.php:191
371
  msgid "Additionality you can use this to recover the old login / admin links "
372
  msgstr ""
373
 
374
- #: modules/components/admin-admin_url.php:192
375
  msgid "Please keep this url safe for recover, if forgot"
376
  msgstr ""
377
 
@@ -404,6 +382,16 @@ msgstr ""
404
  msgid "Block default wp-login.php file from being accesible."
405
  msgstr ""
406
 
 
 
 
 
 
 
 
 
 
 
407
  #: modules/components/general-feed.php:16
408
  msgid "Remove feed|rdf|rss|rss2|atom links"
409
  msgstr ""
@@ -1052,3 +1040,35 @@ msgid ""
1052
  "Apply only if <b>New Content Path</b> is not empty. It block only for non "
1053
  "loged-in users."
1054
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
+ "Project-Id-Version: WP Hide & Security Enhancer\n"
4
+ "POT-Creation-Date: 2018-11-14 19:11+0200\n"
5
+ "PO-Revision-Date: 2018-11-14 19:11+0200\n"
6
  "Last-Translator: NspCode <contact@nsp-code.com>\n"
7
+ "Language-Team: Nsp Code\n"
8
+ "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 2.2\n"
13
  "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
14
+ "X-Poedit-Basepath: ..\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
  "X-Poedit-SearchPath-0: .\n"
17
 
18
  #: conflicts/wp-simple-firewall.php:93
26
  msgid "Save"
27
  msgstr ""
28
 
29
+ #: include/functions.class.php:230
30
  msgid "Value"
31
  msgstr ""
32
 
33
+ #: include/functions.class.php:230
34
  msgid "set for"
35
  msgstr ""
36
 
37
+ #: include/functions.class.php:230
38
  msgid "already in use for another option."
39
  msgstr ""
40
 
41
+ #: include/functions.class.php:335
42
  msgid ""
43
  "W3 Total Cache Plugin is active, make sure you clear the cache for new "
44
  "changes to apply"
45
  msgstr ""
46
 
47
+ #: include/functions.class.php:339
48
  msgid ""
49
  "WP Super Cache Plugin is active, make sure you clear the cache for new "
50
  "changes to apply"
51
  msgstr ""
52
 
53
+ #: include/functions.class.php:344
54
  msgid ""
55
  "WP Fastest Cache Plugin is active, make sure you clear the cache for new "
56
  "changes to apply"
57
  msgstr ""
58
 
59
+ #: include/functions.class.php:2126
60
  #, php-format
61
  msgid "The %1$s plugin header is deprecated. Use %2$s instead."
62
  msgstr ""
63
 
64
+ #: include/functions.class.php:2211
65
  #, php-format
66
  msgid "By %s."
67
  msgstr ""
68
 
69
+ #: include/functions.class.php:2488
70
  msgid ""
71
  "Help us to improve this plugin by sending any improvement suggestions and "
72
  "reporting any issues at "
73
  msgstr ""
74
 
75
+ #: include/functions.class.php:2489
76
  msgid "Did you know there is a"
77
  msgstr ""
78
 
79
+ #: include/functions.class.php:2489
80
  msgid "version of this plug-in?"
81
  msgstr ""
82
 
83
+ #: include/functions.class.php:2490
84
  msgid ""
85
  "Did you find this plugin useful? Please support our work by spread the word "
86
  "about the code, or write an article about the plugin in your blog with a "
87
  "link to development site"
88
  msgstr ""
89
 
90
+ #: include/wph.class.php:315
91
  msgid ""
92
  "Are you sure to reset all settings? All options will be removed. Manual "
93
  "remove of rewrite lines is required if no access from php"
94
  msgstr ""
95
 
96
+ #: include/wph.class.php:352
97
  msgid ""
98
  "Your server run on WPEngine which works on Nginx rewrite rules, please check "
99
  "with WP Hide PRO version at."
100
  msgstr ""
101
 
102
+ #: include/wph.class.php:357
103
  msgid ""
104
  "This plugin version can't handle MultiSite environment, please check with WP "
105
  "Hide PRO version at"
106
  msgstr ""
107
 
108
+ #: include/wph.class.php:362
109
  msgid ""
110
  "Unable to launch WP Hide through mu-plugins/wp-hide-loader.php<br /> Please "
111
  "make sure this location is writable so the plugin create the required file."
112
  msgstr ""
113
 
114
+ #: include/wph.class.php:368
115
  msgid ""
116
  "Permalink is required to be turned ON for WP Hide & Security Enhancer to work"
117
  msgstr ""
118
 
119
+ #: include/wph.class.php:373
120
  msgid ""
121
  "<b>WP Hide</b> This plugin version can't handle this server type, please "
122
  "check with PRO version at"
123
  msgstr ""
124
 
125
+ #: include/wph.class.php:384
126
  msgid ""
127
  "Unable to write custom rules to your .htaccess. Is this file writable? <br /"
128
  ">No changes are being applied."
129
  msgstr ""
130
 
131
+ #: include/wph.class.php:387
132
  msgid ""
133
  "Unable to write custom rules to your web.config. Is this file writable? <br /"
134
  ">No changes are being applied."
135
  msgstr ""
136
 
137
+ #: include/wph.class.php:395
138
  msgid ""
139
  "Unable to create cache folder. Is the wp-content writable? <br />No cache "
140
  "data will be available."
141
  msgstr ""
142
 
143
+ #: include/wph.class.php:400
144
  msgid "All Settings where restored to default"
145
  msgstr ""
146
 
147
+ #: include/wph.class.php:429
148
  msgid "Settings saved"
149
  msgstr ""
150
 
151
+ #: include/wph.class.php:471
152
  msgid "Cache cleared"
153
  msgstr ""
154
 
155
+ #: include/wph.class.php:786
156
  msgid "Unable to create environment static file. Is "
157
  msgstr ""
158
 
159
+ #: include/wph.class.php:786
160
  msgid "writable"
161
  msgstr ""
162
 
163
+ #: include/wph.class.php:786
164
  msgid "will not work correctly, so where turned off."
165
  msgstr ""
166
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  #: modules/components/admin-admin_url.php:16
168
  msgid "New Admin Url"
169
  msgstr ""
331
  msgid "No"
332
  msgstr ""
333
 
334
+ #: modules/components/admin-admin_url.php:190
335
  msgid "Hello"
336
  msgstr ""
337
 
338
+ #: modules/components/admin-admin_url.php:191
339
  msgid ""
340
  "This is an automated message to inform that your login url has been changed "
341
  "at"
342
  msgstr ""
343
 
344
+ #: modules/components/admin-admin_url.php:192
345
  msgid "The new login url is"
346
  msgstr ""
347
 
348
+ #: modules/components/admin-admin_url.php:193
349
  msgid "Additionality you can use this to recover the old login / admin links "
350
  msgstr ""
351
 
352
+ #: modules/components/admin-admin_url.php:194
353
  msgid "Please keep this url safe for recover, if forgot"
354
  msgstr ""
355
 
382
  msgid "Block default wp-login.php file from being accesible."
383
  msgstr ""
384
 
385
+ #: modules/components/cdn-setup.php:16
386
+ msgid "CDN Url"
387
+ msgstr ""
388
+
389
+ #: modules/components/cdn-setup.php:17
390
+ msgid ""
391
+ "Some CDN providers (like stackpath.com ) replace site assets with custom "
392
+ "url, enter here such url. Oterwise this option should stay empy."
393
+ msgstr ""
394
+
395
  #: modules/components/general-feed.php:16
396
  msgid "Remove feed|rdf|rss|rss2|atom links"
397
  msgstr ""
1040
  "Apply only if <b>New Content Path</b> is not empty. It block only for non "
1041
  "loged-in users."
1042
  msgstr ""
1043
+
1044
+ #: modules/module-admin.php:45
1045
+ msgid "Admin"
1046
+ msgstr ""
1047
+
1048
+ #: modules/module-admin.php:57
1049
+ msgid "WP Hide & Security Enhancer - Admin"
1050
+ msgstr ""
1051
+
1052
+ #: modules/module-cdn.php:43
1053
+ msgid "CDN"
1054
+ msgstr ""
1055
+
1056
+ #: modules/module-cdn.php:55
1057
+ msgid "WP Hide & Security Enhancer - CDN"
1058
+ msgstr ""
1059
+
1060
+ #: modules/module-general.php:66
1061
+ msgid "General / Html"
1062
+ msgstr ""
1063
+
1064
+ #: modules/module-general.php:78
1065
+ msgid "WP Hide & Security Enhancer - General / Html"
1066
+ msgstr ""
1067
+
1068
+ #: modules/module-rewrite.php:71 modules/module-rewrite.php:82
1069
+ msgid "Rewrite"
1070
+ msgstr ""
1071
+
1072
+ #: modules/module-rewrite.php:82
1073
+ msgid "WP Hide & Security Enhancer"
1074
+ msgstr ""
modules/components/admin-admin_url.php CHANGED
@@ -62,6 +62,8 @@
62
 
63
  if(empty($saved_field_data))
64
  return FALSE;
 
 
65
 
66
  //conflict handle with other plugins
67
  include_once(WPH_PATH . 'conflicts/wp-simple-firewall.php');
@@ -225,10 +227,7 @@
225
 
226
  $text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
227
  $text .= "RewriteRule ^".$rewrite_base."wp-admin(.+) ". $rewrite_to ."?wph-throw-404 [L]\n";
228
- $text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
229
- $text .= "RewriteRule ^".$rewrite_base."dashboard(.+) ". $rewrite_to ."?wph-throw-404 [L]\n";
230
- $text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
231
- $text .= "RewriteRule ^".$rewrite_base."admin(.+) ". $rewrite_to ."?wph-throw-404 [L]";
232
  }
233
 
234
  if($this->wph->server_web_config === TRUE)
@@ -237,14 +236,6 @@
237
  <rule name="wph-block_default_admin_url4" stopProcessing="true">
238
  <match url="^'. $rewrite_base .'wp-admin(.+)" />
239
  <action type="Rewrite" url="'. $rewrite_to .'?wph-throw-404" />
240
- </rule>
241
- <rule name="wph-block_default_admin_url5" stopProcessing="true">
242
- <match url="^'. $rewrite_base .'dashboard(.+)" />
243
- <action type="Rewrite" url="'. $rewrite_to .'?wph-throw-404" />
244
- </rule>
245
- <rule name="wph-block_default_admin_url6" stopProcessing="true">
246
- <match url="^'. $rewrite_base .'admin(.+)" />
247
- <action type="Rewrite" url="'. $rewrite_to .'?wph-throw-404" />
248
  </rule>
249
  ';
250
 
62
 
63
  if(empty($saved_field_data))
64
  return FALSE;
65
+
66
+ remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );
67
 
68
  //conflict handle with other plugins
69
  include_once(WPH_PATH . 'conflicts/wp-simple-firewall.php');
227
 
228
  $text .= "RewriteCond %{ENV:REDIRECT_STATUS} ^$\n";
229
  $text .= "RewriteRule ^".$rewrite_base."wp-admin(.+) ". $rewrite_to ."?wph-throw-404 [L]\n";
230
+
 
 
 
231
  }
232
 
233
  if($this->wph->server_web_config === TRUE)
236
  <rule name="wph-block_default_admin_url4" stopProcessing="true">
237
  <match url="^'. $rewrite_base .'wp-admin(.+)" />
238
  <action type="Rewrite" url="'. $rewrite_to .'?wph-throw-404" />
 
 
 
 
 
 
 
 
239
  </rule>
240
  ';
241
 
modules/components/cdn-setup.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ class WPH_module_cdn_setup extends WPH_module_component
6
+ {
7
+ function get_component_title()
8
+ {
9
+ return "CDN";
10
+ }
11
+
12
+ function get_module_settings()
13
+ {
14
+ $this->module_settings[] = array(
15
+ 'id' => 'cdn_url',
16
+ 'label' => __('CDN Url', 'wp-hide-security-enhancer'),
17
+ 'description' => __('Some CDN providers (like stackpath.com ) replace site assets with custom url, enter here such url. Oterwise this option should stay empy.', 'wp-hide-security-enhancer'),
18
+
19
+ 'input_type' => 'text',
20
+
21
+
22
+ 'sanitize_type' => array()
23
+
24
+ );
25
+
26
+ return $this->module_settings;
27
+ }
28
+
29
+
30
+
31
+ function _init_scripts_remove_version($saved_field_data)
32
+ {
33
+
34
+
35
+ }
36
+
37
+
38
+ }
39
+ ?>
modules/components/rewrite-new_upload_path.php CHANGED
@@ -124,7 +124,8 @@
124
 
125
  $new_url = trailingslashit( site_url() ) . $new_upload_path;
126
 
127
- //$data['baseurl'] = $new_url;
 
128
 
129
  //add replacement
130
  if(! ($this->wph->functions->replacement_exists( $this->wph->default_variables['upload_url'] )))
124
 
125
  $new_url = trailingslashit( site_url() ) . $new_upload_path;
126
 
127
+ $data['url'] = str_replace($data['baseurl'], $new_url, $data['url']);
128
+ $data['baseurl'] = $new_url;
129
 
130
  //add replacement
131
  if(! ($this->wph->functions->replacement_exists( $this->wph->default_variables['upload_url'] )))
modules/module-cdn.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
4
+
5
+ class WPH_module_cdn extends WPH_module
6
+ {
7
+
8
+ function load_components()
9
+ {
10
+
11
+ //add components
12
+ include(WPH_PATH . "/modules/components/cdn-setup.php");
13
+ $this->components[] = new WPH_module_cdn_setup();
14
+
15
+
16
+ //action available for mu-plugins
17
+ do_action('wp-hide/module_load_components', $this);
18
+
19
+ }
20
+
21
+ function use_tabs()
22
+ {
23
+
24
+ return TRUE;
25
+ }
26
+
27
+ function get_module_id()
28
+ {
29
+
30
+ return 'cdn';
31
+ }
32
+
33
+ function get_module_slug()
34
+ {
35
+
36
+ return 'wp-hide-cdn';
37
+ }
38
+
39
+ function get_interface_menu_data()
40
+ {
41
+ $interface_data = array();
42
+
43
+ $interface_data['menu_title'] = __('CDN', 'wp-hide-security-enhancer');
44
+ $interface_data['menu_slug'] = self::get_module_slug();
45
+ $interface_data['menu_position'] = 50;
46
+
47
+ return $interface_data;
48
+ }
49
+
50
+ function get_interface_data()
51
+ {
52
+
53
+ $interface_data = array();
54
+
55
+ $interface_data['title'] = __('WP Hide & Security Enhancer - CDN', 'wp-hide-security-enhancer');
56
+ $interface_data['description'] = '';
57
+ $interface_data['handle_title'] = '';
58
+
59
+ return $interface_data;
60
+
61
+ }
62
+
63
+
64
+ }
65
+
66
+
67
+ ?>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: nsp-code, tdgu
3
  Donate link: https://www.nsp-code.com/
4
  Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, wp-admin, admin hide, login change,
5
  Requires at least: 2.8
6
- Tested up to: 4.9.6
7
- Stable tag: 1.5.1.2
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress site instance using smart techniques. No files are changed on your server.
@@ -213,9 +213,13 @@ Since version 1.2 Change individual plugin urls which make them unrecognizable,
213
  * New Admin Url - Create a new admin url instead default /wp-admin. This also apply for admin-ajax.php calls
214
  * Block default Admin Url - Block default admin url and files from being accesible
215
 
 
 
 
 
216
  <br />Something is wrong with this plugin on your site? Just use the forum or get in touch with us at <a target="_blank" href="http://www.wp-hide.com">Contact</a> and we'll check it out.
217
 
218
- <br />A website example can be found at <a target="_blank" href="http://nsp-code.com/demo/wp-hide/">http://nsp-code.com/demo/wp-hide/</a>
219
 
220
  <br />Plugin homepage at <a target="_blank" href="http://www.wp-hide.com/">WordPress Hide and Security Enhancer</a>
221
 
@@ -240,7 +244,7 @@ Absolute none! No file and directory is being changed anywhere, everything is pr
240
 
241
  Everything works as before, no functionality is being breaked. You can run updates at any time.
242
 
243
- = Something is wrong, what can i do? =
244
 
245
  * First, stay calm. There will be no harm, guaranteed :)
246
  * Go to admin and change some of plugin options to see which one cause the problem. Then report it to forum or get in touch with us to fix it.
@@ -267,6 +271,15 @@ Please get in touch with us and we'll do our best to include it for a next versi
267
 
268
  == Changelog ==
269
 
 
 
 
 
 
 
 
 
 
270
  = 1.5.1.2 =
271
  * Do not redirect to new admin url unless rewrite_rules_applied()
272
  * Generate no rewrite rules if there's no options / reset
3
  Donate link: https://www.nsp-code.com/
4
  Tags: wordpress hide, hide, security, improve security, hacking, wp hide, custom login, wp-loging.php, wp-admin, admin hide, login change,
5
  Requires at least: 2.8
6
+ Tested up to: 4.9.8
7
+ Stable tag: 1.5.2
8
  License: GPLv2 or later
9
 
10
  Hide and increase Security for your WordPress site instance using smart techniques. No files are changed on your server.
213
  * New Admin Url - Create a new admin url instead default /wp-admin. This also apply for admin-ajax.php calls
214
  * Block default Admin Url - Block default admin url and files from being accesible
215
 
216
+ **CDN**
217
+
218
+ * CDN Url - Set-up CDN if apply, some providers replace site assets with custom urls.
219
+
220
  <br />Something is wrong with this plugin on your site? Just use the forum or get in touch with us at <a target="_blank" href="http://www.wp-hide.com">Contact</a> and we'll check it out.
221
 
222
+ <br />A website example can be found at <a target="_blank" href="http://nsp-code.com/demo/wp-hide/">http://nsp-code.com/demo/wp-hide/</a> or our website <a target="_blank" href="http://www.wp-hide.com/">Hide and Security Enhancer</a>
223
 
224
  <br />Plugin homepage at <a target="_blank" href="http://www.wp-hide.com/">WordPress Hide and Security Enhancer</a>
225
 
244
 
245
  Everything works as before, no functionality is being breaked. You can run updates at any time.
246
 
247
+ = Something is wrong, what can i do? How can i recover my site? =
248
 
249
  * First, stay calm. There will be no harm, guaranteed :)
250
  * Go to admin and change some of plugin options to see which one cause the problem. Then report it to forum or get in touch with us to fix it.
271
 
272
  == Changelog ==
273
 
274
+ = 1.5.2 =
275
+ * Updated po language file
276
+ * CDN support when using custom urls
277
+ * Moved the action replacement for wp_redirect_admin_locations at _init_admin_url()
278
+ * Trigger the action replacement for wp_redirect_admin_locations only if new admin slug exists
279
+ * Preserve absolute paths when doing relative replacements
280
+ * Populate upload_dir() data with new url if apply
281
+ * When doing reset, empty all options before fill in existing with default to ensure deprecated data is not being held anymore
282
+
283
  = 1.5.1.2 =
284
  * Do not redirect to new admin url unless rewrite_rules_applied()
285
  * Generate no rewrite rules if there's no options / reset
router/environment.php CHANGED
@@ -1,2 +1,2 @@
1
  <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
- $environment_variable = '{"theme":{"folder_name":"twentysixteen","mapped_name":""},"allowed_paths":["F:\/htdocs\/wp-hide.dev\/wp-content\/themes"],"cache_path":"F:\/htdocs\/wp-hide.dev\/wp-content\/cache\/wph\/","wordpress_directory":"","site_relative_path":"\/"}' ?>
1
  <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
2
+ $environment_variable = '{"theme":{"folder_name":"twentysixteen","mapped_name":"skin"},"allowed_paths":["F:\/htdocs\/wp-hide.dev\/wp-content\/themes"],"cache_path":"F:\/htdocs\/wp-hide.dev\/wp-content\/cache\/wph\/","wordpress_directory":"","site_relative_path":"\/"}' ?>
wp-hide.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.wp-hide.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.5.1.2
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.5.2
9
  Text Domain: wp-hide-security-enhancer
10
  Domain Path: /languages/
11
  */