Version Description
- Bug Fix - SSL Host option was not being saved correctly upon subsiquent saves. This was causing redirect loops for most users.
Download this release
Release Info
Developer | Mvied |
Plugin | WordPress HTTPS (SSL) |
Version | 2.0.2 |
Comparing to | |
See all releases |
Code changes from version 2.0.1 to 2.0.2
- readme.txt +200 -198
- wordpress-https.php +38 -34
readme.txt
CHANGED
@@ -1,199 +1,201 @@
|
|
1 |
-
=== WordPress HTTPS (SSL) ===
|
2 |
-
Contributors: Mvied
|
3 |
-
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=N9NFVADLVUR7A
|
4 |
-
Tags: security, encryption, ssl, shared ssl, private ssl, public ssl, private ssl, http, https
|
5 |
-
Requires at least: 2.7.0
|
6 |
-
Tested up to: 3.
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
<
|
13 |
-
<li>
|
14 |
-
<li>
|
15 |
-
<li>Force SSL
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
<li>
|
47 |
-
<li>
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
<ul>
|
55 |
-
<li>Elements loaded via JavaScript that are hard-coded to HTTP. Usually this can be fixed by altering the JavaScript calling these elements.</li>
|
56 |
-
<li>External elements that can not be delivered over HTTPS. These elements will have to be removed from the page, or hosted locally so that they can be loaded over HTTPS.</li>
|
57 |
-
<li>YouTube videos - YouTube does not allow videos to be streamed over HTTPS. YouTube videos will have to be removed from secure pages.</li>
|
58 |
-
<li>Google Maps - Loading Google maps over HTTPS requires a Google Maps API Premiere account. (<a href="http://code.google.com/apis/maps/faq.html#ssl" target="_blank">source</a>)</li>
|
59 |
-
</ul>
|
60 |
-
|
61 |
-
= Is there a hook or filter to force pages to be secure? =
|
62 |
-
|
63 |
-
Yes! Here is an example of how to use the 'force_ssl' hook to force a page to be secure.
|
64 |
-
<code>
|
65 |
-
function custom_force_ssl( $force_ssl, $post_id ) {
|
66 |
-
if ( $post_id == 5 ) {
|
67 |
-
return true
|
68 |
-
}
|
69 |
-
return $force_ssl;
|
70 |
-
}
|
71 |
-
|
72 |
-
add_filter('force_ssl' , 'custom_force_ssl', 10, 2);
|
73 |
-
</code>
|
74 |
-
|
75 |
-
== Screenshots ==
|
76 |
-
1. WordPress HTTPS Settings screen
|
77 |
-
2. Force SSL checkbox added to add/edit posts screen
|
78 |
-
|
79 |
-
== Changelog ==
|
80 |
-
|
81 |
-
= 2.0.
|
82 |
-
*
|
83 |
-
|
84 |
-
*
|
85 |
-
*
|
86 |
-
* Bug Fix -
|
87 |
-
|
88 |
-
*
|
89 |
-
|
90 |
-
*
|
91 |
-
*
|
92 |
-
*
|
93 |
-
*
|
94 |
-
*
|
95 |
-
*
|
96 |
-
*
|
97 |
-
*
|
98 |
-
*
|
99 |
-
*
|
100 |
-
*
|
101 |
-
*
|
102 |
-
|
103 |
-
*
|
104 |
-
|
105 |
-
*
|
106 |
-
*
|
107 |
-
|
108 |
-
* Bug Fix -
|
109 |
-
|
110 |
-
* Bug Fix -
|
111 |
-
* Bug Fix -
|
112 |
-
* Bug Fix - When using Shared SSL, the
|
113 |
-
* Bug Fix -
|
114 |
-
*
|
115 |
-
|
116 |
-
*
|
117 |
-
|
118 |
-
*
|
119 |
-
*
|
120 |
-
*
|
121 |
-
*
|
122 |
-
* Bug fix -
|
123 |
-
*
|
124 |
-
|
125 |
-
*
|
126 |
-
|
127 |
-
*
|
128 |
-
*
|
129 |
-
|
130 |
-
*
|
131 |
-
= 1.8 =
|
132 |
-
*
|
133 |
-
|
134 |
-
*
|
135 |
-
*
|
136 |
-
*
|
137 |
-
*
|
138 |
-
|
139 |
-
*
|
140 |
-
|
141 |
-
*
|
142 |
-
|
143 |
-
*
|
144 |
-
|
145 |
-
*
|
146 |
-
|
147 |
-
*
|
148 |
-
= 1.6.
|
149 |
-
*
|
150 |
-
= 1.6.
|
151 |
-
*
|
152 |
-
= 1.6.
|
153 |
-
*
|
154 |
-
= 1.6 =
|
155 |
-
*
|
156 |
-
|
157 |
-
*
|
158 |
-
|
159 |
-
*
|
160 |
-
= 1.5.
|
161 |
-
*
|
162 |
-
= 1.5 =
|
163 |
-
* Added the
|
164 |
-
|
165 |
-
*
|
166 |
-
|
167 |
-
*
|
168 |
-
= 1.0 =
|
169 |
-
*
|
170 |
-
|
171 |
-
|
172 |
-
*
|
173 |
-
= 0.5 =
|
174 |
-
*
|
175 |
-
= 0.
|
176 |
-
*
|
177 |
-
|
178 |
-
|
179 |
-
*
|
180 |
-
= 0.
|
181 |
-
*
|
182 |
-
= 0.
|
183 |
-
*
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
= 1.
|
189 |
-
|
190 |
-
= 1.
|
191 |
-
Version 1.
|
192 |
-
= 1.0 =
|
193 |
-
Version 1.0
|
194 |
-
= 0
|
195 |
-
|
196 |
-
= 0.
|
197 |
-
|
198 |
-
= 0.
|
|
|
|
|
199 |
Version 0.1 did not correctly detect HTTPS on IIS and possibly other servers. Please update to version 0.2 to fix this issue.
|
1 |
+
=== WordPress HTTPS (SSL) ===
|
2 |
+
Contributors: Mvied
|
3 |
+
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=N9NFVADLVUR7A
|
4 |
+
Tags: security, encryption, ssl, shared ssl, private ssl, public ssl, private ssl, http, https
|
5 |
+
Requires at least: 2.7.0
|
6 |
+
Tested up to: 3.3
|
7 |
+
|
8 |
+
WordPress HTTPS is intended to be an all-in-one solution to using SSL on WordPress sites.
|
9 |
+
|
10 |
+
== Description ==
|
11 |
+
<ul>
|
12 |
+
<li>Supports Shared and Private SSL.</li>
|
13 |
+
<li>Helps reduce or completely fix partially encrypted / mixed content errors.</li>
|
14 |
+
<li>Force SSL on a per-page basis.</li>
|
15 |
+
<li>Force SSL in admin panel.</li>
|
16 |
+
</ul>
|
17 |
+
|
18 |
+
If you're having partially encrypted/mixed content errors or other problems, please read the <a href="http://wordpress.org/extend/plugins/wordpress-https/faq/">FAQ</a>. If you're still having trouble, please <a href="http://wordpress.org/tags/wordpress-https#postform">start a support topic</a> and I will do my best to assist you.
|
19 |
+
|
20 |
+
= Known Issues =
|
21 |
+
When using a subdomain as the SSL Host, logged in cookies are not properly deleted upon logging out.
|
22 |
+
|
23 |
+
== Installation ==
|
24 |
+
|
25 |
+
1. Upload the `wordpress-https` folder to the `/wp-content/plugins/` directory.
|
26 |
+
1. Activate the plugin through the 'Plugins' menu in WordPress.
|
27 |
+
|
28 |
+
== Frequently Asked Questions ==
|
29 |
+
|
30 |
+
= How do I make my whole website secure? =
|
31 |
+
|
32 |
+
To make your entire website secure, you simply need to change your home url and site url to use HTTPS instead of HTTP. Please read <a href="http://codex.wordpress.org/Changing_The_Site_URL" target="_blank">how to change the site url</a>.
|
33 |
+
|
34 |
+
= How do I make only certain pages secure? =
|
35 |
+
|
36 |
+
In the Publish box on the add/edit post screen, a checkbox for 'Force SSL' has been added to make this process easy. See Screenshots if you're having a hard time finding it.
|
37 |
+
|
38 |
+
= I'm getting 404 errors on all of my pages. Why? =
|
39 |
+
|
40 |
+
If you're using a public/shared SSL, try disabling your custom permalink structure. Some public/shared SSL's have issues with WordPress' permalinks because of the way they are configured.
|
41 |
+
|
42 |
+
= How do I fix partially encrypted/mixed content errors? =
|
43 |
+
|
44 |
+
To identify what is causing your page(s) to be insecure, please follow the instructions below.
|
45 |
+
<ol>
|
46 |
+
<li>Download <a href="http://www.google.com/chrome" target="_blank">Google Chrome</a>.</li>
|
47 |
+
<li>Open the page you're having trouble with in Google Chrome.</li>
|
48 |
+
<li>Open the Developer Tools. <a href="http://code.google.com/chrome/devtools/docs/overview.html#access" target="_blank">How to access the Developer Tools.</a></li>
|
49 |
+
<li>Click on the Console tab.</li>
|
50 |
+
</ol>
|
51 |
+
For each item that is making your page partially encrypted, you should see an entry in the console similar to "The page at https://www.example.com/ displayed insecure content from http://www.example.com/." Note that the URL that is loading insecure content is HTTP and not HTTPS.
|
52 |
+
|
53 |
+
Most insecure content warnings can generally be resolved by changing absolute references to elements, or removing the insecure elements from the page completely. Although WordPress HTTPS does its best to fix all insecure content, there are a few cases that are impossible to fix.
|
54 |
+
<ul>
|
55 |
+
<li>Elements loaded via JavaScript that are hard-coded to HTTP. Usually this can be fixed by altering the JavaScript calling these elements.</li>
|
56 |
+
<li>External elements that can not be delivered over HTTPS. These elements will have to be removed from the page, or hosted locally so that they can be loaded over HTTPS.</li>
|
57 |
+
<li>YouTube videos - YouTube does not allow videos to be streamed over HTTPS. YouTube videos will have to be removed from secure pages.</li>
|
58 |
+
<li>Google Maps - Loading Google maps over HTTPS requires a Google Maps API Premiere account. (<a href="http://code.google.com/apis/maps/faq.html#ssl" target="_blank">source</a>)</li>
|
59 |
+
</ul>
|
60 |
+
|
61 |
+
= Is there a hook or filter to force pages to be secure? =
|
62 |
+
|
63 |
+
Yes! Here is an example of how to use the 'force_ssl' hook to force a page to be secure.
|
64 |
+
<code>
|
65 |
+
function custom_force_ssl( $force_ssl, $post_id ) {
|
66 |
+
if ( $post_id == 5 ) {
|
67 |
+
return true
|
68 |
+
}
|
69 |
+
return $force_ssl;
|
70 |
+
}
|
71 |
+
|
72 |
+
add_filter('force_ssl' , 'custom_force_ssl', 10, 2);
|
73 |
+
</code>
|
74 |
+
|
75 |
+
== Screenshots ==
|
76 |
+
1. WordPress HTTPS Settings screen
|
77 |
+
2. Force SSL checkbox added to add/edit posts screen
|
78 |
+
|
79 |
+
== Changelog ==
|
80 |
+
|
81 |
+
= 2.0.2 =
|
82 |
+
* Bug Fix - SSL Host option was not being saved correctly upon subsiquent saves. This was causing redirect loops for most users.
|
83 |
+
= 2.0.1 =
|
84 |
+
* Ensured that deprected options are removed from a WordPress installation when activating the plugin.
|
85 |
+
* Added a button to the WordPress HTTPS settings page to reset all plugin settings and cache.
|
86 |
+
* Bug Fix - URL's entered for SSL Host were not validing correctly.
|
87 |
+
* Bug Fix - External URL's were not always being identified as valid external elements.
|
88 |
+
* Bug Fix - Slight enhancement to SSL detection.
|
89 |
+
= 2.0 =
|
90 |
+
* Full support for using a custom SSL port has been added. A special thanks to <a href="http://chrisdoingweb.com/">Chris "doingweb" Antes</a> for his feedback and testing of this feature.
|
91 |
+
* Forcing pages to/from HTTPS is now pluggable using the 'force_ssl' filter.
|
92 |
+
* When using Force Shared SSL Admin, links to the admin panel will always be rewritten with the Shared SSL Host.
|
93 |
+
* When using Shared SSL, all links to post and pages from within the admin panel will use the Shared SSL Host to retain administration functionality on those pages.
|
94 |
+
* Redirects to the admin panel now hook into wp_redirect rather than using the auth_redirect pluggable function.
|
95 |
+
* Canonical redirects will now still occur on sites usinga different SSL Host, but not on secure pages.
|
96 |
+
* Cookies are now set with hooks rather than pluggable functions.
|
97 |
+
* Plugin will now delete all options and custom metadata when uninstalled.
|
98 |
+
* Added a HTTP_X_FORWARDED_PROTO check to the is_ssl function.
|
99 |
+
* Internal HTTPS Elements option has been removed. Disabling this option was never a good idea, so it was removed and the plugin will always act as it did when this option was enabled.
|
100 |
+
* External HTTPS Elements option has been removed. The handling of external elements has improved in such a way that this option is no longer required.
|
101 |
+
* Disable Automatic HTTPS option has been removed. This option should have generally been enabled anyway.
|
102 |
+
* Bug Fix - After logging in, the logged_in cookie was not being set properly. This caused the admin bar to not show up in both HTTP and HTTPS.
|
103 |
+
* Bug Fix - When using Shared SSL, the login page would not honor the redirect_to variable after a successful login.
|
104 |
+
= 1.9.2 =
|
105 |
+
* Added External URL caching to the plugin so that external elements will only be checked for once, increasing the speed of sites not using the Bypass External Check option.
|
106 |
+
* Any forms whose action points to page that has the Forced SSL option on will be updated to HTTPS even on HTTP pages.
|
107 |
+
* Bug Fix - When using Shared SSL, permalink structure was being buggy.
|
108 |
+
* Bug Fix - Certain server configurations were causing the plugin to create redirect loops when using the Force SSL Exclusively option.
|
109 |
+
= 1.9.1 =
|
110 |
+
* Bug Fix - Cookies were not being set to the correct paths when logging in, causing logins to fail.
|
111 |
+
* Bug Fix - Links to the front page when using latest posts were not correctly being set to HTTP/HTTPS.
|
112 |
+
* Bug Fix - When using Shared SSL, the HTTPS version of the site_url was not being correctly replaced with the Shared SSL URL for internal elements.
|
113 |
+
* Bug Fix - When using Shared SSL, the admin login page was not always redirecting properly due to output buffering.
|
114 |
+
* Bug Fix - When using Shared SSL, the auth_redirect function was not redirecting to the Shared SSL URL.
|
115 |
+
* Bug Fix - If the home_url contained 'www' but the URL appeared without 'www', the URL would not be fixed.
|
116 |
+
* Standards - Updated redirect method to use https or http as a an argument rather than true or false to better comply with WordPress coding standards.
|
117 |
+
= 1.9 =
|
118 |
+
* Created Updates widget on settings screen to allow for dynamic updates from the plugin developers.
|
119 |
+
* Added support for PHP4.
|
120 |
+
* Converted all spaces to tabs in source.
|
121 |
+
* Force Shared SSL Admin option added to allow those using Shared SSL the ability to use their certificate for their admin dashboard.
|
122 |
+
* Bug fix - Force SSL checkbox will now appear on WordPress versions below 2.9.
|
123 |
+
* Bug fix - Password protected pages forced to SSL will now work properly.
|
124 |
+
* Bug fix - Plugin should no longer break feeds.
|
125 |
+
* Numerous other bug fixes that have since been forgotten due to the length of time this version has been in development.
|
126 |
+
= 1.8.5 =
|
127 |
+
* In version 1.8.5, when a page is forced to HTTPS, any links to that page will always be HTTPS, even when using the 'Disable Automatic HTTPS' option. Likewise, when the 'Force SSL Exclusively' option is enabled, all links to pages not forced to HTTPS will be changed to HTTP on HTTPS pages.
|
128 |
+
* Updated RegEx's for more complicated URL's.
|
129 |
+
* Bug fix - When in the admin panel, only link URL's are changed back to HTTP again.
|
130 |
+
* Added support for using Shared SSL together with the FORCE_SSL_ADMIN and FORCE_SSL_LOGIN options.
|
131 |
+
= 1.8.1 =
|
132 |
+
* Re-enabled the canonical redirect for WordPres sites not using Shared SSL.
|
133 |
+
= 1.8 =
|
134 |
+
* Fixed cross-browser CSS issue on plugin settings page.
|
135 |
+
* Corrected and updated plugin settings validation.
|
136 |
+
* Lengthened the fade out timer on messages from the plugin settings page from 2 to 5 seconds so that the more lengthy error messages could be read before the message faded.
|
137 |
+
* If viewing an admin page via SSL, and your Home URL is not set to HTTPS, links to the front-end of the website will be forced to HTTP. By default, WordPress changes these links to HTTPS.
|
138 |
+
* When using Shared SSL, any anchor that links to the regular HTTPS version of the domain will be changed to use the Shared SSL Host.
|
139 |
+
* Added embed and param tags to the list of tags that are fixed by WordPress HTTPS. This is to fix flash movies.
|
140 |
+
= 1.7.5 =
|
141 |
+
* Bug fix - When using 'Latest Posts' as the front page, the front page would redirect to HTTP when viewed over HTTPS even if the 'Force SSL Exclusively' option was disabled.
|
142 |
+
* Prevented the 'Disable Automatic HTTPS' option from parsing URL's in the admin panel.
|
143 |
+
* General code cleanup and such.
|
144 |
+
= 1.7 =
|
145 |
+
* Bug fix - External URL's were not being forced to HTTPS after the last update.
|
146 |
+
* Added the functionality to correct relative URL's when using Shared SSL.
|
147 |
+
* General code cleanup and such.
|
148 |
+
= 1.6.5 =
|
149 |
+
* Added support for Shared SSL.
|
150 |
+
= 1.6.3 =
|
151 |
+
* Changed the redirection check to use `template_redirect` hook rather than `get_header`.
|
152 |
+
= 1.6.2 =
|
153 |
+
* Tag links were not being set back to HTTP when the 'Disable Automatic HTTPS' option was enabled.
|
154 |
+
= 1.6.1 =
|
155 |
+
* Bug fix - front page redirection was causing issues when a static page was selected for the posts page.
|
156 |
+
= 1.6 =
|
157 |
+
* Added the ability to force the front page to HTTPS.
|
158 |
+
* Multiple enhancements to core functionality of plugin. Mostly just changing code to integrate more smoothely with WordPress.
|
159 |
+
* Enhancements have been made to the plugin's settings page.
|
160 |
+
= 1.5.2 =
|
161 |
+
* Fixed a bug that would prevent stylesheets from being fixed if the rel attribute came after the href attribute. Bug could have also caused errors with other tags.
|
162 |
+
= 1.5.1 =
|
163 |
+
* Added input elements with the type of 'image' to be filtered for insecure content.
|
164 |
+
= 1.5 =
|
165 |
+
* Added the ability to force SSL on certain pages.
|
166 |
+
* Also added the option to exclusively force SSL on certain pages. Pages not forced to HTTPS are forced to HTTP.
|
167 |
+
* Plugin now filters the `bloginfo` and `bloginfo_url` functions for HTTPS URL's when the 'Disable Automatic HTTPS' option is enabled in WordPress 3.0+.
|
168 |
+
= 1.0.1 =
|
169 |
+
* Bug fix.
|
170 |
+
= 1.0 =
|
171 |
+
* Major modifications to plugin structure, efficiency, and documentation.
|
172 |
+
* Added the option to disable WordPress 3.0+ from changing all of your page, category and post links to HTTPS.
|
173 |
+
= 0.5.1 =
|
174 |
+
* Bug fix.
|
175 |
+
= 0.5 =
|
176 |
+
* Due to increasing concerns about plugin performance, the option to bypass the HTTPS check on external elements has been added.
|
177 |
+
= 0.4 =
|
178 |
+
* Plugin functions converted to OOP class.
|
179 |
+
* The plugin will now attempt to set the allow_url_fopen option to true with `ini_set` function if possible.
|
180 |
+
= 0.3 =
|
181 |
+
* Added the option to change external elements to HTTPS if the external server allows the elements to be accessed via HTTPS.
|
182 |
+
= 0.2 =
|
183 |
+
* Changed the way in which HTTPS was detected to be more reliable.
|
184 |
+
= 0.1 =
|
185 |
+
* Initial Release.
|
186 |
+
|
187 |
+
== Upgrade Notice ==
|
188 |
+
= 1.7 =
|
189 |
+
1.6.5 created a bug in which external elements were no longer forced to HTTPS. Please update to fix this.
|
190 |
+
= 1.6.1 =
|
191 |
+
Version 1.6.1 fixes a bug with using a static page for the posts page.
|
192 |
+
= 1.0.1 =
|
193 |
+
Version 1.0.1 fixes a bug in 1.0 that made it to release. Apologies!
|
194 |
+
= 1.0 =
|
195 |
+
Version 1.0 gives you the ability to disable WordPress 3.0+ from changing all of your page, category and post links to HTTPS.
|
196 |
+
= 0.5.1 =
|
197 |
+
Fixes `PHP Warning: Invalid argument supplied for foreach()` error.
|
198 |
+
= 0.3 =
|
199 |
+
Version 0.3 gives you the option to change external elements to HTTPS if the external server allows the elements to be accessed via HTTPS.
|
200 |
+
= 0.2 =
|
201 |
Version 0.1 did not correctly detect HTTPS on IIS and possibly other servers. Please update to version 0.2 to fix this issue.
|
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: 2.0.
|
8 |
Author URI: http://mvied.com/
|
9 |
*/
|
10 |
|
@@ -24,7 +24,7 @@ if ( !class_exists('WordPressHTTPS') ) {
|
|
24 |
*
|
25 |
* @var int
|
26 |
*/
|
27 |
-
public $version = '2.0.
|
28 |
|
29 |
/**
|
30 |
* Debug Mode
|
@@ -363,7 +363,7 @@ if ( !class_exists('WordPressHTTPS') ) {
|
|
363 |
$url = @$url[0][0];
|
364 |
return $url;
|
365 |
}
|
366 |
-
|
367 |
/**
|
368 |
* Retrieves the base host of a given URL
|
369 |
*
|
@@ -1008,7 +1008,7 @@ if ( !class_exists('WordPressHTTPS') ) {
|
|
1008 |
setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, $cookie_path, $cookie_domain);
|
1009 |
setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, $cookie_path_site, $cookie_domain);
|
1010 |
}
|
1011 |
-
|
1012 |
$cookie_domain = parse_url($this->https_url, PHP_URL_HOST);
|
1013 |
$cookie_path = rtrim(parse_url($this->https_url, PHP_URL_PATH), '/') . COOKIEPATH;
|
1014 |
$cookie_path_site = rtrim(parse_url($this->https_url, PHP_URL_PATH), '/') . SITECOOKIEPATH;
|
@@ -1132,38 +1132,42 @@ if ( !class_exists('WordPressHTTPS') ) {
|
|
1132 |
$_POST[$key] = 0;
|
1133 |
update_option($key, $_POST[$key]);
|
1134 |
} else {
|
1135 |
-
if ( $key == 'wordpress-https_ssl_host'
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
$url
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
1162 |
}
|
1163 |
-
$_POST[$key] = $this->remove_port($url);
|
1164 |
} else {
|
1165 |
-
|
1166 |
-
$_POST[$key] = get_option($key);
|
1167 |
}
|
1168 |
}
|
1169 |
} else if ( $key == 'wordpress-https_ssl_admin' ) {
|
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: 2.0.2
|
8 |
Author URI: http://mvied.com/
|
9 |
*/
|
10 |
|
24 |
*
|
25 |
* @var int
|
26 |
*/
|
27 |
+
public $version = '2.0.2';
|
28 |
|
29 |
/**
|
30 |
* Debug Mode
|
363 |
$url = @$url[0][0];
|
364 |
return $url;
|
365 |
}
|
366 |
+
|
367 |
/**
|
368 |
* Retrieves the base host of a given URL
|
369 |
*
|
1008 |
setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, $cookie_path, $cookie_domain);
|
1009 |
setcookie(LOGGED_IN_COOKIE, ' ', time() - 31536000, $cookie_path_site, $cookie_domain);
|
1010 |
}
|
1011 |
+
|
1012 |
$cookie_domain = parse_url($this->https_url, PHP_URL_HOST);
|
1013 |
$cookie_path = rtrim(parse_url($this->https_url, PHP_URL_PATH), '/') . COOKIEPATH;
|
1014 |
$cookie_path_site = rtrim(parse_url($this->https_url, PHP_URL_PATH), '/') . SITECOOKIEPATH;
|
1132 |
$_POST[$key] = 0;
|
1133 |
update_option($key, $_POST[$key]);
|
1134 |
} else {
|
1135 |
+
if ( $key == 'wordpress-https_ssl_host' ) {
|
1136 |
+
if ( $_POST[$key] != '' ) {
|
1137 |
+
$url = strtolower($_POST[$key]);
|
1138 |
+
// Add scheme if it doesn't exist so that parse_url does not fail
|
1139 |
+
if ( strpos($url, 'http://') === false && strpos($url, 'https://') === false ) {
|
1140 |
+
$url = $this->replace_http('http://' . $url);
|
1141 |
+
}
|
1142 |
+
$url = parse_url($url);
|
1143 |
+
$port = ((isset($_POST['wordpress-https_ssl_port'])) ? $_POST['wordpress-https_ssl_port'] : $url['port']);
|
1144 |
+
$port = (($port != 80 && $port != 443) ? $port : null);
|
1145 |
+
$url = 'https://' . $url['host'] . (($port) ? ':' . $port : '') . @$url['path'];
|
1146 |
+
|
1147 |
+
// If secure host is set to a different host
|
1148 |
+
if ( $url != $this->https_url ) {
|
1149 |
+
$home_url = $url . parse_url(get_option('home'), PHP_URL_PATH);
|
1150 |
+
// Add trailing slash
|
1151 |
+
$home_url = ((substr($home_url, -1) !== '/') ? $home_url . '/' : $home_url);
|
1152 |
+
// Ensure that the WordPress installation is accessible at this host
|
1153 |
+
if ( $this->get_file_contents($home_url) ) {
|
1154 |
+
// Remove trailing slash
|
1155 |
+
if ( substr($url, -1, 1) == '/' ) {
|
1156 |
+
$url = substr($url, 0, strlen($url)-1);
|
1157 |
+
}
|
1158 |
+
$this->log('[SETTINGS] Updated SSL Host: ' . $this->https_url . ' => ' . $url);
|
1159 |
+
|
1160 |
+
// If secure domain has changed and currently on SSL, logout user
|
1161 |
+
if ( $this->is_ssl() ) {
|
1162 |
+
$logout = true;
|
1163 |
+
}
|
1164 |
+
$_POST[$key] = $this->remove_port($url);
|
1165 |
+
} else {
|
1166 |
+
$errors[] = '<strong>SSL Host</strong> - Invalid WordPress installation at ' . $home_url;
|
1167 |
+
$_POST[$key] = get_option($key);
|
1168 |
}
|
|
|
1169 |
} else {
|
1170 |
+
$_POST[$key] = $this->https_url;
|
|
|
1171 |
}
|
1172 |
}
|
1173 |
} else if ( $key == 'wordpress-https_ssl_admin' ) {
|