WordPress HTTPS (SSL) - Version 3.4.0

Version Description

  • Tested with WordPress v4.9.1
  • Many improvements to performance. Special thanks to He Shiming for help with profiling and improvements.
  • Added internal caching to Parser module to drastically reduce queries.
  • Added checks for Domain Mapping plugin.
  • Renamed Domain Mapping featured to URL Mapping to reduce confusion with Domain Mapping plugin.
  • Added ability to map both to and from HTTPS with URL Mapping.
  • Added ability to also map local resources using URL Mapping.
  • Fixed bug when external resources contained a port number, the port was not removed when testing for HTTPS.
  • External HTTPS elements on HTTP pages will now stay HTTPS.
  • Fonts should now be properly secured.
  • Added check for HTTP_X_FORWARDED_SSL header.
Download this release

Release Info

Developer Mvied
Plugin Icon wp plugin WordPress HTTPS (SSL)
Version 3.4.0
Comparing to
See all releases

Code changes from version 3.4.2 to 3.4.0

README.md CHANGED
@@ -7,7 +7,7 @@
7
  [Issue Tracker](https://github.com/Mvied/wordpress-https/issues)
8
 
9
  ### WordPress
10
- * Requires at least: 3.5
11
  * Tested up to: 4.9.1
12
 
13
  ### About
@@ -20,15 +20,6 @@ If you are still unable to resolve your issue, <a href="http://wordpress.org/sup
20
  ### Languages
21
  * Help to translate at [https://translate.wordpress.org/projects/wp-plugins/wordpress-https](https://translate.wordpress.org/projects/wp-plugins/wordpress-https)
22
 
23
- ### Roadmap
24
- * [v3.5.0](https://github.com/mvied/wordpress-https/projects/1)
25
- * Automated testing [#57](https://github.com/mvied/wordpress-https/issues/57)
26
- * Make output buffering optional [#56](https://github.com/mvied/wordpress-https/issues/56)
27
- * Store URL cache in a table to increase performance for large sites [#25](https://github.com/mvied/wordpress-https/issues/25)
28
- * Compatibility with multi-lingual websites [#42](https://github.com/mvied/wordpress-https/issues/42)
29
- * Cross-browser cookie issues on Shared SSL [#27](https://github.com/mvied/wordpress-https/issues/27)
30
- * Multisite links broken [#46](https://github.com/mvied/wordpress-https/issues/46)
31
-
32
  ### Resources
33
  * [Changelog](https://wordpress.org/extend/plugins/wordpress-https/changelog/)
34
  * [Installation](https://wordpress.org/extend/plugins/wordpress-https/installation/)
7
  [Issue Tracker](https://github.com/Mvied/wordpress-https/issues)
8
 
9
  ### WordPress
10
+ * Requires at least: 3.0
11
  * Tested up to: 4.9.1
12
 
13
  ### About
20
  ### Languages
21
  * Help to translate at [https://translate.wordpress.org/projects/wp-plugins/wordpress-https](https://translate.wordpress.org/projects/wp-plugins/wordpress-https)
22
 
 
 
 
 
 
 
 
 
 
23
  ### Resources
24
  * [Changelog](https://wordpress.org/extend/plugins/wordpress-https/changelog/)
25
  * [Installation](https://wordpress.org/extend/plugins/wordpress-https/installation/)
css/admin.css CHANGED
@@ -1,9 +1,15 @@
 
 
 
 
 
 
1
  #adminmenu .menu-top.toplevel_page_wordpress-https .wp-menu-image img {
2
  display: none;
3
  }
4
 
5
- #adminmenu .menu-top.toplevel_page_wordpress-https div.wp-menu-image:before {
6
- content: "\f160";
7
  }
8
  #side-sortables #wordpress-https .inside {
9
  padding: 0;
1
+ #adminmenu .menu-top.toplevel_page_wordpress-https.current .wp-menu-image,
2
+ #adminmenu .menu-top.toplevel_page_wordpress-https.wp-has-current-submenu .wp-menu-image,
3
+ #adminmenu .menu-top.toplevel_page_wordpress-https:hover .wp-menu-image,
4
+ #adminmenu .menu-top.toplevel_page_wordpress-https.focused .wp-menu-image {
5
+ background-position: 0% 0%;
6
+ }
7
  #adminmenu .menu-top.toplevel_page_wordpress-https .wp-menu-image img {
8
  display: none;
9
  }
10
 
11
+ #adminmenu .menu-top.toplevel_page_wordpress-https div.wp-menu-image {
12
+ background: url('../img/admin-icon.png') no-repeat 0% 100%;;
13
  }
14
  #side-sortables #wordpress-https .inside {
15
  padding: 0;
css/settings.css CHANGED
@@ -11,18 +11,10 @@
11
  margin: 0;
12
  }
13
 
14
- #wphttps-main #icon-options-https.icon32 {
15
- display: block;
16
- float: left;
17
- height: 32px;
18
- width: 32px;
19
- margin-left: 5px;
20
- background: url(../img/admin-icon32.png) no-repeat 100% 100%;
21
- }
22
- .wrap [class$=icon32]+h2 {
23
- line-height: 1em;
24
- padding: 5px 0 0 40px;
25
  }
 
26
  #wphttps-main .meta-box-sortables {
27
  margin: 0 8px;
28
  }
11
  margin: 0;
12
  }
13
 
14
+ #wphttps-main #icon-options-https {
15
+ background: url(../img/admin-icon32.png) no-repeat;
 
 
 
 
 
 
 
 
 
16
  }
17
+
18
  #wphttps-main .meta-box-sortables {
19
  margin: 0 8px;
20
  }
lib/WordPressHTTPS.php CHANGED
@@ -2,7 +2,6 @@
2
  /**
3
  * WordPress HTTPS
4
  *
5
- * @class WordPressHTTPS
6
  * @author Mike Ems
7
  * @package WordPressHTTPS
8
  *
@@ -27,29 +26,16 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
27
  /**
28
  * Local URL Cache
29
  *
30
- * @var array:string
31
  */
32
  protected $_local_url_cache = array();
33
 
34
- /**
35
- * Local HTTP URL Cache
36
- *
37
- * @var array:string
38
- */
39
- protected $_local_http_url_cache = array();
40
-
41
- /**
42
- * Local HTTPS URL Cache
43
- * @var array:string
44
- */
45
- protected $_local_https_url_cache = array();
46
-
47
  /**
48
  * Plugin Settings
49
  *
50
  * setting_name => default_value
51
  *
52
- * @var array:any
53
  */
54
  protected $_settings = array(
55
  'ssl_host' => '', // Hostname for SSL Host
@@ -58,7 +44,6 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
58
  'ssl_host_diff' => 0, // Is SSL Host different than WordPress host
59
  'ssl_host_subdomain' => 0, // Is SSL Host a subdomain of WordPress host
60
  'exclusive_https' => 0, // Redirect pages that are not secured to HTTP
61
- 'content_fixer' => 1, // Fix unsecure elements in HTML
62
  'remove_unsecure' => 0, // Remove unsecure elements from HTML
63
  'ssl_admin' => 0, // Force SSL Over Administration Panel (The same as FORCE_SSL_ADMIN)
64
  'ssl_proxy' => 0, // Proxy detection
@@ -78,7 +63,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
78
  * File extensions to be loaded securely.
79
  * File type => Array of extensions
80
  *
81
- * @var array:array
82
  */
83
  protected $_file_extensions = array(
84
  'script' => array(
@@ -102,7 +87,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
102
 
103
  /**
104
  * Default External SSL Host Mapping
105
- * @var array:array
106
  */
107
  public static $ssl_host_mapping = array(
108
  array(
@@ -143,6 +128,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
143
  /**
144
  * Get File Extensions to Secure
145
  *
 
146
  * @return array
147
  */
148
  public function getFileExtensions() {
@@ -152,6 +138,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
152
  /**
153
  * Get HTTP Url
154
  *
 
155
  * @return Mvied_Url
156
  */
157
  public function getHttpUrl() {
@@ -164,6 +151,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
164
  /**
165
  * Get HTTPS Url
166
  *
 
167
  * @return Mvied_Url
168
  */
169
  public function getHttpsUrl() {
@@ -198,6 +186,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
198
  /**
199
  * Get domains local to the WordPress installation.
200
  *
 
201
  * @return array $hosts Array of domains local to the WordPress installation.
202
  */
203
  public function getLocalDomains() {
@@ -230,6 +219,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
230
  /**
231
  * Initialize
232
  *
 
233
  * @return void
234
  */
235
  public function init() {
@@ -249,6 +239,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
249
  /**
250
  * Install
251
  *
 
252
  * @return void
253
  */
254
  public function install() {
@@ -322,17 +313,17 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
322
  }
323
  $this->setSetting('ssl_host_mapping', $mappings, $blog_id);
324
  }
325
- // Set default URL Mapping
326
- if ( $this->getSetting('ssl_host_mapping', $blog_id) == array() ) {
327
- $this->setSetting('ssl_host_mapping', WordPressHTTPS::$ssl_host_mapping, $blog_id);
328
- }
329
 
330
  // Reset cache
331
  $this->setSetting('secure_external_urls', $this->_settings['secure_external_urls'], $blog_id);
332
  $this->setSetting('unsecure_external_urls', $this->_settings['unsecure_external_urls'], $blog_id);
333
  $this->setSetting('path_cache', $this->_settings['path_cache'], $blog_id);
334
  $this->setSetting('blog_cache', $this->_settings['blog_cache'], $blog_id);
335
- $this->setSetting('hosts', $this->_settings['hosts'], $blog_id);
 
 
 
 
336
  }
337
 
338
  $this->setSetting('version', $this->getVersion(), $blog_id);
@@ -358,20 +349,14 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
358
  * @return boolean
359
  */
360
  public function isUrlLocal($url) {
361
- if(is_object($url) && !method_exists($url, "__toString")) {
362
- return false;
363
- } else if ( (string)$url == '' ) {
364
- return false;
365
- }
366
- $origUrl = (string)$url;
367
- if (array_key_exists($origUrl, $this->_local_url_cache))
368
- return $this->_local_url_cache[$origUrl];
369
  $hosts = $this->getLocalDomains();
370
  if ( ($url_parts = @parse_url($url)) && isset($url_parts['host']) && !in_array($url_parts['host'], $hosts) ) {
371
- $this->_local_url_cache[$origUrl] = false;
372
  return false;
373
  }
374
- $this->_local_url_cache[$origUrl] = true;
375
  return true;
376
  }
377
 
@@ -383,25 +368,24 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
383
  */
384
  public function makeUrlHttps( $string ) {
385
  if(is_object($string) && !method_exists($string, "__toString")) {
386
- return $string;
387
- } else if ( (string)$string == '' ) {
388
- return $string;
 
 
389
  }
390
- $origString = (string)$string;
391
- if (array_key_exists($origString, $this->_local_https_url_cache))
392
- return $this->_local_https_url_cache[$origString];
393
 
394
  // If relative, prepend appropriate path
395
  if ( strpos($string, '/') === 0 ) {
396
  if ( $this->getSetting('ssl_host_diff') && strpos($string, $this->getHttpsUrl()->getPath()) === false ) {
397
  if ( $this->getHttpUrl()->getPath() == '/' ) {
398
- $string = $this->_local_https_url_cache[$origString] = rtrim($this->getHttpsUrl()->getPath(), '/') . $string;
399
  } else {
400
- $string = $this->_local_https_url_cache[$origString] = str_replace($this->getHttpUrl()->getPath(), $this->getHttpsUrl()->getPath(), $string);
401
  }
402
  }
403
  } else if ( $url = Mvied_Url::fromString( $string ) ) {
404
- if ( $this->isUrlLocal($url) ) {
405
  if ( $url->getScheme() == 'http' || ( $url->getScheme() == 'https' && $this->getSetting('ssl_host_diff') ) ) {
406
  $has_host = ( $this->getHttpUrl()->getHost() == $this->getHttpsUrl()->getHost() ) || strpos($url, $this->getHttpsUrl()->getHost()) !== false;
407
  $has_path = ( $this->getHttpUrl()->getPath() == $this->getHttpsUrl()->getPath() ) || strpos($url, $this->getHttpsUrl()->getPath()) !== false;
@@ -424,26 +408,15 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
424
  $updated->setHost($domain);
425
  $string = str_replace($url, $updated, $string);
426
  }
427
- // specific case for admin redirect URLs
428
  if ( ( ( $this->isSsl() && !$this->getSetting('exclusive_https') ) || ( defined('FORCE_SSL_ADMIN') && constant('FORCE_SSL_ADMIN') ) || $this->getSetting('ssl_admin') ) && strpos($url, 'wp-admin') !== false && preg_match('/redirect_to=([^&]+)/i', $updated->toString(), $redirect) && isset($redirect[1]) ) {
429
  $redirect_url = $redirect[1];
430
- $string = $this->_local_https_url_cache[$origString] = str_replace($redirect_url, urlencode($this->makeUrlHttps(urldecode($redirect_url))), $updated->toString());
431
- } else if ( $url->toString() != $updated->toString() ) {
432
- // if old url does not appear in string, this is probably due to trailing slash
433
- if ( ! strpos( $url->toString(), $string ) && strpos($url->toString(), rtrim($string, '/')) ) {
434
- $string = $this->_local_https_url_cache[$origString] = str_replace( $url->toString(), $updated->toString(), rtrim($string, '/') );
435
- } else {
436
- $string = $this->_local_https_url_cache[$origString] = str_replace( $url->toString(), $updated->toString(), $string );
437
- }
438
- } else {
439
- $this->_local_https_url_cache[$origString] = $origString;
440
  }
441
  }
442
  }
443
  } else {
444
  $updated = Mvied_Url::fromString( apply_filters('https_external_url', $url->toString()) );
445
- if (!$updated || !is_string((string)$updated))
446
- return;
447
  if ( @in_array($updated->toString(), $this->getSetting('secure_external_urls')) == false && @in_array($updated->toString(), $this->getSetting('unsecure_external_urls')) == false ) {
448
  $test = clone $updated;
449
  $test->setScheme('https');
@@ -458,10 +431,8 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
458
  } else if ( in_array($updated->toString(), $this->getSetting('secure_external_urls')) ) {
459
  $updated->setScheme('https');
460
  }
461
- if ( $url->toString() == $updated->toString() ) {
462
- $this->_local_https_url_cache[$origString] = $origString;
463
- } else {
464
- $string = $this->_local_https_url_cache[$origString] = str_replace($url, $updated, $string);
465
  }
466
  }
467
  unset($test);
@@ -478,22 +449,17 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
478
  * @return string $string
479
  */
480
  public function makeUrlHttp( $string ) {
481
- if(is_object($string) && !method_exists($string, "__toString")) {
482
- return $string;
483
- } else if ( (string)$string == '' ) {
484
- return $string;
485
  }
486
- $origString = (string)$string;
487
- if (array_key_exists($origString, $this->_local_http_url_cache))
488
- return $this->_local_http_url_cache[$origString];
489
 
490
  // If relative
491
  if ( strpos($string, '/') === 0 ) {
492
  if ( $this->getSetting('ssl_host_diff') && strpos($string, $this->getHttpsUrl()->getPath()) !== false ) {
493
- $string = $this->_local_http_url_cache[$origString] = str_replace($this->getHttpsUrl()->getPath(), $this->getHttpUrl()->getPath(), $string);
494
  }
495
  } else if ( $url = Mvied_Url::fromString( $string ) ) {
496
- if ( $this->isUrlLocal($url) ) {
497
  if ( $url->getScheme() == 'https' ) {
498
  $updated = Mvied_Url::fromString(apply_filters('http_internal_url', $url->toString()));
499
  $updated->setScheme('http');
@@ -506,16 +472,12 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
506
  $redirect_url = $redirect[1];
507
  $url = str_replace($redirect_url, urlencode($this->makeUrlHttp(urldecode($redirect_url))), $url);
508
  }
509
- $string = $this->_local_http_url_cache[$origString] = str_replace($url, $updated, $string);
510
  }
511
  } else {
512
  $updated = Mvied_Url::fromString( apply_filters('http_external_url', $url->toString()) );
513
  $updated->setScheme('http');
514
- if ( $url->toString() == $updated->toString() ) {
515
- $this->_local_http_url_cache[$origString] = $origString;
516
- } else {
517
- $string = $this->_local_http_url_cache[$origString] = str_replace($url, $updated, $string);
518
- }
519
  }
520
  }
521
  unset($updated);
@@ -562,6 +524,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
562
  /**
563
  * Checks if the current page is SSL
564
  *
 
565
  * @return bool
566
  */
567
  public function isSsl() {
@@ -586,6 +549,7 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
586
  /**
587
  * Maintained for backwards compatibility.
588
  *
 
589
  * @return bool
590
  */
591
  public function is_ssl() {
@@ -639,9 +603,10 @@ class WordPressHTTPS extends Mvied_Plugin_Modular {
639
  }
640
 
641
  /**
642
- * Get relevant files and directories within WordPress
643
  *
644
- * @return array $scannedDirectories
 
645
  */
646
  public function getDirectories() {
647
  $directories = array();
2
  /**
3
  * WordPress HTTPS
4
  *
 
5
  * @author Mike Ems
6
  * @package WordPressHTTPS
7
  *
26
  /**
27
  * Local URL Cache
28
  *
29
+ * @var multitype:string
30
  */
31
  protected $_local_url_cache = array();
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  /**
34
  * Plugin Settings
35
  *
36
  * setting_name => default_value
37
  *
38
+ * @var multitype:multitype
39
  */
40
  protected $_settings = array(
41
  'ssl_host' => '', // Hostname for SSL Host
44
  'ssl_host_diff' => 0, // Is SSL Host different than WordPress host
45
  'ssl_host_subdomain' => 0, // Is SSL Host a subdomain of WordPress host
46
  'exclusive_https' => 0, // Redirect pages that are not secured to HTTP
 
47
  'remove_unsecure' => 0, // Remove unsecure elements from HTML
48
  'ssl_admin' => 0, // Force SSL Over Administration Panel (The same as FORCE_SSL_ADMIN)
49
  'ssl_proxy' => 0, // Proxy detection
63
  * File extensions to be loaded securely.
64
  * File type => Array of extensions
65
  *
66
+ * @var multitype:multitype
67
  */
68
  protected $_file_extensions = array(
69
  'script' => array(
87
 
88
  /**
89
  * Default External SSL Host Mapping
90
+ * @var multitype:multitype
91
  */
92
  public static $ssl_host_mapping = array(
93
  array(
128
  /**
129
  * Get File Extensions to Secure
130
  *
131
+ * @param none
132
  * @return array
133
  */
134
  public function getFileExtensions() {
138
  /**
139
  * Get HTTP Url
140
  *
141
+ * @param none
142
  * @return Mvied_Url
143
  */
144
  public function getHttpUrl() {
151
  /**
152
  * Get HTTPS Url
153
  *
154
+ * @param none
155
  * @return Mvied_Url
156
  */
157
  public function getHttpsUrl() {
186
  /**
187
  * Get domains local to the WordPress installation.
188
  *
189
+ * @param none
190
  * @return array $hosts Array of domains local to the WordPress installation.
191
  */
192
  public function getLocalDomains() {
219
  /**
220
  * Initialize
221
  *
222
+ * @param none
223
  * @return void
224
  */
225
  public function init() {
239
  /**
240
  * Install
241
  *
242
+ * @param none
243
  * @return void
244
  */
245
  public function install() {
313
  }
314
  $this->setSetting('ssl_host_mapping', $mappings, $blog_id);
315
  }
 
 
 
 
316
 
317
  // Reset cache
318
  $this->setSetting('secure_external_urls', $this->_settings['secure_external_urls'], $blog_id);
319
  $this->setSetting('unsecure_external_urls', $this->_settings['unsecure_external_urls'], $blog_id);
320
  $this->setSetting('path_cache', $this->_settings['path_cache'], $blog_id);
321
  $this->setSetting('blog_cache', $this->_settings['blog_cache'], $blog_id);
322
+
323
+ // Set default URL Mapping
324
+ if ( $this->getSetting('ssl_host_mapping', $blog_id) == array() ) {
325
+ $this->setSetting('ssl_host_mapping', WordPressHTTPS::$ssl_host_mapping, $blog_id);
326
+ }
327
  }
328
 
329
  $this->setSetting('version', $this->getVersion(), $blog_id);
349
  * @return boolean
350
  */
351
  public function isUrlLocal($url) {
352
+ if (array_key_exists($url, $this->_local_url_cache))
353
+ return $this->_local_url_cache[$url];
 
 
 
 
 
 
354
  $hosts = $this->getLocalDomains();
355
  if ( ($url_parts = @parse_url($url)) && isset($url_parts['host']) && !in_array($url_parts['host'], $hosts) ) {
356
+ $this->_local_url_cache[$url] = false;
357
  return false;
358
  }
359
+ $this->_local_url_cache[$url] = true;
360
  return true;
361
  }
362
 
368
  */
369
  public function makeUrlHttps( $string ) {
370
  if(is_object($string) && !method_exists($string, "__toString")) {
371
+ return false;
372
+ }
373
+
374
+ if ( (string)$string == '' ) {
375
+ return false;
376
  }
 
 
 
377
 
378
  // If relative, prepend appropriate path
379
  if ( strpos($string, '/') === 0 ) {
380
  if ( $this->getSetting('ssl_host_diff') && strpos($string, $this->getHttpsUrl()->getPath()) === false ) {
381
  if ( $this->getHttpUrl()->getPath() == '/' ) {
382
+ $string = rtrim($this->getHttpsUrl()->getPath(), '/') . $string;
383
  } else {
384
+ $string = str_replace($this->getHttpUrl()->getPath(), $this->getHttpsUrl()->getPath(), $string);
385
  }
386
  }
387
  } else if ( $url = Mvied_Url::fromString( $string ) ) {
388
+ if ( $this->isUrlLocal($string) ) {
389
  if ( $url->getScheme() == 'http' || ( $url->getScheme() == 'https' && $this->getSetting('ssl_host_diff') ) ) {
390
  $has_host = ( $this->getHttpUrl()->getHost() == $this->getHttpsUrl()->getHost() ) || strpos($url, $this->getHttpsUrl()->getHost()) !== false;
391
  $has_path = ( $this->getHttpUrl()->getPath() == $this->getHttpsUrl()->getPath() ) || strpos($url, $this->getHttpsUrl()->getPath()) !== false;
408
  $updated->setHost($domain);
409
  $string = str_replace($url, $updated, $string);
410
  }
 
411
  if ( ( ( $this->isSsl() && !$this->getSetting('exclusive_https') ) || ( defined('FORCE_SSL_ADMIN') && constant('FORCE_SSL_ADMIN') ) || $this->getSetting('ssl_admin') ) && strpos($url, 'wp-admin') !== false && preg_match('/redirect_to=([^&]+)/i', $updated->toString(), $redirect) && isset($redirect[1]) ) {
412
  $redirect_url = $redirect[1];
413
+ $string = str_replace($redirect_url, urlencode($this->makeUrlHttps(urldecode($redirect_url))), $updated->toString());
 
 
 
 
 
 
 
 
 
414
  }
415
  }
416
  }
417
  } else {
418
  $updated = Mvied_Url::fromString( apply_filters('https_external_url', $url->toString()) );
419
+ $updated->setPort(null);
 
420
  if ( @in_array($updated->toString(), $this->getSetting('secure_external_urls')) == false && @in_array($updated->toString(), $this->getSetting('unsecure_external_urls')) == false ) {
421
  $test = clone $updated;
422
  $test->setScheme('https');
431
  } else if ( in_array($updated->toString(), $this->getSetting('secure_external_urls')) ) {
432
  $updated->setScheme('https');
433
  }
434
+ if ( $url->toString() != $updated->toString() ) {
435
+ $string = str_replace($url, $updated, $string);
 
 
436
  }
437
  }
438
  unset($test);
449
  * @return string $string
450
  */
451
  public function makeUrlHttp( $string ) {
452
+ if ( (string)$string == '' ) {
453
+ return false;
 
 
454
  }
 
 
 
455
 
456
  // If relative
457
  if ( strpos($string, '/') === 0 ) {
458
  if ( $this->getSetting('ssl_host_diff') && strpos($string, $this->getHttpsUrl()->getPath()) !== false ) {
459
+ $string = str_replace($this->getHttpsUrl()->getPath(), $this->getHttpUrl()->getPath(), $string);
460
  }
461
  } else if ( $url = Mvied_Url::fromString( $string ) ) {
462
+ if ( $this->isUrlLocal($string) ) {
463
  if ( $url->getScheme() == 'https' ) {
464
  $updated = Mvied_Url::fromString(apply_filters('http_internal_url', $url->toString()));
465
  $updated->setScheme('http');
472
  $redirect_url = $redirect[1];
473
  $url = str_replace($redirect_url, urlencode($this->makeUrlHttp(urldecode($redirect_url))), $url);
474
  }
475
+ $string = str_replace($url, $updated, $string);
476
  }
477
  } else {
478
  $updated = Mvied_Url::fromString( apply_filters('http_external_url', $url->toString()) );
479
  $updated->setScheme('http');
480
+ $string = str_replace($url, $updated, $string);
 
 
 
 
481
  }
482
  }
483
  unset($updated);
524
  /**
525
  * Checks if the current page is SSL
526
  *
527
+ * @param none
528
  * @return bool
529
  */
530
  public function isSsl() {
549
  /**
550
  * Maintained for backwards compatibility.
551
  *
552
+ * @param none
553
  * @return bool
554
  */
555
  public function is_ssl() {
603
  }
604
 
605
  /**
606
+ * Get relevent files and directories within WordPress
607
  *
608
+ * @param none
609
+ * @return void
610
  */
611
  public function getDirectories() {
612
  $directories = array();
lib/WordPressHTTPS/Module/Admin.php CHANGED
@@ -18,14 +18,13 @@ class WordPressHTTPS_Module_Admin extends Mvied_Plugin_Module {
18
  * @return void
19
  */
20
  public function init() {
21
- if ( is_admin() ) {
22
- // Load on plugins page
23
- if ( strpos($_SERVER['REQUEST_URI'], 'plugins.php' ) ) {
24
- add_filter( 'plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
25
- }
26
- // Add global admin scripts
27
- add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
28
  }
 
 
 
29
  }
30
 
31
  /**
18
  * @return void
19
  */
20
  public function init() {
21
+ // Load on plugins page
22
+ if ( isset($GLOBALS['pagenow']) && $GLOBALS['pagenow'] == 'plugins.php' ) {
23
+ add_filter( 'plugin_row_meta', array(&$this, 'plugin_links'), 10, 2);
 
 
 
 
24
  }
25
+
26
+ // Add global admin scripts
27
+ add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
28
  }
29
 
30
  /**
lib/WordPressHTTPS/Module/Core.php CHANGED
@@ -12,87 +12,41 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
12
  /**
13
  * Initialize
14
  *
 
15
  * @return void
16
  */
17
  public function init() {
18
- global $wp_scripts, $wp_styles;
19
  $plugin = $this->getPlugin();
20
- $isSsl = $plugin->isSsl();
21
- if ( $plugin->getSetting('ssl_host_diff') && $isSsl ) {
22
  // Prevent WordPress' canonical redirect when using a different SSL Host
23
  remove_filter('template_redirect', 'redirect_canonical');
24
  // Add SSL Host path to rewrite rules
25
  add_filter('rewrite_rules_array', array(&$this, 'rewrite_rules'), 10, 1);
26
  }
27
 
28
- if ( $isSsl ) {
29
- wp_scripts();
30
- wp_styles();
31
- $wp_styles->base_url = $this->getPlugin()->makeUrlHttps($wp_styles->base_url);
32
- $wp_scripts->base_url = $this->getPlugin()->makeUrlHttps($wp_scripts->base_url);
33
- }
34
-
35
  // Add SSL Host to allowed redirect hosts
36
  add_filter('allowed_redirect_hosts' , array(&$this, 'allowed_redirect_hosts'), 10, 1);
37
 
38
- add_filter( 'the_permalink_rss', array( &$this, 'secure_url' ), 10 );
39
-
40
- if ( !$this->getPlugin()->getSetting('content_fixer') ) {
41
- // Filter URL's
42
- add_filter( 'home_url', array( &$this, 'secure_url' ), 10 );
43
- add_filter( 'bloginfo_url', array( &$this, 'secure_url' ), 10 );
44
- add_filter( 'logout_url', array( &$this, 'secure_url' ), 10 );
45
- add_filter( 'login_url', array( &$this, 'secure_url' ), 10 );
46
- add_filter( 'network_admin_url', array( &$this, 'secure_url' ), 10 );
47
-
48
- // Filter Element URL's
49
- add_filter( 'get_avatar', array( &$this, 'element_url' ), 10 );
50
- add_filter( 'wp_get_attachment_url', array( &$this, 'element_url' ), 10 );
51
- add_filter( 'template_directory_uri', array( &$this, 'element_url' ), 10 );
52
- add_filter( 'stylesheet_directory_uri', array( &$this, 'element_url' ), 10 );
53
- add_filter( 'plugins_url', array( &$this, 'element_url' ), 10 );
54
- add_filter( 'includes_url', array( &$this, 'element_url' ), 10 );
55
- add_filter( 'content_url', array( &$this, 'element_url' ), 10 );
56
-
57
- // Filter admin_url in admin
58
- if ( is_admin() ) {
59
- add_filter( 'admin_url', array( &$this, 'admin_url' ), 10, 2 );
60
- // Filter site_url publicly
61
- } else {
62
- if ( $isSsl ) {
63
- add_filter( 'admin_url', array( &$this, 'admin_url' ), 10, 2 );
64
- }
65
- add_filter( 'site_url', array( &$this, 'site_url' ), 10, 4 );
66
- }
67
-
68
- //add filters that provide the post or post id
69
- $filters_that_use_post = array(
70
- 'page_link',
71
- 'preview_page_link',
72
- 'post_link',
73
- 'preview_page_link',
74
- 'post_type_link',
75
- 'attachment_link',
76
- 'search_link'
77
- );
78
- foreach ( $filters_that_use_post as $filter ) {
79
- add_filter( $filter, array( &$this, 'secure_post_link' ), 10, 3 );
80
- }
81
-
82
- //add filters that don't provide a post id
83
- $filters_without_post = array(
84
- 'comment_reply_link',
85
- 'day_link',
86
- 'month_link',
87
- 'year_link',
88
- 'category_link',
89
- 'author_link',
90
- 'archives_link',
91
- 'tag_link',
92
- );
93
- foreach ( $filters_without_post as $filter ) {
94
- add_filter( $filter, array( &$this, 'secure_post_link' ), 10 );
95
- }
96
  }
97
 
98
  // Filter force_ssl
@@ -105,6 +59,18 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
105
  add_filter('force_ssl', array(&$this, 'secure_post'), 40, 3);
106
  add_filter('force_ssl', array(&$this, 'secure_exclusive'), 50, 3);
107
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  // Run install when new blog is created
109
  add_action('wpmu_new_blog', array($plugin, 'install'), 10, 0);
110
 
@@ -116,7 +82,7 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
116
  add_action('clear_auth_cookie', array(&$this, 'clear_cookies'));
117
 
118
  // Set authentication cookie
119
- if ( $isSsl ) {
120
  add_action('set_auth_cookie', array(&$this, 'set_cookie'), 10, 5);
121
  add_action('set_logged_in_cookie', array(&$this, 'set_cookie'), 10, 5);
122
  }
@@ -133,7 +99,7 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
133
  // Run proxy check
134
  if ( $plugin->getSetting('ssl_proxy') === 'auto' ) {
135
  // If page is not SSL and no proxy cookie is detected, run proxy check
136
- if ( ! $isSsl && ! isset($_COOKIE['wp_proxy']) ) {
137
  add_action('init', array(&$this, 'proxy_check'), 1);
138
  add_action('admin_init', array(&$this, 'proxy_check'), 1);
139
  // Update ssl_proxy setting if a proxy has been detected
@@ -480,7 +446,6 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
480
  public function fix_scripts() {
481
  global $wp_scripts;
482
  $plugin = $this->getPlugin();
483
- $wp_scripts->base_url = $plugin->makeUrlHttps($wp_scripts->base_url);
484
  if ( isset($wp_scripts) && sizeof($wp_scripts->registered) > 0 ) {
485
  foreach ( $wp_scripts->registered as $script ) {
486
  if ( in_array($script->handle, $wp_scripts->queue) ) {
@@ -513,7 +478,6 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
513
  public function fix_styles() {
514
  global $wp_styles;
515
  $plugin = $this->getPlugin();
516
- $wp_styles->base_url = $plugin->makeUrlHttps($wp_styles->base_url);
517
  if ( isset($wp_styles) && sizeof($wp_styles->registered) > 0 ) {
518
  foreach ( (array)$wp_styles->registered as $style ) {
519
  if ( in_array($style->handle, $wp_styles->queue) ) {
@@ -675,8 +639,8 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
675
  setcookie($cookie_name, $cookie, $expire, $cookie_path_site, $cookie_domain, $secure, true);
676
  }
677
  } else {
678
- setcookie($cookie_name, $cookie, $expire, $cookie_path_plugins, $cookie_domain, $secure, true);
679
- setcookie($cookie_name, $cookie, $expire, $cookie_path_admin, $cookie_domain, $secure, true);
680
  }
681
  }
682
 
12
  /**
13
  * Initialize
14
  *
15
+ * @param none
16
  * @return void
17
  */
18
  public function init() {
 
19
  $plugin = $this->getPlugin();
20
+ if ( $plugin->getSetting('ssl_host_diff') && $plugin->isSsl() ) {
 
21
  // Prevent WordPress' canonical redirect when using a different SSL Host
22
  remove_filter('template_redirect', 'redirect_canonical');
23
  // Add SSL Host path to rewrite rules
24
  add_filter('rewrite_rules_array', array(&$this, 'rewrite_rules'), 10, 1);
25
  }
26
 
 
 
 
 
 
 
 
27
  // Add SSL Host to allowed redirect hosts
28
  add_filter('allowed_redirect_hosts' , array(&$this, 'allowed_redirect_hosts'), 10, 1);
29
 
30
+ // Filter URL's
31
+ add_filter('bloginfo_url', array(&$this, 'secure_url'), 10);
32
+ add_filter('logout_url', array(&$this, 'secure_url'), 10);
33
+ add_filter('login_url', array(&$this, 'secure_url'), 10);
34
+ add_filter('network_admin_url', array(&$this, 'secure_url'), 10);
35
+
36
+ // Filter Element URL's
37
+ add_filter('get_avatar', array(&$this, 'element_url'), 10);
38
+ add_filter('wp_get_attachment_url', array(&$this, 'element_url'), 10);
39
+ add_filter('template_directory_uri', array(&$this, 'element_url'), 10);
40
+ add_filter('stylesheet_directory_uri', array(&$this, 'element_url'), 10);
41
+ add_filter('plugins_url', array(&$this, 'element_url'), 10);
42
+ add_filter('includes_url', array(&$this, 'element_url'), 10);
43
+
44
+ // Filter admin_url in admin
45
+ if ( is_admin() ) {
46
+ add_filter('admin_url', array(&$this, 'admin_url'), 10, 2);
47
+ // Filter site_url publicly
48
+ } else {
49
+ add_filter('site_url', array(&$this, 'site_url'), 10, 4);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  }
51
 
52
  // Filter force_ssl
59
  add_filter('force_ssl', array(&$this, 'secure_post'), 40, 3);
60
  add_filter('force_ssl', array(&$this, 'secure_exclusive'), 50, 3);
61
 
62
+ //add filters that provide the post or post id
63
+ $filters_that_use_post = array('page_link', 'preview_page_link', 'post_link', 'preview_page_link', 'post_type_link', 'attachment_link', 'search_link');
64
+ foreach( $filters_that_use_post as $filter ) {
65
+ add_filter($filter, array(&$this, 'secure_post_link'), 10, 3);
66
+ }
67
+
68
+ //add filters that don't provide a post id
69
+ $filters_without_post = array('comment_reply_link', 'day_link', 'month_link', 'year_link','category_link', 'author_link', 'archives_link', 'tag_link',);
70
+ foreach( $filters_without_post as $filter ) {
71
+ add_filter($filter, array(&$this, 'secure_post_link'), 10);
72
+ }
73
+
74
  // Run install when new blog is created
75
  add_action('wpmu_new_blog', array($plugin, 'install'), 10, 0);
76
 
82
  add_action('clear_auth_cookie', array(&$this, 'clear_cookies'));
83
 
84
  // Set authentication cookie
85
+ if ( $plugin->isSsl() ) {
86
  add_action('set_auth_cookie', array(&$this, 'set_cookie'), 10, 5);
87
  add_action('set_logged_in_cookie', array(&$this, 'set_cookie'), 10, 5);
88
  }
99
  // Run proxy check
100
  if ( $plugin->getSetting('ssl_proxy') === 'auto' ) {
101
  // If page is not SSL and no proxy cookie is detected, run proxy check
102
+ if ( ! $plugin->isSsl() && ! isset($_COOKIE['wp_proxy']) ) {
103
  add_action('init', array(&$this, 'proxy_check'), 1);
104
  add_action('admin_init', array(&$this, 'proxy_check'), 1);
105
  // Update ssl_proxy setting if a proxy has been detected
446
  public function fix_scripts() {
447
  global $wp_scripts;
448
  $plugin = $this->getPlugin();
 
449
  if ( isset($wp_scripts) && sizeof($wp_scripts->registered) > 0 ) {
450
  foreach ( $wp_scripts->registered as $script ) {
451
  if ( in_array($script->handle, $wp_scripts->queue) ) {
478
  public function fix_styles() {
479
  global $wp_styles;
480
  $plugin = $this->getPlugin();
 
481
  if ( isset($wp_styles) && sizeof($wp_styles->registered) > 0 ) {
482
  foreach ( (array)$wp_styles->registered as $style ) {
483
  if ( in_array($style->handle, $wp_styles->queue) ) {
639
  setcookie($cookie_name, $cookie, $expire, $cookie_path_site, $cookie_domain, $secure, true);
640
  }
641
  } else {
642
+ setcookie($cookie_name, $cookie, $expire, $cookie_path_plugins, $cookie_domain, false, true);
643
+ setcookie($cookie_name, $cookie, $expire, $cookie_path_admin, $cookie_domain, false, true);
644
  }
645
  }
646
 
lib/WordPressHTTPS/Module/Network.php CHANGED
@@ -27,10 +27,10 @@ class WordPressHTTPS_Module_Network extends Mvied_Plugin_Module {
27
  // Add scripts
28
  add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
29
  }
 
30
 
31
- if ( is_multisite() ) {
32
- add_action('network_admin_menu', array(&$this, 'network_admin_menu'));
33
- }
34
  }
35
  }
36
 
27
  // Add scripts
28
  add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
29
  }
30
+ }
31
 
32
+ if ( is_multisite() ) {
33
+ add_action('network_admin_menu', array(&$this, 'network_admin_menu'));
 
34
  }
35
  }
36
 
lib/WordPressHTTPS/Module/Parser.php CHANGED
@@ -25,7 +25,7 @@ class WordPressHTTPS_Module_Parser extends Mvied_Plugin_Module {
25
  * @return void
26
  */
27
  public function init() {
28
- if ( apply_filters( 'wordpress_https_parser_ob', true ) ) {
29
  // Start output buffering
30
  add_action('init', array(&$this, 'startOutputBuffering'));
31
  }
@@ -42,14 +42,12 @@ class WordPressHTTPS_Module_Parser extends Mvied_Plugin_Module {
42
  public function parseHtml( $buffer ) {
43
  $this->_html = $buffer;
44
 
45
- if ( $this->getPlugin()->getSetting('content_fixer') ) {
46
- $this->normalizeElements();
47
- $this->fixLinksAndForms();
48
- $this->fixExtensions();
49
- $this->fixElements();
50
- $this->fixCssElements();
51
- $this->fixRelativeElements();
52
- }
53
 
54
  // Output logger contents to browsers console if in Debug Mode
55
  if ( $this->getPlugin()->getSetting('debug') == true ) {
25
  * @return void
26
  */
27
  public function init() {
28
+ if ( ! is_admin() && apply_filters( 'wordpress_https_parser_ob', true ) ) {
29
  // Start output buffering
30
  add_action('init', array(&$this, 'startOutputBuffering'));
31
  }
42
  public function parseHtml( $buffer ) {
43
  $this->_html = $buffer;
44
 
45
+ $this->normalizeElements();
46
+ $this->fixLinksAndForms();
47
+ $this->fixExtensions();
48
+ $this->fixElements();
49
+ $this->fixCssElements();
50
+ $this->fixRelativeElements();
 
 
51
 
52
  // Output logger contents to browsers console if in Debug Mode
53
  if ( $this->getPlugin()->getSetting('debug') == true ) {
lib/WordPressHTTPS/Module/Settings.php CHANGED
@@ -164,7 +164,6 @@ class WordPressHTTPS_Module_Settings extends Mvied_Plugin_Module {
164
  $this->getPlugin()->setSetting('unsecure_external_urls', array());
165
  $this->getPlugin()->setSetting('path_cache', array());
166
  $this->getPlugin()->setSetting('blog_cache', array());
167
- $this->getPlugin()->setSetting('hosts', array());
168
 
169
  $this->getPlugin()->renderView('ajax_message', array('message' => $message, 'errors' => $errors, 'reload' => $reload));
170
  }
164
  $this->getPlugin()->setSetting('unsecure_external_urls', array());
165
  $this->getPlugin()->setSetting('path_cache', array());
166
  $this->getPlugin()->setSetting('blog_cache', array());
 
167
 
168
  $this->getPlugin()->renderView('ajax_message', array('message' => $message, 'errors' => $errors, 'reload' => $reload));
169
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: security, encryption, ssl, shared ssl, private ssl, public ssl, private ssl, http, https
5
  Requires at least: 3.5
6
  Tested up to: 4.9.1
7
- Stable tag: 3.4.2
8
  License: GPLv3
9
 
10
  WordPress HTTPS is intended to be an all-in-one solution to using SSL on WordPress sites.
@@ -104,16 +104,6 @@ add_filter('force_ssl', 'store_force_ssl', 10, 3);`
104
  2. Force SSL checkbox added to add/edit posts screen
105
 
106
  == Changelog ==
107
- = 3.4.2 =
108
- * [Bug] Patch issue causing insecure content errors. If you are still having issues after updating, please revert to 3.4.0 and let me know in the support forum.
109
- = 3.4.1 =
110
- * [Feature] Content Fixer is now optional in the plugin settings. This option should be on by default and is the preferred method to use the plugin.
111
- * [Feature] Output buffering optional via `wordpress_https_parser_ob` filter. <a href="https://github.com/mvied/wordpress-https/issues/56">#56</a>
112
- * [Bug] External resources being changed to local URL <a href="https://github.com/mvied/wordpress-https/issues/59">#59</a>
113
- * [Bug] Added RSS permalink to filtered URLs.
114
- * [Bug] Remove network defaults on uninstall.
115
- * [Bug] Fixed displaying of Admin CSS when `site_url` is HTTP. <a href="https://github.com/mvied/wordpress-https/issues/58">#58</a>
116
- * [Bug] Fixed issues displaying and resetting network settings introduced by 3.4.0.
117
  = 3.4.0 =
118
  * Tested with WordPress v4.9.1
119
  * Many improvements to performance. Special thanks to <a href="https://github.com/heshiming">He Shiming</a> for help with profiling and improvements.
4
  Tags: security, encryption, ssl, shared ssl, private ssl, public ssl, private ssl, http, https
5
  Requires at least: 3.5
6
  Tested up to: 4.9.1
7
+ Stable tag: 3.4.0
8
  License: GPLv3
9
 
10
  WordPress HTTPS is intended to be an all-in-one solution to using SSL on WordPress sites.
104
  2. Force SSL checkbox added to add/edit posts screen
105
 
106
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
107
  = 3.4.0 =
108
  * Tested with WordPress v4.9.1
109
  * Many improvements to performance. Special thanks to <a href="https://github.com/heshiming">He Shiming</a> for help with profiling and improvements.
uninstall.php CHANGED
@@ -8,8 +8,6 @@ if ( !defined('WP_UNINSTALL_PLUGIN') ) {
8
 
9
  $options = array(
10
  'wordpress-https_hosts',
11
- 'wordpress-https_content_fixer',
12
- 'wordpress-https_network_defaults',
13
  'wordpress-https_external_urls',
14
  'wordpress-https_secure_external_urls',
15
  'wordpress-https_unsecure_external_urls',
8
 
9
  $options = array(
10
  'wordpress-https_hosts',
 
 
11
  'wordpress-https_external_urls',
12
  'wordpress-https_secure_external_urls',
13
  'wordpress-https_unsecure_external_urls',
view/metabox/donate2.php CHANGED
@@ -1,2 +1,3 @@
1
  <script type="text/javascript">jQuery(document).ready(function($) { $('label[for="wordpress-https_donate2-hide"]').contents().filter(function(){ return this.nodeType != 1; }).wrap('<span class="label"/>'); $('#wordpress-https_donate2 h3 span, label[for="wordpress-https_donate2-hide"] .label').text('Need an SSL Certificate?'); });</script>
2
- <p style="text-align: center;">Enter promo code <strong>WPSSL</strong> to recieve a <strong style="color: #F00;">10%</strong> discount at <a <a href="https://www.certs4less.com/1071.html">certs4less.com</a>!</p>
 
1
  <script type="text/javascript">jQuery(document).ready(function($) { $('label[for="wordpress-https_donate2-hide"]').contents().filter(function(){ return this.nodeType != 1; }).wrap('<span class="label"/>'); $('#wordpress-https_donate2 h3 span, label[for="wordpress-https_donate2-hide"] .label').text('Need an SSL Certificate?'); });</script>
2
+ <p style="text-align: center;">Enter promo code <strong>WPSSL</strong> to recieve a <strong style="color: #F00;">10%</strong> discount at <a <a href="https://www.certs4less.com/1071.html">certs4less.com</a>!</p>
3
+ <!-- <p style="text-align: center;"><a href="https://www.certs4less.com/1071.html" target="_blank"><img style="border: 0; max-width: 100%;" src="https://wordpresshttps.com/client/c4l_250x250-3.gif" width="250" height="250" alt="Certs 4 Less SSL Banner"></a></p> -->
view/metabox/feedback.php CHANGED
@@ -1 +1 @@
1
- <p>Please show your appreciation for WordPress HTTPS by giving it a positive <a href="https://wordpress.org/support/plugin/wordpress-https/reviews/#new-post" target="_blank">review</a> in the plugin repository!</p>
1
+ <p>Please show your appreciation for WordPress HTTPS by giving it a positive <a href="http://wordpress.org/support/view/plugin-reviews/wordpress-https#postform" target="_blank">review</a> in the plugin repository!</p>
view/metabox/network.php CHANGED
@@ -12,7 +12,6 @@ if ( !defined('ABSPATH') ) exit;
12
  <th class="blog-host"><?php _e('SSL Host','wordpress-https'); ?></th>
13
  <th class="blog-ssl_admin"><?php _e('Force SSL Admin','wordpress-https'); ?></th>
14
  <th class="blog-exclusive_https"><?php _e('Force SSL Exclusively','wordpress-https'); ?></th>
15
- <th class="blog-content_fixer"><?php _e('Content Fixer','wordpress-https'); ?></th>
16
  <th class="blog-remove_unsecure"><?php _e('Remove Unsecure Elements','wordpress-https'); ?></th>
17
  <th class="blog-debug"><?php _e('Debug Mode','wordpress-https'); ?></th>
18
  <th class="blog-proxy"><?php _e('Proxy','wordpress-https'); ?></th>
@@ -33,7 +32,6 @@ if ( !defined('ABSPATH') ) exit;
33
  <td class="blog-host"><input name="blog[<?php echo $blog_id; ?>][ssl_host]" type="text" class="regular-text code" value="<?php echo $ssl_host; ?>" /></td>
34
  <td class="blog-ssl_admin"><input type="hidden" name="blog[<?php echo $blog_id; ?>][ssl_admin]" value="<?php echo ((force_ssl_admin() && $this->getSetting('ssl_admin', $blog_id) == 1) ? 1 : 0); ?>" /><input name="blog[<?php echo $blog_id; ?>][ssl_admin]" type="checkbox" value="1"<?php echo ((force_ssl_admin()) ? ' disabled="disabled" title="FORCE_SSL_ADMIN is true in wp-config.php"' : '') . ($this->getSetting('ssl_admin', $blog_id) ? ' checked="checked"' : ''); ?> /></td>
35
  <td class="blog-exclusive_https"><input type="hidden" name="blog[<?php echo $blog_id; ?>][exclusive_https]" value="0" /><input name="blog[<?php echo $blog_id; ?>][exclusive_https]" type="checkbox" value="1"<?php echo (($this->getSetting('exclusive_https', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
36
- <td class="blog-content_fixer"><input type="hidden" name="blog[<?php echo $blog_id; ?>][content_fixer]" value="0" /><input name="blog[<?php echo $blog_id; ?>][content_fixer]" type="checkbox" value="1"<?php echo (($this->getSetting('content_fixer', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
37
  <td class="blog-remove_unsecure"><input type="hidden" name="blog[<?php echo $blog_id; ?>][remove_unsecure]" value="0" /><input name="blog[<?php echo $blog_id; ?>][remove_unsecure]" type="checkbox" value="1"<?php echo (($this->getSetting('remove_unsecure', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
38
  <td class="blog-debug"><input type="hidden" name="blog[<?php echo $blog_id; ?>][debug]" value="0" /><input name="blog[<?php echo $blog_id; ?>][debug]" type="checkbox" value="1"<?php echo (($this->getSetting('debug', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
39
  <td class="blog-proxy">
@@ -53,11 +51,11 @@ if ( !defined('ABSPATH') ) exit;
53
  <?php
54
  }
55
 
56
- foreach( $this->getSettings() as $setting => $default ) {
57
- $defaults[$setting] = $default;
58
- }
59
- foreach( $this->getSetting('network_defaults') as $setting => $default ) {
60
- $defaults[$setting] = $default;
61
  }
62
  ?>
63
 
@@ -66,7 +64,6 @@ if ( !defined('ABSPATH') ) exit;
66
  <td class="blog-host"><input name="blog_default[ssl_host]" type="text" class="regular-text code" value="<?php echo $defaults['ssl_host']; ?>" /></td>
67
  <td class="blog-ssl_admin"><input type="hidden" name="blog_default[ssl_admin]" value="0" /><input name="blog_default[ssl_admin]" type="checkbox" value="1"<?php echo ($defaults['ssl_admin'] ? ' checked="checked"' : ''); ?> /></td>
68
  <td class="blog-exclusive_https"><input type="hidden" name="blog_default[exclusive_https]" value="0" /><input name="blog_default[exclusive_https]" type="checkbox" value="1"<?php echo ($defaults['exclusive_https'] ? ' checked="checked"' : ''); ?> /></td>
69
- <td class="blog-content_fixer"><input type="hidden" name="blog_default[content_fixer]" value="0" /><input name="blog_default[content_fixer]" type="checkbox" value="1"<?php echo ($defaults['content_fixer'] ? ' checked="checked"' : ''); ?> /></td>
70
  <td class="blog-remove_unsecure"><input type="hidden" name="blog_default[remove_unsecure]" value="0" /><input name="blog_default[remove_unsecure]" type="checkbox" value="1"<?php echo ($defaults['remove_unsecure'] ? ' checked="checked"' : ''); ?> /></td>
71
  <td class="blog-debug"><input type="hidden" name="blog_default[debug]" value="0" /><input name="blog_default[debug]" type="checkbox" value="1"<?php echo ($defaults['debug'] ? ' checked="checked"' : ''); ?> /></td>
72
  <td class="blog-proxy">
12
  <th class="blog-host"><?php _e('SSL Host','wordpress-https'); ?></th>
13
  <th class="blog-ssl_admin"><?php _e('Force SSL Admin','wordpress-https'); ?></th>
14
  <th class="blog-exclusive_https"><?php _e('Force SSL Exclusively','wordpress-https'); ?></th>
 
15
  <th class="blog-remove_unsecure"><?php _e('Remove Unsecure Elements','wordpress-https'); ?></th>
16
  <th class="blog-debug"><?php _e('Debug Mode','wordpress-https'); ?></th>
17
  <th class="blog-proxy"><?php _e('Proxy','wordpress-https'); ?></th>
32
  <td class="blog-host"><input name="blog[<?php echo $blog_id; ?>][ssl_host]" type="text" class="regular-text code" value="<?php echo $ssl_host; ?>" /></td>
33
  <td class="blog-ssl_admin"><input type="hidden" name="blog[<?php echo $blog_id; ?>][ssl_admin]" value="<?php echo ((force_ssl_admin() && $this->getSetting('ssl_admin', $blog_id) == 1) ? 1 : 0); ?>" /><input name="blog[<?php echo $blog_id; ?>][ssl_admin]" type="checkbox" value="1"<?php echo ((force_ssl_admin()) ? ' disabled="disabled" title="FORCE_SSL_ADMIN is true in wp-config.php"' : '') . ($this->getSetting('ssl_admin', $blog_id) ? ' checked="checked"' : ''); ?> /></td>
34
  <td class="blog-exclusive_https"><input type="hidden" name="blog[<?php echo $blog_id; ?>][exclusive_https]" value="0" /><input name="blog[<?php echo $blog_id; ?>][exclusive_https]" type="checkbox" value="1"<?php echo (($this->getSetting('exclusive_https', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
 
35
  <td class="blog-remove_unsecure"><input type="hidden" name="blog[<?php echo $blog_id; ?>][remove_unsecure]" value="0" /><input name="blog[<?php echo $blog_id; ?>][remove_unsecure]" type="checkbox" value="1"<?php echo (($this->getSetting('remove_unsecure', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
36
  <td class="blog-debug"><input type="hidden" name="blog[<?php echo $blog_id; ?>][debug]" value="0" /><input name="blog[<?php echo $blog_id; ?>][debug]" type="checkbox" value="1"<?php echo (($this->getSetting('debug', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
37
  <td class="blog-proxy">
51
  <?php
52
  }
53
 
54
+ $defaults = $this->getSetting('network_defaults');
55
+ if ( sizeof($defaults) == 0 ) {
56
+ foreach( $this->getSettings() as $setting => $default ) {
57
+ $defaults[$setting] = $default;
58
+ }
59
  }
60
  ?>
61
 
64
  <td class="blog-host"><input name="blog_default[ssl_host]" type="text" class="regular-text code" value="<?php echo $defaults['ssl_host']; ?>" /></td>
65
  <td class="blog-ssl_admin"><input type="hidden" name="blog_default[ssl_admin]" value="0" /><input name="blog_default[ssl_admin]" type="checkbox" value="1"<?php echo ($defaults['ssl_admin'] ? ' checked="checked"' : ''); ?> /></td>
66
  <td class="blog-exclusive_https"><input type="hidden" name="blog_default[exclusive_https]" value="0" /><input name="blog_default[exclusive_https]" type="checkbox" value="1"<?php echo ($defaults['exclusive_https'] ? ' checked="checked"' : ''); ?> /></td>
 
67
  <td class="blog-remove_unsecure"><input type="hidden" name="blog_default[remove_unsecure]" value="0" /><input name="blog_default[remove_unsecure]" type="checkbox" value="1"<?php echo ($defaults['remove_unsecure'] ? ' checked="checked"' : ''); ?> /></td>
68
  <td class="blog-debug"><input type="hidden" name="blog_default[debug]" value="0" /><input name="blog_default[debug]" type="checkbox" value="1"<?php echo ($defaults['debug'] ? ' checked="checked"' : ''); ?> /></td>
69
  <td class="blog-proxy">
view/metabox/settings.php CHANGED
@@ -49,18 +49,6 @@ $ssl_host = rtrim($ssl_host, '/');
49
  </fieldset>
50
  </td>
51
  </tr>
52
- <tr valign="top" id="content_fixer_row">
53
- <th scope="row"><?php _e('Content Fixer','wordpress-https'); ?></th>
54
- <td>
55
- <fieldset>
56
- <label for="content_fixer">
57
- <input type="hidden" name="content_fixer" value="0" />
58
- <input name="content_fixer" type="checkbox" id="content_fixer" value="1"<?php echo (($this->getSetting('content_fixer')) ? ' checked="checked"' : ''); ?> />
59
- <p class="description"><?php _e("Fixes insecure HTTP elements on HTTPS pages.",'wordpress-https'); ?></p>
60
- </label>
61
- </fieldset>
62
- </td>
63
- </tr>
64
  <tr valign="top" id="remove_unsecure_row">
65
  <th scope="row"><?php _e('Remove Unsecure Elements','wordpress-https'); ?></th>
66
  <td>
49
  </fieldset>
50
  </td>
51
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
52
  <tr valign="top" id="remove_unsecure_row">
53
  <th scope="row"><?php _e('Remove Unsecure Elements','wordpress-https'); ?></th>
54
  <td>
view/metabox/support.php CHANGED
@@ -3,4 +3,4 @@
3
  <li>Please read the introductory <a href="http://wordpress.org/extend/plugins/wordpress-https/installation/" target="_blank">Installation Guide</a>.</li>
4
  <li>If you haven't already, check out the <a href="http://wordpress.org/extend/plugins/wordpress-https/faq/" target="_blank">Frequently Asked Questions</a>.</li>
5
  </ul>
6
- <p>Still not fixed? Please <a href="https://wordpress.org/support/plugin/wordpress-https#new-post" target="_blank">start a support topic</a> and someone from the community may be able to assist you. If you need immediate assistance, I am available for hire. Unfortunately, I do not have time to support the plugin for free.</p>
3
  <li>Please read the introductory <a href="http://wordpress.org/extend/plugins/wordpress-https/installation/" target="_blank">Installation Guide</a>.</li>
4
  <li>If you haven't already, check out the <a href="http://wordpress.org/extend/plugins/wordpress-https/faq/" target="_blank">Frequently Asked Questions</a>.</li>
5
  </ul>
6
+ <p>Still not fixed? Please <a href="http://wordpress.org/support/plugin/wordpress-https" target="_blank">start a support topic</a> and someone from the community may be able to assist you. If you need immediate assistance, I am available for hire. Unfortunately, I do not have time to support the plugin for free.</p>
wordpress-https.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://mvied.com/projects/wordpress-https/
5
  Description: WordPress HTTPS is intended to be an all-in-one solution to using SSL on WordPress sites.
6
  Author: Mike Ems
7
- Version: 3.4.2
8
  Author URI: http://mvied.com/
9
 
10
  Text Domain: wordpress-https
@@ -54,7 +54,7 @@ spl_autoload_register('wphttps_autoloader');
54
  if ( ! defined('WP_UNINSTALL_PLUGIN') ) {
55
  $wordpress_https = new WordPressHTTPS;
56
  $wordpress_https->setSlug('wordpress-https');
57
- $wordpress_https->setVersion('3.4.2');
58
  $wordpress_https->setLogger(Mvied_Logger::getInstance());
59
  $wordpress_https->setDirectory(dirname(__FILE__));
60
  $wordpress_https->setModuleDirectory(dirname(__FILE__) . '/lib/WordPressHTTPS/Module/');
@@ -66,10 +66,7 @@ if ( ! defined('WP_UNINSTALL_PLUGIN') ) {
66
  // If WPHTTPS_RESET global is defined, reset settings
67
  if ( defined('WPHTTPS_RESET') && constant('WPHTTPS_RESET') == true ) {
68
  foreach($wordpress_https->getSettings() as $key => $default) {
69
- if ($key == 'ssl_host_mapping')
70
- $wordpress_https->setSetting($key, WordPressHTTPS::$ssl_host_mapping);
71
- else
72
- $wordpress_https->setSetting($key, $default);
73
  }
74
  }
75
 
4
  Plugin URI: http://mvied.com/projects/wordpress-https/
5
  Description: WordPress HTTPS is intended to be an all-in-one solution to using SSL on WordPress sites.
6
  Author: Mike Ems
7
+ Version: 3.4.0
8
  Author URI: http://mvied.com/
9
 
10
  Text Domain: wordpress-https
54
  if ( ! defined('WP_UNINSTALL_PLUGIN') ) {
55
  $wordpress_https = new WordPressHTTPS;
56
  $wordpress_https->setSlug('wordpress-https');
57
+ $wordpress_https->setVersion('3.4.0');
58
  $wordpress_https->setLogger(Mvied_Logger::getInstance());
59
  $wordpress_https->setDirectory(dirname(__FILE__));
60
  $wordpress_https->setModuleDirectory(dirname(__FILE__) . '/lib/WordPressHTTPS/Module/');
66
  // If WPHTTPS_RESET global is defined, reset settings
67
  if ( defined('WPHTTPS_RESET') && constant('WPHTTPS_RESET') == true ) {
68
  foreach($wordpress_https->getSettings() as $key => $default) {
69
+ $wordpress_https->setSetting($key, $default);
 
 
 
70
  }
71
  }
72