Version Description
- Small fix for themes/page builders which requests Google Fonts with protocol relative URI i.e. '//fonts.googleapis.com' instead of 'https://fonts.googleapis.com'.
- Tested with Elementor. Works.
Download this release
Release Info
Developer | DaanvandenBergh |
Plugin | OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. |
Version | 4.2.2 |
Comparing to | |
See all releases |
Code changes from version 4.2.1 to 4.2.2
- host-webfonts-local.php +1 -1
- includes/frontend/class-functions.php +8 -2
- readme.txt +6 -2
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, leverage browser cache and speed up WordPress by saving Google Fonts to your server and removing external Google Fonts requests.
|
7 |
-
* Version: 4.2.
|
8 |
* Author: Daan (from Fast FW Press)
|
9 |
* Author URI: https://ffwp.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, leverage browser cache and speed up WordPress by saving Google Fonts to your server and removing external Google Fonts requests.
|
7 |
+
* Version: 4.2.2
|
8 |
* Author: Daan (from Fast FW Press)
|
9 |
* Author URI: https://ffwp.dev
|
10 |
* License: GPL2v2 or later
|
includes/frontend/class-functions.php
CHANGED
@@ -188,8 +188,14 @@ class OMGF_Frontend_Functions
|
|
188 |
}
|
189 |
|
190 |
if ( OMGF_OPTIMIZATION_MODE == 'auto' || ( OMGF_OPTIMIZATION_MODE == 'manual' && isset( $_GET['omgf_optimize'] ) ) ) {
|
191 |
-
$api_url
|
192 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
193 |
}
|
194 |
}
|
195 |
}
|
188 |
}
|
189 |
|
190 |
if ( OMGF_OPTIMIZATION_MODE == 'auto' || ( OMGF_OPTIMIZATION_MODE == 'manual' && isset( $_GET['omgf_optimize'] ) ) ) {
|
191 |
+
$api_url = str_replace( [ 'http:', 'https:' ], '', site_url( '/wp-json/omgf/v1/download/' ) );
|
192 |
+
$protocol = '';
|
193 |
+
|
194 |
+
if ( substr( $font->src, 0, 2 ) == '//' ) {
|
195 |
+
$protocol = 'https:';
|
196 |
+
}
|
197 |
+
|
198 |
+
$wp_styles->registered[ $handle ]->src = $protocol . str_replace( '//fonts.googleapis.com/', $api_url, $font->src ) . "&handle=$updated_handle&original_handle=$handle";
|
199 |
}
|
200 |
}
|
201 |
}
|
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.5
|
6 |
-
Stable tag: 4.2.
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -49,7 +49,7 @@ Everything in the free version, plus:
|
|
49 |
- Reduce loading time and page size, by forcing the used subset(s) for all Google Fonts requests,
|
50 |
- Remove Resource Hints (preload, preconnect, dns-prefetch) pointing to fonts.googleapis.com or fonts.gstatic.com.
|
51 |
|
52 |
-
*[Purchase OMGF Pro](https://ffwp.dev/wordpress/omgf-pro/) | [Documentation](https://ffwp.dev/docs/omgf-pro/)
|
53 |
|
54 |
== Installation ==
|
55 |
|
@@ -122,6 +122,10 @@ No, not yet. But I will definitely try to make it compatible in the future!
|
|
122 |
|
123 |
== Changelog ==
|
124 |
|
|
|
|
|
|
|
|
|
125 |
= 4.2.1 =
|
126 |
* OMGF now checks secure (https://) and non-secure (http://) requests to Google Fonts, because apparently some themes still do that, even though it's 2020, but whatever.
|
127 |
* Tested with Divi and Bridge Theme. Works.
|
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.5
|
6 |
+
Stable tag: 4.2.2
|
7 |
Requires PHP: 7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
49 |
- Reduce loading time and page size, by forcing the used subset(s) for all Google Fonts requests,
|
50 |
- Remove Resource Hints (preload, preconnect, dns-prefetch) pointing to fonts.googleapis.com or fonts.gstatic.com.
|
51 |
|
52 |
+
*[Purchase OMGF Pro](https://ffwp.dev/wordpress/omgf-pro/) | [Documentation](https://ffwp.dev/docs/omgf-pro/) | [Tested Plugins & Themes](https://ffwp.dev/docs/omgf-pro/troubleshooting/compatibility/)*
|
53 |
|
54 |
== Installation ==
|
55 |
|
122 |
|
123 |
== Changelog ==
|
124 |
|
125 |
+
= 4.2.2 =
|
126 |
+
* Small fix for themes/page builders which requests Google Fonts with protocol relative URI i.e. '//fonts.googleapis.com' instead of 'https://fonts.googleapis.com'.
|
127 |
+
* Tested with Elementor. Works.
|
128 |
+
|
129 |
= 4.2.1 =
|
130 |
* OMGF now checks secure (https://) and non-secure (http://) requests to Google Fonts, because apparently some themes still do that, even though it's 2020, but whatever.
|
131 |
* Tested with Divi and Bridge Theme. Works.
|