Version Description
- Added settings page for plugin configurations
- General bug fixes
- Code & Performance improvement
Download this release
Release Info
Developer | Steve85b |
Plugin | HTTP / HTTPS Remover: SSL Mixed Content Fix |
Version | 3.0 |
Comparing to | |
See all releases |
Code changes from version 2.4 to 3.0
- css/style.css +23 -0
- http-https-remover.php +227 -95
- index.php +1 -6
- js/script.js +14 -0
- readme.txt +21 -4
css/style.css
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.green {
|
2 |
+
color: #008000;
|
3 |
+
}
|
4 |
+
.notices {
|
5 |
+
padding: 10px 0;
|
6 |
+
}
|
7 |
+
.notice_links {
|
8 |
+
width: 33.333%;
|
9 |
+
float: left;
|
10 |
+
text-align: left;
|
11 |
+
}
|
12 |
+
.gray {
|
13 |
+
color: #999;
|
14 |
+
}
|
15 |
+
.http_custom_class .notice-dismiss {
|
16 |
+
display: none;
|
17 |
+
}
|
18 |
+
.textarea {
|
19 |
+
width: 60%;
|
20 |
+
}
|
21 |
+
.form-table td {
|
22 |
+
padding: 20px 10px;
|
23 |
+
}
|
http-https-remover.php
CHANGED
@@ -1,34 +1,31 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name: HTTP / HTTPS
|
4 |
-
* Plugin URI: https://wordpress.org/plugins/http-https-
|
5 |
* Description: This Plugin creates protocol relative urls by removing http + https from links.
|
6 |
-
* Version:
|
7 |
* Author: Steve85b
|
8 |
* Author URI: -
|
9 |
* License: GPLv3
|
10 |
*/
|
11 |
-
require_once 'analyst/main.php';
|
12 |
|
|
|
13 |
analyst_init(array(
|
14 |
'client-id' => 'jl0865yb0z3bgmew',
|
15 |
'client-secret' => 'f07b52982090022fd84d273455f40dc3a5ccf328',
|
16 |
'base-dir' => __FILE__
|
17 |
));
|
18 |
|
19 |
-
|
20 |
if (!defined('ABSPATH'))
|
21 |
exit;
|
22 |
|
23 |
-
class
|
24 |
{
|
25 |
-
|
26 |
public function __construct()
|
27 |
{
|
28 |
-
|
29 |
add_action('wp_loaded', array(
|
30 |
$this,
|
31 |
-
'
|
32 |
), 99, 1);
|
33 |
|
34 |
/* Plugin Activation Hook */
|
@@ -37,11 +34,153 @@ class HTTP_HTTPS_REMOVER
|
|
37 |
add_action('admin_notices', array($this, 'jr_activation_notice_hook'));
|
38 |
/* Adding links filter */
|
39 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'jr_add_action_links'));
|
40 |
-
|
41 |
/* Remove Trans */
|
42 |
-
|
43 |
add_action('wp_ajax_nopriv_jr_remove_trans', array($this, 'jr_remove_set_transient'));
|
44 |
add_action('wp_ajax_jr_remove_trans', array($this, 'jr_remove_set_transient'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
public function jr_remove_set_transient()
|
@@ -54,23 +193,24 @@ class HTTP_HTTPS_REMOVER
|
|
54 |
/**
|
55 |
* Create transient data
|
56 |
*/
|
57 |
-
|
58 |
public function jr_default_activation_hook()
|
59 |
{
|
60 |
set_transient('jr-wp-admin-notice', true, 0);
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
|
63 |
/**
|
64 |
* Adding Links
|
65 |
*/
|
66 |
-
|
67 |
function jr_add_action_links($links)
|
68 |
{
|
69 |
-
$
|
70 |
-
'<a target="_blank"
|
71 |
-
">Get share count recovery</a>',
|
72 |
);
|
73 |
-
return array_merge($links, $
|
74 |
}
|
75 |
|
76 |
/**
|
@@ -78,95 +218,87 @@ class HTTP_HTTPS_REMOVER
|
|
78 |
*/
|
79 |
public function jr_activation_notice_hook()
|
80 |
{
|
81 |
-
|
82 |
/* Check transient */
|
83 |
-
if (get_transient('jr-wp-admin-notice')) {
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
<
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
|
|
102 |
</div>
|
103 |
-
<div style="width: 33.333%;float:left;text-align: left;">
|
104 |
-
<a id="remove_trans_anchor" style="color:#999;" href="#">
|
105 |
-
I‘m fine with getting less shares & traffic
|
106 |
-
</a>
|
107 |
-
</div>
|
108 |
-
<div style="clear: both;"></div>
|
109 |
</div>
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
display: none;
|
114 |
-
}
|
115 |
-
</style>
|
116 |
-
|
117 |
-
<script>
|
118 |
-
var ajax_request_url = '<?php echo admin_url('admin-ajax.php'); ?>';
|
119 |
-
jQuery(document).ready(function($) {
|
120 |
-
$("#remove_trans_anchor").on("click", function(e) {
|
121 |
-
e.preventDefault();
|
122 |
-
$.ajax({
|
123 |
-
url: ajax_request_url,
|
124 |
-
type: "POST",
|
125 |
-
data: "action=jr_remove_trans",
|
126 |
-
success: function(response) {
|
127 |
-
jQuery('.http_custom_class .notice-dismiss').trigger('click');
|
128 |
-
}
|
129 |
-
});
|
130 |
-
});
|
131 |
-
})
|
132 |
-
</script>
|
133 |
-
<?php
|
134 |
-
//delete_transient( 'jr-wp-admin-notice' );
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
ob_start(array(
|
145 |
-
$this,
|
146 |
-
'mainPath'
|
147 |
-
));
|
148 |
-
}
|
149 |
|
150 |
-
public function
|
151 |
-
{
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
|
|
|
|
159 |
}
|
160 |
-
if (is_null($content_type) || substr($content_type, 0, 9) === 'text/html') {
|
161 |
|
162 |
-
|
|
|
|
|
|
|
|
|
163 |
}
|
164 |
-
return $buffer;
|
165 |
}
|
166 |
-
}
|
167 |
-
$http_https_remover = new HTTP_HTTPS_REMOVER();
|
168 |
|
169 |
-
|
|
|
|
|
170 |
{
|
171 |
// The path to our plugin's main file
|
172 |
$our_plugin = plugin_basename(__FILE__);
|
@@ -181,4 +313,4 @@ function wp_upe_upgrade_completed($upgrader_object, $options)
|
|
181 |
}
|
182 |
}
|
183 |
}
|
184 |
-
add_action('upgrader_process_complete', '
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: HTTP / HTTPS Removal
|
4 |
+
* Plugin URI: https://wordpress.org/plugins/http-https-Removal/
|
5 |
* Description: This Plugin creates protocol relative urls by removing http + https from links.
|
6 |
+
* Version: 3.0
|
7 |
* Author: Steve85b
|
8 |
* Author URI: -
|
9 |
* License: GPLv3
|
10 |
*/
|
|
|
11 |
|
12 |
+
require_once 'analyst/main.php';
|
13 |
analyst_init(array(
|
14 |
'client-id' => 'jl0865yb0z3bgmew',
|
15 |
'client-secret' => 'f07b52982090022fd84d273455f40dc3a5ccf328',
|
16 |
'base-dir' => __FILE__
|
17 |
));
|
18 |
|
|
|
19 |
if (!defined('ABSPATH'))
|
20 |
exit;
|
21 |
|
22 |
+
class HTTP_HTTPS_Removal
|
23 |
{
|
|
|
24 |
public function __construct()
|
25 |
{
|
|
|
26 |
add_action('wp_loaded', array(
|
27 |
$this,
|
28 |
+
'init'
|
29 |
), 99, 1);
|
30 |
|
31 |
/* Plugin Activation Hook */
|
34 |
add_action('admin_notices', array($this, 'jr_activation_notice_hook'));
|
35 |
/* Adding links filter */
|
36 |
add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'jr_add_action_links'));
|
|
|
37 |
/* Remove Trans */
|
|
|
38 |
add_action('wp_ajax_nopriv_jr_remove_trans', array($this, 'jr_remove_set_transient'));
|
39 |
add_action('wp_ajax_jr_remove_trans', array($this, 'jr_remove_set_transient'));
|
40 |
+
add_action('admin_init', array($this, 'httpHttpsRegisterSettings'));
|
41 |
+
add_action('admin_menu', array($this,'httpHttpsRegisterOptionPage'));
|
42 |
+
add_action('admin_head', array($this, 'adminAssets'));
|
43 |
+
add_action('activated_plugin', array($this,'httphttpsRemovalRedirect'));
|
44 |
+
}
|
45 |
+
|
46 |
+
public function httphttpsRemovalRedirect($plugin) {
|
47 |
+
if( $plugin == plugin_basename( __FILE__ ) ) {
|
48 |
+
exit(wp_redirect(admin_url('options-general.php?page=httphttpsRemoval')));
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
public function httpHttpsRegisterSettings() {
|
53 |
+
register_setting('httphttpsRemovalOptionGroup', 'httpHttpsRemovalOptions');
|
54 |
+
|
55 |
+
add_settings_section('httphttpsRemovalSection','','','httphttpsRemovalOptionGroup');
|
56 |
+
|
57 |
+
add_settings_field(
|
58 |
+
'enableDisable',
|
59 |
+
__('Enable/Disable', 'httphttpsRemovalOptionGroup'),
|
60 |
+
array($this,'enableDisableCallback'),
|
61 |
+
'httphttpsRemovalOptionGroup',
|
62 |
+
'httphttpsRemovalSection',
|
63 |
+
[
|
64 |
+
'label_for' => 'enableDisable'
|
65 |
+
]
|
66 |
+
);
|
67 |
+
|
68 |
+
add_settings_field(
|
69 |
+
'fixGoogleFonts',
|
70 |
+
__( 'Fix Google Fonts Issue', 'httphttpsRemovalOptionGroup' ),
|
71 |
+
array($this,'fixGoogleFontsCallback'),
|
72 |
+
'httphttpsRemovalOptionGroup',
|
73 |
+
'httphttpsRemovalSection',
|
74 |
+
[
|
75 |
+
'label_for' => 'fixGoogleFonts'
|
76 |
+
]
|
77 |
+
);
|
78 |
+
|
79 |
+
add_settings_field(
|
80 |
+
'ignoreURLs',
|
81 |
+
__( 'Ignore URLs', 'httphttpsRemovalOptionGroup' ),
|
82 |
+
array($this,'ignoreURLsCallback'),
|
83 |
+
'httphttpsRemovalOptionGroup',
|
84 |
+
'httphttpsRemovalSection',
|
85 |
+
[
|
86 |
+
'label_for' => 'ignoreURLs',
|
87 |
+
]
|
88 |
+
);
|
89 |
+
|
90 |
+
add_settings_field(
|
91 |
+
'ignoreAdmin',
|
92 |
+
__( 'Ignore Admin Links', 'httphttpsRemovalOptionGroup' ),
|
93 |
+
array($this,'ignoreAdminCallback'),
|
94 |
+
'httphttpsRemovalOptionGroup',
|
95 |
+
'httphttpsRemovalSection',
|
96 |
+
[
|
97 |
+
'label_for' => 'ignoreAdmin'
|
98 |
+
]
|
99 |
+
);
|
100 |
+
}
|
101 |
+
|
102 |
+
public function enableDisableCallback($args)
|
103 |
+
{
|
104 |
+
// get the value of the setting we've registered with register_setting()
|
105 |
+
$options = get_option('httpHttpsRemovalOptions');
|
106 |
+
$checked = "";
|
107 |
+
if ( is_array( $options ) && $options['enableDisable'] == '1' ) {
|
108 |
+
$checked = 'Checked';
|
109 |
+
}
|
110 |
+
// output the field
|
111 |
+
?>
|
112 |
+
<input type="checkbox" name="httpHttpsRemovalOptions[<?php echo esc_attr( $args['label_for'] ); ?>]" value="1" <?php echo $checked;?> id="<?php echo esc_attr( $args['label_for'] ); ?>">
|
113 |
+
<span>Enable HTTP/HTTPs Removal</span>
|
114 |
+
<p class="description">
|
115 |
+
<?php esc_html_e( '(Only when you enable it the http/https removal will be active. Please don\'t forget to click on "Save" below!)', 'httpHttpsRemovalOptions' ); ?>
|
116 |
+
</p>
|
117 |
+
<?php
|
118 |
+
}
|
119 |
+
|
120 |
+
public function fixGoogleFontsCallback($args)
|
121 |
+
{
|
122 |
+
$options = get_option('httpHttpsRemovalOptions');
|
123 |
+
$checked = "";
|
124 |
+
if ( is_array( $options ) && $options['fixGoogleFonts'] == '1' ) {
|
125 |
+
$checked = 'Checked';
|
126 |
+
}
|
127 |
+
?>
|
128 |
+
<input type="checkbox" name="httpHttpsRemovalOptions[<?php echo esc_attr( $args['label_for'] ); ?>]" value="1" <?php echo $checked;?> id="<?php echo esc_attr( $args['label_for'] ); ?>">
|
129 |
+
<span>Fix Google Fonts Issue.</span>
|
130 |
+
<p class="description">
|
131 |
+
<?php esc_html_e( '(If you don\'t want to remove http/https from Google Fonts URL, please check this option!)', 'httpHttpsRemovalOptions' ); ?>
|
132 |
+
</p>
|
133 |
+
<?php
|
134 |
+
}
|
135 |
+
|
136 |
+
public function ignoreURLsCallback($args)
|
137 |
+
{
|
138 |
+
$options = get_option('httpHttpsRemovalOptions');
|
139 |
+
?>
|
140 |
+
<textarea name="httpHttpsRemovalOptions[<?php echo esc_attr( $args['label_for'] ); ?>]" id="<?php echo esc_attr( $args['label_for'] ); ?>" cols="15" rows="10" class="textarea"><?php echo $options['ignoreURLs']?></textarea>
|
141 |
+
<p class="description">
|
142 |
+
<?php esc_html_e( '(Please add URL of the website here [one URL in one line]). Plugin will ignore those URLs to remove http/https!)', 'httpHttpsRemovalOptions' ); ?>
|
143 |
+
</p>
|
144 |
+
<?php
|
145 |
+
}
|
146 |
+
|
147 |
+
public function ignoreAdminCallback($args)
|
148 |
+
{
|
149 |
+
$options = get_option('httpHttpsRemovalOptions');
|
150 |
+
$checked = "";
|
151 |
+
if ( is_array( $options ) && $options['ignoreAdmin'] == '1' ) {
|
152 |
+
$checked = 'Checked';
|
153 |
+
}
|
154 |
+
?>
|
155 |
+
<input type="checkbox" name="httpHttpsRemovalOptions[<?php echo esc_attr( $args['label_for'] ); ?>]" value="1" <?php echo $checked;?> id="<?php echo esc_attr( $args['label_for'] ); ?>">
|
156 |
+
<span>Ignore dashboard links</span>
|
157 |
+
<p class="description">
|
158 |
+
<?php esc_html_e( '(If you check this, plugin will ignore links from administrator area!)', 'httpHttpsRemovalOptions' ); ?>
|
159 |
+
</p>
|
160 |
+
<?php
|
161 |
+
}
|
162 |
+
|
163 |
+
public function httpHttpsRegisterOptionPage()
|
164 |
+
{
|
165 |
+
add_options_page('HTTP/HTTPs Removal Settings', 'HTTP/HTTPs Removal Settings', 'manage_options', 'httphttpsRemoval', array($this,'httphttpsRemovalOptionPage'));
|
166 |
+
}
|
167 |
+
|
168 |
+
public function httphttpsRemovalOptionPage()
|
169 |
+
{
|
170 |
+
if (!current_user_can('manage_options')) {
|
171 |
+
return;
|
172 |
+
}
|
173 |
+
?>
|
174 |
+
<div class="wrap">
|
175 |
+
<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
|
176 |
+
<form method="post" action="options.php">
|
177 |
+
<?php settings_fields( 'httphttpsRemovalOptionGroup' );
|
178 |
+
do_settings_sections( 'httphttpsRemovalOptionGroup' );
|
179 |
+
submit_button('Save Settings'); ?>
|
180 |
+
</form>
|
181 |
+
</div>
|
182 |
+
<div class="clear"></div>
|
183 |
+
<?php
|
184 |
}
|
185 |
|
186 |
public function jr_remove_set_transient()
|
193 |
/**
|
194 |
* Create transient data
|
195 |
*/
|
|
|
196 |
public function jr_default_activation_hook()
|
197 |
{
|
198 |
set_transient('jr-wp-admin-notice', true, 0);
|
199 |
+
if(get_option('httpHttpsRemovalOptions') == '') {
|
200 |
+
$default = array('enableDisable' => '1');
|
201 |
+
update_option('httpHttpsRemovalOptions', $default, true);
|
202 |
+
}
|
203 |
}
|
204 |
|
205 |
/**
|
206 |
* Adding Links
|
207 |
*/
|
|
|
208 |
function jr_add_action_links($links)
|
209 |
{
|
210 |
+
$updated_links = array(
|
211 |
+
'<a target="_blank" class="green" href="https://sellcodes.com/s/Ocs1aK">Get share count recovery</a>',
|
|
|
212 |
);
|
213 |
+
return array_merge($links, $updated_links);
|
214 |
}
|
215 |
|
216 |
/**
|
218 |
*/
|
219 |
public function jr_activation_notice_hook()
|
220 |
{
|
|
|
221 |
/* Check transient */
|
222 |
+
if (get_transient('jr-wp-admin-notice')) { ?>
|
223 |
+
<div class="updated notice is-dismissible http_custom_class">
|
224 |
+
<p>Plugin "HTTP / HTTPS Removal: SSL Mixed Content Fix” has been successfully installed and activated – hurray!</p>
|
225 |
+
<p>
|
226 |
+
<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/Ocs1aK">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.
|
227 |
+
</p>
|
228 |
+
<div class="notices">
|
229 |
+
<div class="notice_links">
|
230 |
+
<script type="text/javascript" src="https://sellcodes.com/quick_purchase/XdHlrQnc/embed.js"></script>
|
231 |
+
<div class="sellcodes-quick-purchase">
|
232 |
+
<a style="color: #008000;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="Ocs1aK">Get plugin now</a>
|
233 |
+
</div>
|
234 |
+
</div>
|
235 |
+
<div class="notice_links">
|
236 |
+
<a class="green" target="_blank" href="https://sellcodes.com/s/Ocs1aK">See all plugin features </a>
|
237 |
+
</div>
|
238 |
+
<div class="notice_links">
|
239 |
+
<a id="remove_trans_anchor" class="gray" href="#">I‘m fine with getting less shares & traffic</a>
|
240 |
+
</div>
|
241 |
+
<div style="clear: both;"></div>
|
242 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
243 |
</div>
|
244 |
+
<?php
|
245 |
+
}
|
246 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
+
public function init()
|
249 |
+
{
|
250 |
+
$options = get_option('httpHttpsRemovalOptions');
|
251 |
+
// If plugin settings is not enabled, do not proceed
|
252 |
+
if (!is_array($options) || $options['enableDisable'] != '1') {
|
253 |
+
return;
|
254 |
+
}
|
255 |
+
// If ignore admin links
|
256 |
+
if ((is_admin() && is_array($options) && $options['ignoreAdmin'] == '1')) {
|
257 |
+
return;
|
258 |
+
}
|
259 |
|
260 |
+
add_filter('script_loader_src', array($this,'removeHttpHttps'));
|
261 |
+
add_filter('style_loader_src', array($this,'removeHttpHttps'));
|
262 |
+
}
|
|
|
|
|
|
|
|
|
|
|
263 |
|
264 |
+
public function removeHttpHttps($url)
|
265 |
+
{
|
266 |
+
$options = get_option('httpHttpsRemovalOptions');
|
267 |
+
if (is_array($options) && $options['fixGoogleFonts'] == '1') {
|
268 |
+
if (strpos($url, 'fonts.googleapis.com') !== false) {
|
269 |
+
return $url;
|
270 |
+
}
|
271 |
+
}
|
272 |
+
if (is_array($options) && $options['ignoreURLs'] != '') {
|
273 |
+
$ignoredArr = preg_split('/\r\n|[\r\n]/', $options['ignoreURLs']);
|
274 |
+
foreach($ignoredArr as $ignoreURLs) {
|
275 |
+
$parsedUrl = parse_url($ignoreURLs);
|
276 |
+
if($parsedUrl['path'] != '') {
|
277 |
+
$host = $parsedUrl['path'];
|
278 |
+
}
|
279 |
+
else {
|
280 |
+
$host = $parsedUrl['host'];
|
281 |
+
}
|
282 |
+
if (strpos($url, $host) !== false) {
|
283 |
+
return $url;
|
284 |
+
}
|
285 |
+
}
|
286 |
}
|
287 |
+
$url = preg_replace('/https?:/i', '', $url);
|
288 |
+
return $url;
|
289 |
}
|
|
|
290 |
|
291 |
+
public function adminAssets()
|
292 |
+
{
|
293 |
+
wp_enqueue_style('admin-style', plugin_dir_url( __FILE__ ).'css/style.css', array(), '1.0');
|
294 |
+
wp_enqueue_script('admin-js', plugin_dir_url( __FILE__ ).'js/script.js', array(), '1.0');
|
295 |
+
wp_localize_script('admin-js', 'script_vars', array('ajax_url' => admin_url( 'admin-ajax.php' ) ) );
|
296 |
}
|
|
|
297 |
}
|
|
|
|
|
298 |
|
299 |
+
$http_https_Removal = new HTTP_HTTPS_Removal();
|
300 |
+
|
301 |
+
function jr_upgrade_completed($upgrader_object, $options)
|
302 |
{
|
303 |
// The path to our plugin's main file
|
304 |
$our_plugin = plugin_basename(__FILE__);
|
313 |
}
|
314 |
}
|
315 |
}
|
316 |
+
add_action('upgrader_process_complete', 'jr_upgrade_completed', 10, 2);
|
index.php
CHANGED
@@ -1,7 +1,2 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
#
|
4 |
-
#
|
5 |
-
# Plugin: HTTP / HTTPS Remover
|
6 |
-
# Created by: Steve85b
|
7 |
-
# Copyright: 2019 © Steve85b
|
1 |
<?php
|
2 |
+
// Silence is golden.
|
|
|
|
|
|
|
|
|
|
js/script.js
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var ajax_request_url = script_vars.ajax_url;
|
2 |
+
jQuery(document).ready(function($) {
|
3 |
+
$("#remove_trans_anchor").on("click", function(e) {
|
4 |
+
e.preventDefault();
|
5 |
+
$.ajax({
|
6 |
+
url: ajax_request_url,
|
7 |
+
type: "POST",
|
8 |
+
data: "action=jr_remove_trans",
|
9 |
+
success: function(response) {
|
10 |
+
jQuery('.http_custom_class .notice-dismiss').trigger('click');
|
11 |
+
}
|
12 |
+
});
|
13 |
+
});
|
14 |
+
})
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: Steve85b
|
|
3 |
Tags: SSL, https, force SSL, mixed content, insecure content, secure website, website security, TLS, security, secure socket layers, HSTS
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 5.3
|
6 |
-
Stable tag:
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
@@ -11,11 +11,18 @@ A fix for mixed content! This Plugin creates protocol relative urls by removing
|
|
11 |
|
12 |
== Description ==
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
Main features:
|
15 |
|
16 |
* Works in Front- and Backend
|
17 |
* Makes every Plugin compatible with https
|
18 |
-
* No Setup needed
|
19 |
* Compatible with Visual Composer & Disqus
|
20 |
* Fixes Google Fonts issues
|
21 |
* Makes your website faster
|
@@ -38,9 +45,9 @@ and would load if the web page was http or https.
|
|
38 |
|
39 |
**Tipp:** Check your Settings -> General page and make sure your WordPress Address and Site Address are starting with "https".
|
40 |
Add the following two lines in your wp-config.php above the line that says "Stop Editing Here":
|
41 |
-
`
|
42 |
define('FORCE_SSL', true);
|
43 |
-
define('FORCE_SSL_ADMIN',true);
|
44 |
`
|
45 |
|
46 |
= What is Mixed Content? =
|
@@ -89,6 +96,11 @@ Change all your CDN references to load with // (this will adapt based on how the
|
|
89 |
|
90 |
== Changelog ==
|
91 |
|
|
|
|
|
|
|
|
|
|
|
92 |
= 2.4 =
|
93 |
* Updated links
|
94 |
|
@@ -236,3 +248,8 @@ Change all your CDN references to load with // (this will adapt based on how the
|
|
236 |
*Release Date - 16 October 2016*
|
237 |
|
238 |
* Initial release
|
|
|
|
|
|
|
|
|
|
3 |
Tags: SSL, https, force SSL, mixed content, insecure content, secure website, website security, TLS, security, secure socket layers, HSTS
|
4 |
Requires at least: 3.0.1
|
5 |
Tested up to: 5.3
|
6 |
+
Stable tag: 3.0
|
7 |
License: GPLv3
|
8 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
9 |
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
+
UPDATE: This plugin will be maintained again! It changed ownership and we're currently collecting ideas how to further improve it. If you have any cool ideas, please let us know in Support Forum. Thank you!
|
15 |
+
|
16 |
+
Major updated in the latest release (3.0):
|
17 |
+
- Plugin has a proper settings page now
|
18 |
+
- Many bugs fixed
|
19 |
+
- Code optimized, causing performance to increase a lot
|
20 |
+
|
21 |
+
|
22 |
Main features:
|
23 |
|
24 |
* Works in Front- and Backend
|
25 |
* Makes every Plugin compatible with https
|
|
|
26 |
* Compatible with Visual Composer & Disqus
|
27 |
* Fixes Google Fonts issues
|
28 |
* Makes your website faster
|
45 |
|
46 |
**Tipp:** Check your Settings -> General page and make sure your WordPress Address and Site Address are starting with "https".
|
47 |
Add the following two lines in your wp-config.php above the line that says "Stop Editing Here":
|
48 |
+
`
|
49 |
define('FORCE_SSL', true);
|
50 |
+
define('FORCE_SSL_ADMIN',true);
|
51 |
`
|
52 |
|
53 |
= What is Mixed Content? =
|
96 |
|
97 |
== Changelog ==
|
98 |
|
99 |
+
= 3.0 =
|
100 |
+
* Added settings page for plugin configurations
|
101 |
+
* General bug fixes
|
102 |
+
* Code & Performance improvement
|
103 |
+
|
104 |
= 2.4 =
|
105 |
* Updated links
|
106 |
|
248 |
*Release Date - 16 October 2016*
|
249 |
|
250 |
* Initial release
|
251 |
+
|
252 |
+
== Upgrade Notice ==
|
253 |
+
|
254 |
+
= 3.0 =
|
255 |
+
Major updates - please upgrade!
|