HTTP / HTTPS Remover: SSL Mixed Content Fix - Version 1.1.1

Version Description

(10/18/16) = * Added support for "content" tag * Added support for "loaderUrl" tag

Download this release

Release Info

Developer condacore
Plugin Icon 128x128 HTTP / HTTPS Remover: SSL Mixed Content Fix
Version 1.1.1
Comparing to
See all releases

Version 1.1.1

Files changed (3) hide show
  1. http-https-remover.php +94 -0
  2. index.php +14 -0
  3. readme.txt +76 -0
http-https-remover.php ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Plugin Name: HTTP / HTTPS Remover
4
+ * Plugin URI: https://de.wordpress.org/plugins/http-https-remover/
5
+ * Description: This Plugin removes HTTP and HTTPS protocols from all links.
6
+ * Version: 1.1.1
7
+ * Author: Marius Bolik (CONDACORE)
8
+ * Author URI: https://condacore.com/
9
+ * License: GPLv3
10
+ */
11
+
12
+
13
+ # _____ ____ _ _ _____ _____ ____ _____ ______
14
+ # / ____/ __ \| \ | | __ \ /\ / ____/ __ \| __ \| ____|
15
+ # | | | | | | \| | | | | / \ | | | | | | |__) | |__
16
+ # | | | | | | . ` | | | |/ /\ \| | | | | | _ /| __|
17
+ # | |___| |__| | |\ | |__| / ____ \ |___| |__| | | \ \| |____
18
+ # \_____\____/|_| \_|_____/_/ \_\_____\____/|_| \_\______|
19
+ #
20
+
21
+
22
+ if ( ! defined( 'ABSPATH' ) ) exit;
23
+
24
+ class HTTP_HTTPS_REMOVER {
25
+
26
+ ############################################
27
+ ###### Apply Plugin on the whole Site ######
28
+ ############################################
29
+
30
+ public function __construct() {
31
+ add_action('wp_loaded', array( $this, 'letsGo' ), 99, 1);
32
+ }
33
+
34
+ ##########################
35
+ ###### More Code... ######
36
+ ##########################
37
+
38
+
39
+ public function letsGo() {
40
+ global $pagenow;
41
+ ob_start( array( $this, 'mainPath' ) );
42
+ }
43
+
44
+ public function mainPath( $buffer ) {
45
+ $content_type = NULL;
46
+ foreach ( headers_list() as $header ) {
47
+ if (strpos( strtolower( $header ), 'content-type:' ) === 0 ) {
48
+ $pieces = explode( ':', strtolower( $header ) );
49
+ $content_type = trim( $pieces[1] );
50
+ break;
51
+ }
52
+ }
53
+ if ( is_null( $content_type ) || substr( $content_type, 0, 9 ) === 'text/html' ) {
54
+
55
+ ################################
56
+ ###### The important Path ######
57
+ ################################
58
+
59
+ #href
60
+ $buffer = str_replace( 'href=\'https://'.$_SERVER['HTTP_HOST'], 'href=\'//'.$_SERVER['HTTP_HOST'], $buffer );
61
+ $buffer = str_replace( 'href="https://'.$_SERVER['HTTP_HOST'], 'href="//'.$_SERVER['HTTP_HOST'], $buffer );
62
+ $buffer = str_replace( 'href=\'http://'.$_SERVER['HTTP_HOST'], 'href=\'//'.$_SERVER['HTTP_HOST'], $buffer );
63
+ $buffer = str_replace( 'href="http://'.$_SERVER['HTTP_HOST'], 'href="//'.$_SERVER['HTTP_HOST'], $buffer );
64
+
65
+ #src
66
+ $buffer = str_replace( 'src=\'https://'.$_SERVER['HTTP_HOST'], 'src=\'//'.$_SERVER['HTTP_HOST'], $buffer );
67
+ $buffer = str_replace( 'src="https://'.$_SERVER['HTTP_HOST'], 'src="//'.$_SERVER['HTTP_HOST'], $buffer );
68
+ $buffer = str_replace( 'src=\'http://'.$_SERVER['HTTP_HOST'], 'src=\'//'.$_SERVER['HTTP_HOST'], $buffer );
69
+ $buffer = str_replace( 'src="http://'.$_SERVER['HTTP_HOST'], 'src="//'.$_SERVER['HTTP_HOST'], $buffer );
70
+
71
+ #content
72
+ $buffer = str_replace( 'content=\'https://'.$_SERVER['HTTP_HOST'], 'content=\'//'.$_SERVER['HTTP_HOST'], $buffer );
73
+ $buffer = str_replace( 'content="https://'.$_SERVER['HTTP_HOST'], 'content="//'.$_SERVER['HTTP_HOST'], $buffer );
74
+ $buffer = str_replace( 'content=\'http://'.$_SERVER['HTTP_HOST'], 'content=\'//'.$_SERVER['HTTP_HOST'], $buffer );
75
+ $buffer = str_replace( 'content="http://'.$_SERVER['HTTP_HOST'], 'content="//'.$_SERVER['HTTP_HOST'], $buffer );
76
+
77
+ #url
78
+ $buffer = str_replace( 'url(\'https://'.$_SERVER['HTTP_HOST'], 'url(\'//'.$_SERVER['HTTP_HOST'], $buffer );
79
+ $buffer = str_replace( 'url("https://'.$_SERVER['HTTP_HOST'], 'url("//'.$_SERVER['HTTP_HOST'], $buffer );
80
+ $buffer = str_replace( 'url(\'http://'.$_SERVER['HTTP_HOST'], 'url(\'//'.$_SERVER['HTTP_HOST'], $buffer );
81
+ $buffer = str_replace( 'url("http://'.$_SERVER['HTTP_HOST'], 'url("//'.$_SERVER['HTTP_HOST'], $buffer );
82
+
83
+ #loaderUrl
84
+ $buffer = str_replace( 'https:\/\/'.$_SERVER['HTTP_HOST'], '\/\/'.$_SERVER['HTTP_HOST'], $buffer );
85
+ $buffer = str_replace( 'http:\/\/'.$_SERVER['HTTP_HOST'], '\/\/'.$_SERVER['HTTP_HOST'], $buffer );
86
+
87
+ # Fix for visible links
88
+ $buffer = str_replace( '>http://'.$_SERVER['HTTP_HOST'], '>https://'.$_SERVER['HTTP_HOST'], $buffer );
89
+
90
+ }
91
+ return $buffer;
92
+ }
93
+ }
94
+ new HTTP_HTTPS_REMOVER();
index.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ # _____ ____ _ _ _____ _____ ____ _____ ______
4
+ # / ____/ __ \| \ | | __ \ /\ / ____/ __ \| __ \| ____|
5
+ # | | | | | | \| | | | | / \ | | | | | | |__) | |__
6
+ # | | | | | | . ` | | | |/ /\ \| | | | | | _ /| __|
7
+ # | |___| |__| | |\ | |__| / ____ \ |___| |__| | | \ \| |____
8
+ # \_____\____/|_| \_|_____/_/ \_\_____\____/|_| \_\______|
9
+ #
10
+ #
11
+ # Plugin: HTTP / HTTPS Remover
12
+ # Created by: Marius Bolik
13
+ # Copyright: 2016 © CONDACORE
14
+ # Web: https://condacore.com
readme.txt ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === HTTP / HTTPS Remover ===
2
+ Contributors: condacore
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=marius%2ebolik%40me%2ecom&lc=DE&item_name=HTTP%20%2f%20HTTPS%20Remover&no_note=0&cn=Message%3a&no_shipping=1&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
4
+ Tags: http, https, mixed content
5
+ Requires at least: 1.2.0
6
+ Tested up to: 4.6.1
7
+ Stable tag: 1.1.1
8
+ License: GPLv3
9
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
+
11
+ A fix for mixed content! This Plugin removes HTTP and HTTPS protocols from all links. Works in Front- and Backend!
12
+
13
+ == Description ==
14
+
15
+ = Main Features =
16
+ - Works in Front- and Backend<br>
17
+ - Makes every Plugin compatible with https<br>
18
+ - No Setup needed<br>
19
+ - Compatible with Visual Composer
20
+
21
+
22
+ **Mixed content** occurs when initial HTML is loaded over a secure HTTPS connection, but other resources (such as images, videos, stylesheets, scripts) are loaded over an insecure HTTP connection. This is called mixed content because both HTTP and HTTPS content are being loaded to display the same page, and the initial request was secure over HTTPS. Modern browsers display warnings about this type of content to indicate to the user that this page contains insecure resources.
23
+
24
+ Your users are counting on you to protect them when they visit your website. It is important to fix your mixed content issues to protect all your visitors, including those on older browsers. And that's what this plugin does!
25
+
26
+
27
+ = Example =
28
+
29
+ Without Plugin:
30
+ `"http://domain.com/script.js"`
31
+ `"https://domain.com/script.js"`
32
+
33
+ With Plugin:
34
+ `"//domain.com/script.js"`
35
+
36
+ For more infos take a look at the screenshot.
37
+
38
+ = Note =
39
+
40
+ **The Plugin does not remove http and https from external links.**
41
+
42
+
43
+ = If using CloudFlare or other Caching Plugin =
44
+
45
+ **CloudFlare:** <br>
46
+ 1. Go to Settings -> CloudFlare -> More Settings<br>
47
+ 2. Disable "Automatic HTTPS Rewrites" (Our Plugin is better) :)<br>
48
+ 3. Go back to "Home" in CloudFlare Plugin and click "Purge Cache" for the changes to take effect!
49
+
50
+ **Other Cache Plugin:** <br>
51
+ Please purge/clear cache for the changes to take effect!
52
+
53
+
54
+ = More =
55
+ [Feel free to visit our Website](https://condacore.com/)
56
+
57
+
58
+ == Installation ==
59
+ 1. Upload `http-https-remover` folder to your `/wp-content/plugins/` directory.
60
+ 2. Activate the plugin from Admin > Plugins menu.
61
+ 3. Once activated your site is ready!
62
+
63
+ == Screenshots ==
64
+
65
+ 1. The Sourcecode of the Website will look like this!
66
+
67
+ == Changelog ==
68
+ = 1.1.1 (10/18/16) =
69
+ * Added support for "content" tag
70
+ * Added support for "loaderUrl" tag
71
+ = 1.1 (10/17/16) =
72
+ * Fixed the issue that videos in Revolution Slider stopped playing
73
+ * The plugin now works on backend too
74
+ * Other small changes
75
+ = 1.0 (10/16/16) =
76
+ * Initial release