Version Description
- Added Force SSL option, to force the usage of SSL while generating the stylesheet.
- Added WP Rocket to list of Evil Plugins, because it empties the entire wp-content/cache folder instead of just its own files.
Download this release
Release Info
Developer | DaanvandenBergh |
Plugin | OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. |
Version | 3.5.0 |
Comparing to | |
See all releases |
Code changes from version 3.4.5 to 3.5.0
- host-webfonts-local.php +1 -1
- includes/admin/class-settings.php +1 -0
- includes/class-omgf.php +7 -1
- readme.txt +5 -1
- templates/admin/block-advanced-settings.phtml +13 -0
host-webfonts-local.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
* Plugin Name: OMGF
|
5 |
* Plugin URI: https://daan.dev/wordpress-plugins/host-google-fonts-locally
|
6 |
* Description: Minimize DNS requests and leverage browser cache by easily saving Google Fonts to your server and removing the external Google Fonts.
|
7 |
-
* Version: 3.
|
8 |
* Author: Daan van den Bergh
|
9 |
* Author URI: https://daan.dev
|
10 |
* License: GPL2v2 or later
|
4 |
* Plugin Name: OMGF
|
5 |
* Plugin URI: https://daan.dev/wordpress-plugins/host-google-fonts-locally
|
6 |
* Description: Minimize DNS requests and leverage browser cache by easily saving Google Fonts to your server and removing the external Google Fonts.
|
7 |
+
* Version: 3.5.0
|
8 |
* Author: Daan van den Bergh
|
9 |
* Author URI: https://daan.dev
|
10 |
* License: GPL2v2 or later
|
includes/admin/class-settings.php
CHANGED
@@ -57,6 +57,7 @@ class OMGF_Admin_Settings extends OMGF_Admin
|
|
57 |
const OMGF_ADV_SETTING_OPTIMIZE_EDIT_ROLES = 'omgf_optimize_edit_roles';
|
58 |
const OMGF_ADV_SETTING_UNINSTALL = 'omgf_uninstall';
|
59 |
const OMGF_ADV_SETTING_ENQUEUE_ORDER = 'omgf_enqueue_order';
|
|
|
60 |
const OMGF_ADV_SETTING_RELATIVE_URL = 'omgf_relative_url';
|
61 |
|
62 |
/** @var string $active_tab */
|
57 |
const OMGF_ADV_SETTING_OPTIMIZE_EDIT_ROLES = 'omgf_optimize_edit_roles';
|
58 |
const OMGF_ADV_SETTING_UNINSTALL = 'omgf_uninstall';
|
59 |
const OMGF_ADV_SETTING_ENQUEUE_ORDER = 'omgf_enqueue_order';
|
60 |
+
const OMGF_ADV_SETTING_FORCE_SSL = 'omgf_force_ssl';
|
61 |
const OMGF_ADV_SETTING_RELATIVE_URL = 'omgf_relative_url';
|
62 |
|
63 |
/** @var string $active_tab */
|
includes/class-omgf.php
CHANGED
@@ -23,7 +23,8 @@ class OMGF
|
|
23 |
* its own files.
|
24 |
*/
|
25 |
const OMGF_EVIL_PLUGINS = [
|
26 |
-
'WP Super Cache' => 'wp-super-cache/wp-cache.php'
|
|
|
27 |
];
|
28 |
|
29 |
/** @var string */
|
@@ -74,6 +75,7 @@ class OMGF
|
|
74 |
define('OMGF_AUTO_DETECT_ENABLED', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_AUTO_DETECTION_ENABLED, false)));
|
75 |
define('OMGF_CACHE_PATH', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_CACHE_PATH)) ?: '/cache/omgf-webfonts');
|
76 |
define('OMGF_CACHE_URI', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_CACHE_URI)) ?: '');
|
|
|
77 |
define('OMGF_RELATIVE_URL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_RELATIVE_URL)));
|
78 |
define('OMGF_CDN_URL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_CDN_URL)));
|
79 |
define('OMGF_WEB_FONT_LOADER', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_WEB_FONT_LOADER)));
|
@@ -188,6 +190,10 @@ class OMGF
|
|
188 |
$uploadUrl = get_site_url(OMGF_CURRENT_BLOG_ID, $this->get_content_dir() . OMGF_CACHE_PATH);
|
189 |
}
|
190 |
|
|
|
|
|
|
|
|
|
191 |
return $uploadUrl;
|
192 |
}
|
193 |
|
23 |
* its own files.
|
24 |
*/
|
25 |
const OMGF_EVIL_PLUGINS = [
|
26 |
+
'WP Super Cache' => 'wp-super-cache/wp-cache.php',
|
27 |
+
'WP Rocket' => 'wp-rocket/wp-rocket.php'
|
28 |
];
|
29 |
|
30 |
/** @var string */
|
75 |
define('OMGF_AUTO_DETECT_ENABLED', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_AUTO_DETECTION_ENABLED, false)));
|
76 |
define('OMGF_CACHE_PATH', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_CACHE_PATH)) ?: '/cache/omgf-webfonts');
|
77 |
define('OMGF_CACHE_URI', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_CACHE_URI)) ?: '');
|
78 |
+
define('OMGF_FORCE_SSL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_FORCE_SSL)));
|
79 |
define('OMGF_RELATIVE_URL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_RELATIVE_URL)));
|
80 |
define('OMGF_CDN_URL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_CDN_URL)));
|
81 |
define('OMGF_WEB_FONT_LOADER', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_WEB_FONT_LOADER)));
|
190 |
$uploadUrl = get_site_url(OMGF_CURRENT_BLOG_ID, $this->get_content_dir() . OMGF_CACHE_PATH);
|
191 |
}
|
192 |
|
193 |
+
if (OMGF_FORCE_SSL) {
|
194 |
+
$uploadUrl = str_replace('http://', 'https://', $uploadUrl);
|
195 |
+
}
|
196 |
+
|
197 |
return $uploadUrl;
|
198 |
}
|
199 |
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: DaanvandenBergh
|
|
3 |
Tags: google, fonts, gdpr, cache, speed, preload, font-display, webfonts, subsets, remove, minimize, external, requests
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.4
|
6 |
-
Stable tag: 3.
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -108,6 +108,10 @@ N/A
|
|
108 |
|
109 |
== Changelog ==
|
110 |
|
|
|
|
|
|
|
|
|
111 |
= 3.4.5 =
|
112 |
* Preload path should include absolute url, instead of relative, to prevent issues with CDN usage.
|
113 |
|
3 |
Tags: google, fonts, gdpr, cache, speed, preload, font-display, webfonts, subsets, remove, minimize, external, requests
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 5.4
|
6 |
+
Stable tag: 3.5.0
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
108 |
|
109 |
== Changelog ==
|
110 |
|
111 |
+
= 3.5.0 =
|
112 |
+
* Added Force SSL option, to force the usage of SSL while generating the stylesheet.
|
113 |
+
* Added WP Rocket to list of Evil Plugins, because it empties the entire wp-content/cache folder instead of just its own files.
|
114 |
+
|
115 |
= 3.4.5 =
|
116 |
* Preload path should include absolute url, instead of relative, to prevent issues with CDN usage.
|
117 |
|
templates/admin/block-advanced-settings.phtml
CHANGED
@@ -83,6 +83,19 @@ $utmTags = '?utm_source=omgf&utm_medium=plugin&utm_campaign=settings';
|
|
83 |
</p>
|
84 |
</td>
|
85 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
<tr valign="top">
|
87 |
<th scope="row">
|
88 |
<label for="<?= OMGF_Admin_Settings::OMGF_ADV_SETTING_RELATIVE_URL; ?>">
|
83 |
</p>
|
84 |
</td>
|
85 |
</tr>
|
86 |
+
<tr valign="top">
|
87 |
+
<th scope="row">
|
88 |
+
<label for="<?= OMGF_Admin_Settings::OMGF_ADV_SETTING_FORCE_SSL; ?>">
|
89 |
+
<?php _e('Force SSL?', 'host-webfonts-local'); ?> **
|
90 |
+
</label>
|
91 |
+
</th>
|
92 |
+
<td>
|
93 |
+
<input id="<?= OMGF_Admin_Settings::OMGF_ADV_SETTING_FORCE_SSL; ?>" class="<?= OMGF_Admin_Settings::OMGF_ADV_SETTING_FORCE_SSL; ?>" type="checkbox" name="<?= OMGF_Admin_Settings::OMGF_ADV_SETTING_FORCE_SSL; ?>" <?= OMGF_FORCE_SSL ? "checked ='checked'" : ''; ?> />
|
94 |
+
<p class="description">
|
95 |
+
<?php _e('Some plugins mess up WordPress\' URL structure, which can cause OMGF to generate incorrect URLs in the stylesheet. If OMGF is generating non-SSL (<code>http://...</code>) URLs in the stylesheet, and you have the <strong>Site</strong> and <strong>WordPress Address</strong> (in <strong>Settings</strong> > <strong>General</strong>) set to SSL (<code>https://...</code>), then enable this option.', 'host-webfonts-local'); ?>
|
96 |
+
</p>
|
97 |
+
</td>
|
98 |
+
</tr>
|
99 |
<tr valign="top">
|
100 |
<th scope="row">
|
101 |
<label for="<?= OMGF_Admin_Settings::OMGF_ADV_SETTING_RELATIVE_URL; ?>">
|