OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. - Version 3.4.2

Version Description

  • OMGF now returns a readable error if Auto Detect detects a misformatted fonts URL.
Download this release

Release Info

Developer DaanvandenBergh
Plugin Icon 128x128 OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy.
Version 3.4.2
Comparing to
See all releases

Code changes from version 3.4.1 to 3.4.2

Files changed (3) hide show
  1. host-webfonts-local.php +1 -1
  2. includes/class-api.php +4 -2
  3. readme.txt +4 -1
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.4.1
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.4.2
8
  * Author: Daan van den Bergh
9
  * Author URI: https://daan.dev
10
  * License: GPL2v2 or later
includes/class-api.php CHANGED
@@ -55,8 +55,10 @@ class OMGF_API
55
  {
56
  $request = wp_remote_get(OMGF_HELPER_URL . $font_family . '?subsets=' . $selected_subsets);
57
 
58
- if (is_wp_error($request)) {
59
- OMGF_Admin_Notice::set_notice($request->get_error_message(), true, 'error', $request->get_error_code());
 
 
60
  }
61
 
62
  $result = json_decode($request['body']);
55
  {
56
  $request = wp_remote_get(OMGF_HELPER_URL . $font_family . '?subsets=' . $selected_subsets);
57
 
58
+ if (wp_remote_retrieve_body($request) == 'Not found') {
59
+ OMGF_Admin_Notice::set_notice(wp_remote_retrieve_response_message($request) . ': ' . $font_family, false, 'error', wp_remote_retrieve_response_code($request));
60
+
61
+ return [];
62
  }
63
 
64
  $result = json_decode($request['body']);
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.4.1
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,9 @@ N/A
108
 
109
  == Changelog ==
110
 
 
 
 
111
  = 3.4.1 =
112
  * 'Optimize fonts for logged in users?' should be on by default, cause it causes to much confusion.
113
  * Fixed bug where Auto Detect would fail if no font styles were specified in the Google Font URL.
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.4.2
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.4.2 =
112
+ * OMGF now returns a readable error if Auto Detect detects a misformatted fonts URL.
113
+
114
  = 3.4.1 =
115
  * 'Optimize fonts for logged in users?' should be on by default, cause it causes to much confusion.
116
  * Fixed bug where Auto Detect would fail if no font styles were specified in the Google Font URL.