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

Version Description

| August 10th, 2022 = * Added: compatibility for Download Manager and other plugin who insert stylesheet into the head using multiple lines. * Added: omgf_generate_stylesheet_after filter. * Added: omgf_optimize_fonts_object filter.

Download this release

Release Info

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

Code changes from version 5.3.5 to 5.3.6

host-webfonts-local.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: OMGF
5
  * Plugin URI: https://daan.dev/wordpress/omgf/
6
  * Description: Increase GDPR compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
7
- * Version: 5.3.5
8
  * Author: Daan from Daan.dev
9
  * Author URI: https://daan.dev
10
  * License: GPL2v2 or later
4
  * Plugin Name: OMGF
5
  * Plugin URI: https://daan.dev/wordpress/omgf/
6
  * Description: Increase GDPR compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
7
+ * Version: 5.3.6
8
  * Author: Daan from Daan.dev
9
  * Author URI: https://daan.dev
10
  * License: GPL2v2 or later
includes/class-optimize.php CHANGED
@@ -198,7 +198,7 @@ class OMGF_Optimize
198
  */
199
  private function grab_fonts_object($url)
200
  {
201
- OMGF::debug(__('Fetching stylesheet from: ', $this->plugin_text_domain) . $url);
202
 
203
  $response = wp_remote_get($url, [
204
  'user-agent' => self::USER_AGENT['woff2']
@@ -236,7 +236,7 @@ class OMGF_Optimize
236
 
237
  OMGF::debug(__('Stylesheet successfully converted to object.', $this->plugin_text_domain));
238
 
239
- return $object;
240
  }
241
 
242
  /**
198
  */
199
  private function grab_fonts_object($url)
200
  {
201
+ OMGF::debug(__('Fetching stylesheet form: ', $this->plugin_text_domain) . $url);
202
 
203
  $response = wp_remote_get($url, [
204
  'user-agent' => self::USER_AGENT['woff2']
236
 
237
  OMGF::debug(__('Stylesheet successfully converted to object.', $this->plugin_text_domain));
238
 
239
+ return apply_filters('omgf_optimize_fonts_object', $object, $url);
240
  }
241
 
242
  /**
includes/class-stylesheet-generator.php CHANGED
@@ -70,6 +70,8 @@ class OMGF_StylesheetGenerator
70
  }
71
  }
72
 
 
 
73
  return $stylesheet;
74
  }
75
 
70
  }
71
  }
72
 
73
+ $stylesheet = apply_filters('omgf_generate_stylesheet_after', $stylesheet, $this->fonts);
74
+
75
  return $stylesheet;
76
  }
77
 
includes/frontend/class-process.php CHANGED
@@ -249,7 +249,7 @@ class OMGF_Frontend_Process
249
  * @since v5.1.5 Use a lookaround that matches all link elements, because otherwise
250
  * matches grow past their supposed boundaries.
251
  */
252
- preg_match_all('/(?=\<link).+?(?<=>)/', $html, $resource_hints);
253
 
254
  if (!isset($resource_hints[0]) || empty($resource_hints[0])) {
255
  return $html;
@@ -308,7 +308,7 @@ class OMGF_Frontend_Process
308
  /**
309
  * @since v5.3.5 Use a generic regex and filter them separately.
310
  */
311
- preg_match_all('/<link.*?[\/]?>/', $html, $links);
312
 
313
  if (!isset($links[0]) || empty($links[0])) {
314
  return apply_filters('omgf_processed_html', $html, $this);
249
  * @since v5.1.5 Use a lookaround that matches all link elements, because otherwise
250
  * matches grow past their supposed boundaries.
251
  */
252
+ preg_match_all('/(?=\<link).+?(?<=>)/s', $html, $resource_hints);
253
 
254
  if (!isset($resource_hints[0]) || empty($resource_hints[0])) {
255
  return $html;
308
  /**
309
  * @since v5.3.5 Use a generic regex and filter them separately.
310
  */
311
+ preg_match_all('/<link.*?[\/]?>/s', $html, $links);
312
 
313
  if (!isset($links[0]) || empty($links[0])) {
314
  return apply_filters('omgf_processed_html', $html, $this);
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: 6.0
6
- Stable tag: 5.3.5
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -76,6 +76,11 @@ For the FAQ, [click here](https://daan.dev/docs/omgf-pro-faq/).
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
79
  = 5.3.5 | August 2nd, 2022 =
80
  * Fixed: use a more reliable regular expression to detect Google Fonts.
81
  * Fixed: Divi/Elementor compatibility is now disabled by default.
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: 6.0
6
+ Stable tag: 5.3.6
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
76
 
77
  == Changelog ==
78
 
79
+ = 5.3.6 | August 10th, 2022 =
80
+ * Added: compatibility for Download Manager and other plugin who insert stylesheet into the `head` using multiple lines.
81
+ * Added: omgf_generate_stylesheet_after filter.
82
+ * Added: omgf_optimize_fonts_object filter.
83
+
84
  = 5.3.5 | August 2nd, 2022 =
85
  * Fixed: use a more reliable regular expression to detect Google Fonts.
86
  * Fixed: Divi/Elementor compatibility is now disabled by default.