Version Description
- Performance Increase.
- Bug Fix - Sites prevented from logging into the admin panel after the previous release should now be working again.
Download this release
Release Info
Developer | Mvied |
Plugin | WordPress HTTPS (SSL) |
Version | 3.2.2 |
Comparing to | |
See all releases |
Code changes from version 3.2.1 to 3.2.2
- admin/templates/metabox/domain_mapping.php +2 -2
- admin/templates/metabox/network.php +9 -9
- lib/Mvied/Plugin.php +1 -1
- lib/WordPressHTTPS.php +17 -1
- lib/WordPressHTTPS/Module/Core.php +33 -63
- lib/WordPressHTTPS/Module/Parser.php +60 -11
- readme.txt +4 -1
- uninstall.php +1 -0
- wordpress-https.php +2 -2
admin/templates/metabox/domain_mapping.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
<span class="label">http://</span>
|
16 |
</td>
|
17 |
<td class="http_domain">
|
18 |
-
<input type="text" name="http_domain[]" value="
|
19 |
</td>
|
20 |
<td class="arrow">
|
21 |
<span class="label">></span>
|
@@ -24,7 +24,7 @@
|
|
24 |
<span class="label">https://</span>
|
25 |
</td>
|
26 |
<td class="https_domain">
|
27 |
-
<input type="text" name="https_domain[]" value="
|
28 |
</td>
|
29 |
<td class="controls">
|
30 |
<a class="remove" href="#" title="Remove URL Filter">Remove</a>
|
15 |
<span class="label">http://</span>
|
16 |
</td>
|
17 |
<td class="http_domain">
|
18 |
+
<input type="text" name="http_domain[]" value="<?php echo $http_domain; ?>" />
|
19 |
</td>
|
20 |
<td class="arrow">
|
21 |
<span class="label">></span>
|
24 |
<span class="label">https://</span>
|
25 |
</td>
|
26 |
<td class="https_domain">
|
27 |
+
<input type="text" name="https_domain[]" value="<?php echo $https_domain; ?>" />
|
28 |
</td>
|
29 |
<td class="controls">
|
30 |
<a class="remove" href="#" title="Remove URL Filter">Remove</a>
|
admin/templates/metabox/network.php
CHANGED
@@ -24,21 +24,21 @@
|
|
24 |
$ssl_host = rtrim(str_replace(parse_url(get_site_url($blog_id, ''), PHP_URL_PATH), '', $ssl_host), '/');
|
25 |
?>
|
26 |
<tr>
|
27 |
-
<td class="blog-blog"><strong
|
28 |
-
<td class="blog-host"><input name="blog[
|
29 |
-
<td class="blog-ssl_admin"><input type="hidden" name="blog[
|
30 |
-
<td class="blog-exclusive_https"><input type="hidden" name="blog[
|
31 |
-
<td class="blog-remove_unsecure"><input type="hidden" name="blog[
|
32 |
-
<td class="blog-debug"><input type="hidden" name="blog[
|
33 |
<td class="blog-proxy">
|
34 |
-
<select name="blog[
|
35 |
<option value="0"<?php echo ((! $this->getPlugin()->getSetting('ssl_proxy', $blog_id)) ? ' selected="selected"' : ''); ?>>No</option>
|
36 |
<option value="auto"<?php echo (($this->getPlugin()->getSetting('ssl_proxy', $blog_id) === 'auto') ? ' selected="selected"' : ''); ?>>Auto</option>
|
37 |
<option value="1"<?php echo (($this->getPlugin()->getSetting('ssl_proxy', $blog_id) == 1) ? ' selected="selected"' : ''); ?>>Yes</option>
|
38 |
</select>
|
39 |
</td>
|
40 |
<td class="blog-admin_menu">
|
41 |
-
<select name="blog[
|
42 |
<option value="side"<?php echo (($this->getPlugin()->getSetting('admin_menu', $blog_id) === 'side') ? ' selected="selected"' : ''); ?>>Sidebar</option>
|
43 |
<option value="settings"<?php echo (($this->getPlugin()->getSetting('admin_menu', $blog_id) === 'settings') ? ' selected="selected"' : ''); ?>>Settings</option>
|
44 |
</select>
|
@@ -57,7 +57,7 @@
|
|
57 |
|
58 |
<tr>
|
59 |
<td class="blog-blog"><strong>New Site Defaults</strong></td>
|
60 |
-
<td class="blog-host"><input name="blog_default[ssl_host]" type="text" class="regular-text code" value="
|
61 |
<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>
|
62 |
<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>
|
63 |
<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>
|
24 |
$ssl_host = rtrim(str_replace(parse_url(get_site_url($blog_id, ''), PHP_URL_PATH), '', $ssl_host), '/');
|
25 |
?>
|
26 |
<tr>
|
27 |
+
<td class="blog-blog"><strong><?php echo preg_replace('/http[s]?:\/\//', '', get_site_url($blog_id)); ?></strong></td>
|
28 |
+
<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>
|
29 |
+
<td class="blog-ssl_admin"><input type="hidden" name="blog[<?php echo $blog_id; ?>][ssl_admin]" value="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->getPlugin()->getSetting('ssl_admin', $blog_id)) ? ' checked="checked"' : '') ); ?> /></td>
|
30 |
+
<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->getPlugin()->getSetting('exclusive_https', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
|
31 |
+
<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->getPlugin()->getSetting('remove_unsecure', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
|
32 |
+
<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->getPlugin()->getSetting('debug', $blog_id)) ? ' checked="checked"' : ''); ?> /></td>
|
33 |
<td class="blog-proxy">
|
34 |
+
<select name="blog[<?php echo $blog_id; ?>][ssl_proxy]">
|
35 |
<option value="0"<?php echo ((! $this->getPlugin()->getSetting('ssl_proxy', $blog_id)) ? ' selected="selected"' : ''); ?>>No</option>
|
36 |
<option value="auto"<?php echo (($this->getPlugin()->getSetting('ssl_proxy', $blog_id) === 'auto') ? ' selected="selected"' : ''); ?>>Auto</option>
|
37 |
<option value="1"<?php echo (($this->getPlugin()->getSetting('ssl_proxy', $blog_id) == 1) ? ' selected="selected"' : ''); ?>>Yes</option>
|
38 |
</select>
|
39 |
</td>
|
40 |
<td class="blog-admin_menu">
|
41 |
+
<select name="blog[<?php echo $blog_id; ?>][admin_menu]">
|
42 |
<option value="side"<?php echo (($this->getPlugin()->getSetting('admin_menu', $blog_id) === 'side') ? ' selected="selected"' : ''); ?>>Sidebar</option>
|
43 |
<option value="settings"<?php echo (($this->getPlugin()->getSetting('admin_menu', $blog_id) === 'settings') ? ' selected="selected"' : ''); ?>>Settings</option>
|
44 |
</select>
|
57 |
|
58 |
<tr>
|
59 |
<td class="blog-blog"><strong>New Site Defaults</strong></td>
|
60 |
+
<td class="blog-host"><input name="blog_default[ssl_host]" type="text" class="regular-text code" value="<?php echo $defaults['ssl_host']; ?>" /></td>
|
61 |
<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>
|
62 |
<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>
|
63 |
<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>
|
lib/Mvied/Plugin.php
CHANGED
@@ -243,7 +243,7 @@ class Mvied_Plugin {
|
|
243 |
}
|
244 |
|
245 |
// Load default option
|
246 |
-
if ( $value === false ) {
|
247 |
$value = $this->_settings[$setting];
|
248 |
}
|
249 |
// Convert 1's and 0's to boolean
|
243 |
}
|
244 |
|
245 |
// Load default option
|
246 |
+
if ( $value === false && array_key_exists($setting, $this->_settings) ) {
|
247 |
$value = $this->_settings[$setting];
|
248 |
}
|
249 |
// Convert 1's and 0's to boolean
|
lib/WordPressHTTPS.php
CHANGED
@@ -48,6 +48,13 @@ class WordPressHTTPS extends Mvied_Plugin {
|
|
48 |
'network_defaults' => array(), // Default settings for new blogs on a multisite network
|
49 |
);
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
/**
|
52 |
* Default External SSL Host Mapping
|
53 |
* @var array
|
@@ -57,6 +64,16 @@ class WordPressHTTPS extends Mvied_Plugin {
|
|
57 |
'\d.gravatar.com' => 'secure.gravatar.com',
|
58 |
);
|
59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
/**
|
61 |
* Get HTTP Url
|
62 |
*
|
@@ -123,7 +140,6 @@ class WordPressHTTPS extends Mvied_Plugin {
|
|
123 |
$this->getLogger()->log('Unsecure External URLs: [ ' . implode(', ', (array)$this->getSetting('unsecure_external_urls')) . ' ]');
|
124 |
|
125 |
parent::init();
|
126 |
-
do_action($this->getSlug() . '_init');
|
127 |
}
|
128 |
|
129 |
/**
|
48 |
'network_defaults' => array(), // Default settings for new blogs on a multisite network
|
49 |
);
|
50 |
|
51 |
+
/**
|
52 |
+
* File extensions to be loaded securely.
|
53 |
+
*
|
54 |
+
* @var array
|
55 |
+
*/
|
56 |
+
protected $_file_extensions = array('jpg', 'jpeg', 'png', 'gif', 'css', 'js');
|
57 |
+
|
58 |
/**
|
59 |
* Default External SSL Host Mapping
|
60 |
* @var array
|
64 |
'\d.gravatar.com' => 'secure.gravatar.com',
|
65 |
);
|
66 |
|
67 |
+
/**
|
68 |
+
* Get File Extensions to Secure
|
69 |
+
*
|
70 |
+
* @param none
|
71 |
+
* @return array
|
72 |
+
*/
|
73 |
+
public function getFileExtensions() {
|
74 |
+
return $this->_file_extensions;
|
75 |
+
}
|
76 |
+
|
77 |
/**
|
78 |
* Get HTTP Url
|
79 |
*
|
140 |
$this->getLogger()->log('Unsecure External URLs: [ ' . implode(', ', (array)$this->getSetting('unsecure_external_urls')) . ' ]');
|
141 |
|
142 |
parent::init();
|
|
|
143 |
}
|
144 |
|
145 |
/**
|
lib/WordPressHTTPS/Module/Core.php
CHANGED
@@ -50,6 +50,7 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
|
|
50 |
add_filter('force_ssl', array(&$this, 'secure_child_post'), 30, 3);
|
51 |
add_filter('force_ssl', array(&$this, 'secure_admin'), 30, 3);
|
52 |
add_filter('force_ssl', array(&$this, 'secure_login'), 30, 3);
|
|
|
53 |
add_filter('force_ssl', array(&$this, 'secure_post'), 40, 3);
|
54 |
add_filter('force_ssl', array(&$this, 'secure_exclusive'), 50, 3);
|
55 |
|
@@ -218,13 +219,17 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
|
|
218 |
if ( $this->getPlugin()->getSetting('exclusive_https') && !( ( defined('FORCE_SSL_ADMIN') && constant('FORCE_SSL_ADMIN') ) || $this->getPlugin()->getSetting('ssl_admin') ) ) {
|
219 |
$force_ssl = false;
|
220 |
//TODO When logged in to HTTP and visiting an HTTPS page, admin links will always be forced to HTTPS, even if the user is not logged in via HTTPS. I need to find a way to detect this.
|
221 |
-
} else if ( (
|
222 |
$force_ssl = true;
|
223 |
}
|
224 |
if ( !$this->getPlugin()->isSsl() && strpos($url, 'admin-ajax.php') !== false ) {
|
225 |
$force_ssl = false;
|
226 |
}
|
227 |
}
|
|
|
|
|
|
|
|
|
228 |
return $force_ssl;
|
229 |
}
|
230 |
|
@@ -247,7 +252,7 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
|
|
247 |
}
|
248 |
|
249 |
/**
|
250 |
-
* Secure
|
251 |
* WordPress HTTPS Filter - force_ssl
|
252 |
*
|
253 |
* @param boolean $force_ssl
|
@@ -255,71 +260,36 @@ class WordPressHTTPS_Module_Core extends Mvied_Plugin_Module {
|
|
255 |
* @param string $url
|
256 |
* @return boolean $force_ssl
|
257 |
*/
|
258 |
-
public function
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
if ( $this->getPlugin()->getHttpUrl()->getPath() != '/' ) {
|
268 |
-
$url_parts['path'] = str_replace($this->getPlugin()->getHttpUrl()->getPath(), '', $url_parts['path']);
|
269 |
-
}
|
270 |
-
}
|
271 |
-
|
272 |
-
// qTranslate integration - strips language from beginning of url path
|
273 |
-
if ( defined('QTRANS_INIT') && constant('QTRANS_INIT') == true && isset($url_parts['path']) ) {
|
274 |
-
global $q_config;
|
275 |
-
if ( isset($q_config['enabled_languages']) ) {
|
276 |
-
foreach($q_config['enabled_languages'] as $language) {
|
277 |
-
$url_parts['path'] = preg_replace('/^\/' . $language . '\//', '/', $url_parts['path']);
|
278 |
-
}
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
if ( isset($post_id) && $post_id > 0 ) {
|
283 |
-
$post = $post_id;
|
284 |
-
} else if ( preg_match("/page_id=([\d]+)/", parse_url($url, PHP_URL_QUERY), $postID) ) {
|
285 |
-
$post = $postID[1];
|
286 |
-
} else if ( isset($url_parts['path']) && ( $url_parts['path'] == '' || $url_parts['path'] == '/' ) ) {
|
287 |
-
if ( get_option('show_on_front') == 'page' ) {
|
288 |
-
$post = get_option('page_on_front');
|
289 |
-
}
|
290 |
-
} else if ( isset($url_parts['path']) && ($post = get_page_by_path($url_parts['path'])) ) {
|
291 |
-
$post = $post->ID;
|
292 |
-
}
|
293 |
-
|
294 |
-
if ( is_multisite() && isset($url_parts['host']) && isset($url_parts['path']) ) {
|
295 |
-
$blog_id = false;
|
296 |
-
$url_path = '/';
|
297 |
-
$url_path_segments = explode('/', $url_parts['path']);
|
298 |
-
if ( sizeof($url_path_segments) > 1 ) {
|
299 |
-
foreach( $url_path_segments as $url_path_segment ) {
|
300 |
-
if ( !$blog_id && $url_path_segment != '' ) {
|
301 |
-
$url_path .= '/' . $url_path_segment . '/';
|
302 |
-
if ( $blog_id = get_blog_id_from_url( $url_parts['host'], $url_path) ) {
|
303 |
-
break;
|
304 |
-
}
|
305 |
-
}
|
306 |
-
}
|
307 |
-
}
|
308 |
-
if ( !$blog_id ) {
|
309 |
-
$blog_id = get_blog_id_from_url( $url_parts['host'], '/');
|
310 |
-
}
|
311 |
-
if ( $blog_id && $blog_id != $wpdb->blogid ) {
|
312 |
-
if ( $this->getPlugin()->getSetting('ssl_admin', $blog_id) && ( ! $this->getPlugin()->getSetting('ssl_host_diff', $blog_id) || ( $this->getPlugin()->getSetting('ssl_host_diff', $blog_id) && function_exists('is_user_logged_in') && is_user_logged_in() ) ) ) {
|
313 |
-
$force_ssl = true;
|
314 |
-
} else {
|
315 |
-
$force_ssl = false;
|
316 |
-
}
|
317 |
}
|
318 |
}
|
319 |
}
|
320 |
}
|
321 |
-
|
322 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
323 |
}
|
324 |
return $force_ssl;
|
325 |
}
|
50 |
add_filter('force_ssl', array(&$this, 'secure_child_post'), 30, 3);
|
51 |
add_filter('force_ssl', array(&$this, 'secure_admin'), 30, 3);
|
52 |
add_filter('force_ssl', array(&$this, 'secure_login'), 30, 3);
|
53 |
+
add_filter('force_ssl', array(&$this, 'secure_element'), 30, 3);
|
54 |
add_filter('force_ssl', array(&$this, 'secure_post'), 40, 3);
|
55 |
add_filter('force_ssl', array(&$this, 'secure_exclusive'), 50, 3);
|
56 |
|
219 |
if ( $this->getPlugin()->getSetting('exclusive_https') && !( ( defined('FORCE_SSL_ADMIN') && constant('FORCE_SSL_ADMIN') ) || $this->getPlugin()->getSetting('ssl_admin') ) ) {
|
220 |
$force_ssl = false;
|
221 |
//TODO When logged in to HTTP and visiting an HTTPS page, admin links will always be forced to HTTPS, even if the user is not logged in via HTTPS. I need to find a way to detect this.
|
222 |
+
} else if ( ( $this->getPlugin()->isSsl() && !$this->getPlugin()->getSetting('exclusive_https') ) || ( ( defined('FORCE_SSL_ADMIN') && constant('FORCE_SSL_ADMIN') ) || $this->getPlugin()->getSetting('ssl_admin') ) ) {
|
223 |
$force_ssl = true;
|
224 |
}
|
225 |
if ( !$this->getPlugin()->isSsl() && strpos($url, 'admin-ajax.php') !== false ) {
|
226 |
$force_ssl = false;
|
227 |
}
|
228 |
}
|
229 |
+
// Catches base URL's used by low-level WordPress code
|
230 |
+
if ( is_admin() && $this->getPlugin()->isSsl() && ($url_parts = parse_url($url)) && ( !isset($url_parts['path']) || trim($url_parts['path'], '/') == '' ) ) {
|
231 |
+
$force_ssl = true;
|
232 |
+
}
|
233 |
return $force_ssl;
|
234 |
}
|
235 |
|
252 |
}
|
253 |
|
254 |
/**
|
255 |
+
* Secure Element by Extension
|
256 |
* WordPress HTTPS Filter - force_ssl
|
257 |
*
|
258 |
* @param boolean $force_ssl
|
260 |
* @param string $url
|
261 |
* @return boolean $force_ssl
|
262 |
*/
|
263 |
+
public function secure_element( $force_ssl, $post_id = 0, $url = '' ) {
|
264 |
+
if ( $url != '' && $this->getPlugin()->isUrlLocal($url) ) {
|
265 |
+
$filename = basename($url);
|
266 |
+
foreach( $this->getPlugin()->getFileExtensions() as $extension ) {
|
267 |
+
if ( preg_match('/\.' . $extension . '(\?|$)/', $filename) ) {
|
268 |
+
if ( $this->getPlugin()->isSsl() ) {
|
269 |
+
$force_ssl = true;
|
270 |
+
} else {
|
271 |
+
$force_ssl = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
}
|
273 |
}
|
274 |
}
|
275 |
}
|
276 |
+
return $force_ssl;
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Secure Post
|
281 |
+
* WordPress HTTPS Filter - force_ssl
|
282 |
+
*
|
283 |
+
* @param boolean $force_ssl
|
284 |
+
* @param int $post_id
|
285 |
+
* @param string $url
|
286 |
+
* @return boolean $force_ssl
|
287 |
+
*/
|
288 |
+
public function secure_post( $force_ssl, $post_id = 0, $url = '' ) {
|
289 |
+
global $wpdb;
|
290 |
+
|
291 |
+
if ( $post_id > 0 ) {
|
292 |
+
$force_ssl = ( get_post_meta($post_id, 'force_ssl', true) == 1 ? true : $force_ssl);
|
293 |
}
|
294 |
return $force_ssl;
|
295 |
}
|
lib/WordPressHTTPS/Module/Parser.php
CHANGED
@@ -16,15 +16,6 @@ class WordPressHTTPS_Module_Parser extends Mvied_Plugin_Module {
|
|
16 |
*/
|
17 |
protected $_html;
|
18 |
|
19 |
-
/**
|
20 |
-
* Extensions
|
21 |
-
*
|
22 |
-
* Array of file extensions to be loaded securely.
|
23 |
-
*
|
24 |
-
* @var array
|
25 |
-
*/
|
26 |
-
protected $_extensions = array('jpg', 'jpeg', 'png', 'gif', 'css', 'js');
|
27 |
-
|
28 |
/**
|
29 |
* Initialize
|
30 |
*
|
@@ -267,7 +258,7 @@ class WordPressHTTPS_Module_Parser extends Mvied_Plugin_Module {
|
|
267 |
$filename = basename($url);
|
268 |
$scheme = $matches[2][$i];
|
269 |
|
270 |
-
foreach( $this->
|
271 |
if ( $extension == 'js' ) {
|
272 |
$type = 'script';
|
273 |
} else if ( $extension == 'css' ) {
|
@@ -296,6 +287,7 @@ class WordPressHTTPS_Module_Parser extends Mvied_Plugin_Module {
|
|
296 |
* @return void
|
297 |
*/
|
298 |
public function fixLinksAndForms() {
|
|
|
299 |
// Update anchor and form tags to appropriate URL's
|
300 |
preg_match_all('/\<(a|form)[^>]+[\'"]((http|https):\/\/[^\'"]+)[\'"][^>]*>/im', $this->_html, $matches);
|
301 |
|
@@ -310,7 +302,64 @@ class WordPressHTTPS_Module_Parser extends Mvied_Plugin_Module {
|
|
310 |
continue;
|
311 |
}
|
312 |
|
313 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
314 |
|
315 |
if ( $force_ssl == true ) {
|
316 |
$updated = $this->getPlugin()->makeUrlHttps($url);
|
16 |
*/
|
17 |
protected $_html;
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
/**
|
20 |
* Initialize
|
21 |
*
|
258 |
$filename = basename($url);
|
259 |
$scheme = $matches[2][$i];
|
260 |
|
261 |
+
foreach( $this->getPlugin()->getFileExtensions() as $extension ) {
|
262 |
if ( $extension == 'js' ) {
|
263 |
$type = 'script';
|
264 |
} else if ( $extension == 'css' ) {
|
287 |
* @return void
|
288 |
*/
|
289 |
public function fixLinksAndForms() {
|
290 |
+
global $wpdb;
|
291 |
// Update anchor and form tags to appropriate URL's
|
292 |
preg_match_all('/\<(a|form)[^>]+[\'"]((http|https):\/\/[^\'"]+)[\'"][^>]*>/im', $this->_html, $matches);
|
293 |
|
302 |
continue;
|
303 |
}
|
304 |
|
305 |
+
if ( $url != '' && ($url_parts = parse_url($url)) && isset($url_parts['path']) ) {
|
306 |
+
if ( $this->getPlugin()->getHttpsUrl()->getPath() != '/' ) {
|
307 |
+
if ( $this->getPlugin()->getSetting('ssl_host_diff') ) {
|
308 |
+
$url_parts['path'] = str_replace($this->getPlugin()->getHttpsUrl()->getPath(), '', $url_parts['path']);
|
309 |
+
}
|
310 |
+
if ( $this->getPlugin()->getHttpUrl()->getPath() != '/' ) {
|
311 |
+
$url_parts['path'] = str_replace($this->getPlugin()->getHttpUrl()->getPath(), '', $url_parts['path']);
|
312 |
+
}
|
313 |
+
}
|
314 |
+
|
315 |
+
// qTranslate integration - strips language from beginning of url path
|
316 |
+
if ( defined('QTRANS_INIT') && constant('QTRANS_INIT') == true ) {
|
317 |
+
global $q_config;
|
318 |
+
if ( isset($q_config['enabled_languages']) ) {
|
319 |
+
foreach($q_config['enabled_languages'] as $language) {
|
320 |
+
$url_parts['path'] = preg_replace('/^\/' . $language . '\//', '/', $url_parts['path']);
|
321 |
+
}
|
322 |
+
}
|
323 |
+
}
|
324 |
+
|
325 |
+
if ( preg_match("/page_id=([\d]+)/", parse_url($url, PHP_URL_QUERY), $postID) ) {
|
326 |
+
$post_id = $postID[1];
|
327 |
+
} else if ( isset($url_parts['path']) && ( $url_parts['path'] == '' || $url_parts['path'] == '/' ) ) {
|
328 |
+
if ( get_option('show_on_front') == 'page' ) {
|
329 |
+
$post_id = get_option('page_on_front');
|
330 |
+
}
|
331 |
+
} else if ( isset($url_parts['path']) && ($post = get_page_by_path($url_parts['path'])) ) {
|
332 |
+
$post_id = $post->ID;
|
333 |
+
}
|
334 |
+
|
335 |
+
if ( is_multisite() && isset($url_parts['host']) ) {
|
336 |
+
$blog_id = false;
|
337 |
+
$url_path = '/';
|
338 |
+
$url_path_segments = explode('/', $url_parts['path']);
|
339 |
+
if ( sizeof($url_path_segments) > 1 ) {
|
340 |
+
foreach( $url_path_segments as $url_path_segment ) {
|
341 |
+
if ( !$blog_id && $url_path_segment != '' ) {
|
342 |
+
$url_path .= '/' . $url_path_segment . '/';
|
343 |
+
if ( $blog_id = get_blog_id_from_url( $url_parts['host'], $url_path) ) {
|
344 |
+
break;
|
345 |
+
}
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
if ( !$blog_id ) {
|
350 |
+
$blog_id = get_blog_id_from_url( $url_parts['host'], '/');
|
351 |
+
}
|
352 |
+
if ( $blog_id && $blog_id != $wpdb->blogid ) {
|
353 |
+
if ( $this->getPlugin()->getSetting('ssl_admin', $blog_id) && ( ! $this->getPlugin()->getSetting('ssl_host_diff', $blog_id) || ( $this->getPlugin()->getSetting('ssl_host_diff', $blog_id) && function_exists('is_user_logged_in') && is_user_logged_in() ) ) ) {
|
354 |
+
$force_ssl = true;
|
355 |
+
} else {
|
356 |
+
$force_ssl = false;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
}
|
360 |
+
}
|
361 |
+
|
362 |
+
$force_ssl = apply_filters('force_ssl', null, ( isset($post_id) ? $post_id : 0 ), $url );
|
363 |
|
364 |
if ( $force_ssl == true ) {
|
365 |
$updated = $this->getPlugin()->makeUrlHttps($url);
|
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.0
|
6 |
Tested up to: 3.4
|
7 |
-
Stable tag: 3.2.
|
8 |
License: GPLv3
|
9 |
|
10 |
WordPress HTTPS is intended to be an all-in-one solution to using SSL on WordPress sites.
|
@@ -80,6 +80,9 @@ add_filter('force_ssl', 'store_force_ssl', 10, 3);`
|
|
80 |
2. Force SSL checkbox added to add/edit posts screen
|
81 |
|
82 |
== Changelog ==
|
|
|
|
|
|
|
83 |
= 3.2.1 =
|
84 |
* Added Network settings for multisite installations.
|
85 |
* Bug Fix - Elements should now be properly secured by the file extension check in the Parser.
|
4 |
Tags: security, encryption, ssl, shared ssl, private ssl, public ssl, private ssl, http, https
|
5 |
Requires at least: 3.0
|
6 |
Tested up to: 3.4
|
7 |
+
Stable tag: 3.2.2
|
8 |
License: GPLv3
|
9 |
|
10 |
WordPress HTTPS is intended to be an all-in-one solution to using SSL on WordPress sites.
|
80 |
2. Force SSL checkbox added to add/edit posts screen
|
81 |
|
82 |
== Changelog ==
|
83 |
+
= 3.2.2 =
|
84 |
+
* Performance Increase.
|
85 |
+
* Bug Fix - Sites prevented from logging into the admin panel after the previous release should now be working again.
|
86 |
= 3.2.1 =
|
87 |
* Added Network settings for multisite installations.
|
88 |
* Bug Fix - Elements should now be properly secured by the file extension check in the Parser.
|
uninstall.php
CHANGED
@@ -26,6 +26,7 @@ $options = array(
|
|
26 |
'wordpress-https_ssl_host_mapping'
|
27 |
);
|
28 |
|
|
|
29 |
if ( is_multisite() && is_network_admin() ) {
|
30 |
$blogs = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM " . $wpdb->blogs));
|
31 |
} else {
|
26 |
'wordpress-https_ssl_host_mapping'
|
27 |
);
|
28 |
|
29 |
+
global $wpdb;
|
30 |
if ( is_multisite() && is_network_admin() ) {
|
31 |
$blogs = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM " . $wpdb->blogs));
|
32 |
} else {
|
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.2.
|
8 |
Author URI: http://mvied.com/
|
9 |
*/
|
10 |
|
@@ -41,7 +41,7 @@ spl_autoload_register('wphttps_autoloader');
|
|
41 |
if ( function_exists('get_bloginfo') && ! defined('WP_UNINSTALL_PLUGIN') ) {
|
42 |
$wordpress_https = new WordPressHTTPS;
|
43 |
$wordpress_https->setSlug('wordpress-https');
|
44 |
-
$wordpress_https->setVersion('3.2.
|
45 |
$wordpress_https->setLogger(WordPressHTTPS_Logger::getInstance());
|
46 |
$wordpress_https->setDirectory(dirname(__FILE__));
|
47 |
$wordpress_https->setModuleDirectory(dirname(__FILE__) . '/lib/WordPressHTTPS/Module/');
|
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.2.2
|
8 |
Author URI: http://mvied.com/
|
9 |
*/
|
10 |
|
41 |
if ( function_exists('get_bloginfo') && ! defined('WP_UNINSTALL_PLUGIN') ) {
|
42 |
$wordpress_https = new WordPressHTTPS;
|
43 |
$wordpress_https->setSlug('wordpress-https');
|
44 |
+
$wordpress_https->setVersion('3.2.2');
|
45 |
$wordpress_https->setLogger(WordPressHTTPS_Logger::getInstance());
|
46 |
$wordpress_https->setDirectory(dirname(__FILE__));
|
47 |
$wordpress_https->setModuleDirectory(dirname(__FILE__) . '/lib/WordPressHTTPS/Module/');
|