Version Description
Release Date - 20th March 2019
- Simplified Code
Download this release
Release Info
Developer | condacore |
Plugin | HTTP / HTTPS Remover: SSL Mixed Content Fix |
Version | 2.1 |
Comparing to | |
See all releases |
Code changes from version 2.0 to 2.1
- http-https-remover.php +140 -48
- index.php +1 -1
- readme.txt +7 -2
http-https-remover.php
CHANGED
@@ -3,60 +3,152 @@
|
|
3 |
* Plugin Name: HTTP / HTTPS Remover
|
4 |
* Plugin URI: https://de.wordpress.org/plugins/http-https-remover/
|
5 |
* Description: This Plugin creates protocol relative urls by removing http + https from links.
|
6 |
-
* Version: 2.
|
7 |
* Author: CONDACORE
|
8 |
* Author URI: https://condacore.com/
|
9 |
* License: GPLv3
|
10 |
*/
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
{
|
15 |
-
foreach ($sources as &$source) {
|
16 |
-
$link = str_replace("http://", "//", $source['url']);
|
17 |
-
$link = str_replace("https://", "//", $link);
|
18 |
-
$source['url'] = $link;
|
19 |
-
}
|
20 |
-
|
21 |
-
return $sources;
|
22 |
-
}
|
23 |
-
|
24 |
-
// Function for all other URLs
|
25 |
-
function callback_protcol_relative_url($buffer)
|
26 |
-
{
|
27 |
-
$re = "/(<(script|link|base|img|form|a)([^>]*)(href|src|srcset|action)=[\"'])https?:\\/\\//i";
|
28 |
-
$subst = "$1//";
|
29 |
-
$return = preg_replace($re, $subst, $buffer);
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
-
|
49 |
-
{
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
* Plugin Name: HTTP / HTTPS Remover
|
4 |
* Plugin URI: https://de.wordpress.org/plugins/http-https-remover/
|
5 |
* Description: This Plugin creates protocol relative urls by removing http + https from links.
|
6 |
+
* Version: 2.1
|
7 |
* Author: CONDACORE
|
8 |
* Author URI: https://condacore.com/
|
9 |
* License: GPLv3
|
10 |
*/
|
11 |
|
12 |
+
if (!defined('ABSPATH'))
|
13 |
+
exit;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
+
class HTTP_HTTPS_REMOVER
|
16 |
+
{
|
17 |
+
|
18 |
+
public function __construct()
|
19 |
+
{
|
20 |
+
|
21 |
+
add_action('wp_loaded', array(
|
22 |
+
$this,
|
23 |
+
'letsGo'
|
24 |
+
), 99, 1);
|
25 |
+
|
26 |
+
/* Plugin Activation Hook */
|
27 |
+
register_activation_hook( __FILE__, array($this, 'jr_default_activation_hook') );
|
28 |
+
/* Add admin notice */
|
29 |
+
add_action( 'admin_notices', array($this,'jr_activation_notice_hook') );
|
30 |
+
/* Adding links filter */
|
31 |
+
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array($this,'jr_add_action_links') );
|
32 |
+
|
33 |
+
/* Remove Trans */
|
34 |
+
|
35 |
+
add_action( 'wp_ajax_nopriv_jr_remove_trans', array($this,'jr_remove_set_transient'));
|
36 |
+
add_action( 'wp_ajax_jr_remove_trans', array($this,'jr_remove_set_transient'));
|
37 |
|
38 |
+
}
|
39 |
+
|
40 |
+
public function jr_remove_set_transient(){
|
41 |
+
delete_transient( 'jr-wp-admin-notice' );
|
42 |
+
echo "Transient Deleted!";
|
43 |
+
exit;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Create transient data
|
48 |
+
*/
|
49 |
+
|
50 |
+
public function jr_default_activation_hook() {
|
51 |
+
set_transient( 'jr-wp-admin-notice', true, 0 );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Adding Links
|
56 |
+
*/
|
57 |
+
|
58 |
+
function jr_add_action_links ( $links ) {
|
59 |
+
$mylinks = array(
|
60 |
+
'<a target="_blank" style="color:green;" href="https://sellcodes.com/s/N3bDHV
|
61 |
+
">Get share count recovery</a>',
|
62 |
+
);
|
63 |
+
return array_merge( $links, $mylinks );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Admin Notice on Activation.
|
68 |
+
*/
|
69 |
+
public function jr_activation_notice_hook(){
|
70 |
|
71 |
+
/* Check transient */
|
72 |
+
if( get_transient( 'jr-wp-admin-notice' ) ){
|
73 |
+
?>
|
74 |
+
<div class="updated notice is-dismissible http_custom_class">
|
75 |
+
<p>
|
76 |
+
Plugin "HTTP / HTTPS Remover: SSL Mixed Content Fix” has been successfully installed and activated – hurray!
|
77 |
+
</p>
|
78 |
+
<p>
|
79 |
+
<strong>Next:</strong> if you don‘t want to lose traffic to your site we strongly recommend to get the <a style="color:green;" target="_blank" href="https://sellcodes.com/s/N3bDHV">Ultimate Social Media plugin</a> which has a share count recovery feature (so that you don‘t lose any share counts after your switch to https) besides many other cool features.
|
80 |
+
</p>
|
81 |
+
<div class="notice_links" style="padding: 10px 0;">
|
82 |
+
<div style="width: 33.333%;float:left;text-align: left;">
|
83 |
+
<!--<a style="color:green;" href="#">Get plugin now</a>-->
|
84 |
+
|
85 |
+
<script type="text/javascript" src="https://sellcodes.com/quick_purchase/XdHlrQnc/embed.js"></script> <div class="sellcodes-quick-purchase"><a style="color: green;font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell, 'Helvetica Neue',sans-serif;font-size: 14px !important;text-decoration: underline !important;" class="sc-button" data-product-id="XdHlrQnc" data-option-id="4HiwuC6Y" data-referral="N3bDHV">Get plugin now</a></div>
|
86 |
+
|
87 |
+
</div>
|
88 |
+
<div style="width: 33.333%;float:left;text-align: left;">
|
89 |
+
<a style="color:green;" target="_blank" href="https://sellcodes.com/s/N3bDHV">See all plugin features </a>
|
90 |
+
</div>
|
91 |
+
<div style="width: 33.333%;float:left;text-align: left;">
|
92 |
+
<a id="remove_trans_anchor" style="color:#999;" href="#">
|
93 |
+
I‘m fine with getting less shares & traffic
|
94 |
+
</a>
|
95 |
+
</div>
|
96 |
+
<div style="clear: both;"></div>
|
97 |
+
</div>
|
98 |
+
</div>
|
99 |
+
<style>
|
100 |
+
.http_custom_class .notice-dismiss{
|
101 |
+
display: none;
|
102 |
+
}
|
103 |
+
</style>
|
104 |
|
105 |
+
<script>
|
106 |
+
var ajax_request_url = '<?php echo admin_url('admin-ajax.php'); ?>';
|
107 |
+
jQuery(document).ready(function($){
|
108 |
+
$("#remove_trans_anchor").on("click",function(e){
|
109 |
+
e.preventDefault();
|
110 |
+
$.ajax({
|
111 |
+
url: ajax_request_url,
|
112 |
+
type: "POST",
|
113 |
+
data: "action=jr_remove_trans",
|
114 |
+
success:function(response){
|
115 |
+
jQuery('.http_custom_class .notice-dismiss').trigger('click');
|
116 |
+
}
|
117 |
+
});
|
118 |
+
});
|
119 |
+
})
|
120 |
+
</script>
|
121 |
+
<?php
|
122 |
+
//delete_transient( 'jr-wp-admin-notice' );
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
|
127 |
+
public function letsGo()
|
128 |
+
{
|
129 |
+
global $pagenow;
|
130 |
+
ob_start(array(
|
131 |
+
$this,
|
132 |
+
'mainPath'
|
133 |
+
));
|
134 |
+
}
|
135 |
+
|
136 |
+
public function mainPath($buffer)
|
137 |
+
{
|
138 |
+
$content_type = NULL;
|
139 |
+
foreach (headers_list() as $header) {
|
140 |
+
if (strpos(strtolower($header), 'content-type:') === 0) {
|
141 |
+
$pieces = explode(':', strtolower($header));
|
142 |
+
$content_type = trim($pieces[1]);
|
143 |
+
break;
|
144 |
+
}
|
145 |
+
}
|
146 |
+
if (is_null($content_type) || substr($content_type, 0, 9) === 'text/html') {
|
147 |
+
|
148 |
+
$buffer = preg_replace('/https?:/i', '', $buffer);
|
149 |
+
|
150 |
+
}
|
151 |
+
return $buffer;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
new HTTP_HTTPS_REMOVER();
|
index.php
CHANGED
@@ -10,5 +10,5 @@
|
|
10 |
#
|
11 |
# Plugin: HTTP / HTTPS Remover
|
12 |
# Created by: Marius Bolik
|
13 |
-
# Copyright:
|
14 |
# Web: https://condacore.com
|
10 |
#
|
11 |
# Plugin: HTTP / HTTPS Remover
|
12 |
# Created by: Marius Bolik
|
13 |
+
# Copyright: 2019 © CONDACORE
|
14 |
# Web: https://condacore.com
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: condacore
|
|
3 |
Donate link: https://www.paypal.me/MariusBolik
|
4 |
Tags: SSL, https, force SSL, mixed content, insecure content, secure website, website security, TLS, security, secure socket layers, HSTS
|
5 |
Requires at least: 3.0.1
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -90,6 +90,11 @@ Change all your CDN references to load with // (this will adapt based on how the
|
|
90 |
|
91 |
== Changelog ==
|
92 |
|
|
|
|
|
|
|
|
|
|
|
93 |
= 2.0 =
|
94 |
*Release Date - 1 March 2018*
|
95 |
|
3 |
Donate link: https://www.paypal.me/MariusBolik
|
4 |
Tags: SSL, https, force SSL, mixed content, insecure content, secure website, website security, TLS, security, secure socket layers, HSTS
|
5 |
Requires at least: 3.0.1
|
6 |
+
Tested up to: 5.1.1
|
7 |
+
Stable tag: 2.1
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
90 |
|
91 |
== Changelog ==
|
92 |
|
93 |
+
= 2.1 =
|
94 |
+
*Release Date - 20th March 2019*
|
95 |
+
|
96 |
+
* Simplified Code
|
97 |
+
|
98 |
= 2.0 =
|
99 |
*Release Date - 1 March 2018*
|
100 |
|