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

Version Description

| October 18th, 2022 = * Added: Groovy Menu compatibility * Added: OMGF now shows a dismissable warning when you're selecting a lot of preloads. * Fixed: Cannot use object as array error. This error would be thrown if OMGF temporarily failed to fetch Google Fonts. * Fixed: Not all implementations of Google Maps were properly recognized by the Task Manager. * Fixed: some debug information was always generated, even when Debug Mode wasn't enabled.

Download this release

Release Info

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

Code changes from version 5.4.1 to 5.4.2

assets/css/omgf-admin.css CHANGED
@@ -155,6 +155,24 @@
155
  .omgf-optimize-fonts-container .omgf-optimize-fonts-manage {
156
  text-align: left;
157
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
158
  .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table {
159
  width: 100%;
160
  border-collapse: collapse;
155
  .omgf-optimize-fonts-container .omgf-optimize-fonts-manage {
156
  text-align: left;
157
  }
158
+ .omgf-optimize-fonts-container .omgf-optimize-fonts-manage #omgf-optimize-preload-warning {
159
+ position: fixed;
160
+ top: 50%;
161
+ left: 33%;
162
+ width: 33%;
163
+ padding: 20px 40px;
164
+ background-color: #fff5b5;
165
+ border: 2px solid #FFDC00;
166
+ border-radius: 4px;
167
+ box-shadow: 1px 1px 333px #333;
168
+ z-index: 1000;
169
+ }
170
+ .omgf-optimize-fonts-container .omgf-optimize-fonts-manage #omgf-optimize-preload-warning .omgf-optimize-preload-warning-close {
171
+ float: right;
172
+ font-size: 2em;
173
+ line-height: 0.45;
174
+ cursor: pointer;
175
+ }
176
  .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table {
177
  width: 100%;
178
  border-collapse: collapse;
assets/css/omgf-admin.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["omgf-admin.less"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkBA,K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,EACG;EACC,iBAAA;EACA,cAAA;;AAOV,eA/BN,SAGE,kBAKE,QAuBG;EACC,kBAAA;;AADF,eA/BN,SAGE,kBAKE,QAuBG,KAGC;EACE,kBAAA;;AAJJ,eA/BN,SAGE,kBAKE,QAuBG,KAGC,WAGE;EACE,cAAA;;AASd,wBAA0C;EACxC;IACE,cAAA;;EADF,8BAGE;IACE,kBAAA;IACA,aAAA;IACA,YAAA;;;;;;AAQN;EACE,eAAA;EACA,0CAAA;EACA,WAAA;EACA,YAAA;EACA,MAAA;EACA,kBAAA;;AANF,aAQE;EACE,QAAA;EACA,SAAA;EACA,kBAAA;EACA,eAAe,gBAAf;EACA,WAAW,gBAAX;;;;;AAOJ,gBACE;EACE,uBAAA;;AAIA,gBADF,WACG;EACC,sBAAA;;AAGF,gBALF,WAKG,WAAW;EACV,cAAA;;AAXN,gBAeE;EACE,WAAA"}
assets/css/omgf-admin.less CHANGED
@@ -188,6 +188,26 @@
188
  .omgf-optimize-fonts-manage {
189
  text-align: left;
190
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  table {
192
  width: 100%;
193
  border-collapse: collapse;
188
  .omgf-optimize-fonts-manage {
189
  text-align: left;
190
 
191
+ #omgf-optimize-preload-warning {
192
+ position: fixed;
193
+ top: 50%;
194
+ left: 33%;
195
+ width: 33%;
196
+ padding: 20px 40px;
197
+ background-color: #fff5b5;
198
+ border: 2px solid #FFDC00;
199
+ border-radius: 4px;
200
+ box-shadow: 1px 1px 333px #333;
201
+ z-index: 1000;
202
+
203
+ .omgf-optimize-preload-warning-close {
204
+ float: right;
205
+ font-size: 2em;
206
+ line-height: 0.45;
207
+ cursor: pointer;
208
+ }
209
+ }
210
+
211
  table {
212
  width: 100%;
213
  border-collapse: collapse;
assets/js/omgf-admin.js CHANGED
@@ -35,6 +35,7 @@ jQuery(document).ready(function ($) {
35
  $('.omgf-optimize-fonts-manage .unload, .omgf-optimize-fonts-manage .fallback-font-stack select').on('change', this.generate_cache_key);
36
  $('.omgf-optimize-fonts-manage .unload').on('change', this.toggle_preload);
37
  $('.omgf-optimize-fonts-manage .preload').on('change', this.toggle_unload);
 
38
  $('.omgf-optimize-fonts-manage .unload-italics').on('click', this.unload_italics);
39
  $('.omgf-optimize-fonts-manage .unload-all').on('click', this.unload_all);
40
  $('.omgf-optimize-fonts-manage .load-all').on('click', this.load_all);
@@ -47,6 +48,7 @@ jQuery(document).ready(function ($) {
47
  $('.omgf-empty, #omgf-cache-flush').on('click', this.empty_cache_directory);
48
  $('#omgf-optimize-settings-form').on('submit', this.show_loader_before_submit);
49
  $('#omgf-delete-log').on('click', this.delete_log);
 
50
 
51
  // Ticker
52
  setInterval(this.loop_ticker_items, 4000);
@@ -260,6 +262,22 @@ jQuery(document).ready(function ($) {
260
  omgf_admin.toggle(this, 'unload');
261
  },
262
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  /**
264
  * Unload all italic styles for current font family.
265
  */
35
  $('.omgf-optimize-fonts-manage .unload, .omgf-optimize-fonts-manage .fallback-font-stack select').on('change', this.generate_cache_key);
36
  $('.omgf-optimize-fonts-manage .unload').on('change', this.toggle_preload);
37
  $('.omgf-optimize-fonts-manage .preload').on('change', this.toggle_unload);
38
+ $('.omgf-optimize-fonts-manage .preload').on('change', this.maybe_show_preload_warning);
39
  $('.omgf-optimize-fonts-manage .unload-italics').on('click', this.unload_italics);
40
  $('.omgf-optimize-fonts-manage .unload-all').on('click', this.unload_all);
41
  $('.omgf-optimize-fonts-manage .load-all').on('click', this.load_all);
48
  $('.omgf-empty, #omgf-cache-flush').on('click', this.empty_cache_directory);
49
  $('#omgf-optimize-settings-form').on('submit', this.show_loader_before_submit);
50
  $('#omgf-delete-log').on('click', this.delete_log);
51
+ $('.omgf-optimize-preload-warning-close').on('click', this.hide_preload_warning);
52
 
53
  // Ticker
54
  setInterval(this.loop_ticker_items, 4000);
262
  omgf_admin.toggle(this, 'unload');
263
  },
264
 
265
+ /**
266
+ * Show users a preload warning when amount of checked preloads equals 5.
267
+ */
268
+ maybe_show_preload_warning: function () {
269
+ if ($('.' + this.className + ':checked').length === 5) {
270
+ $('#omgf-optimize-preload-warning').fadeIn('300');
271
+ }
272
+ },
273
+
274
+ /**
275
+ * When the cross is clicked, hide the preload warning.
276
+ */
277
+ hide_preload_warning: function () {
278
+ $('#omgf-optimize-preload-warning').fadeOut('100');
279
+ },
280
+
281
  /**
282
  * Unload all italic styles for current font family.
283
  */
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/DSVGO compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
7
- * Version: 5.4.1
8
  * Author: Daan from Daan.dev
9
  * Author URI: https://daan.dev
10
  * License: GPL2v2 or later
@@ -19,7 +19,7 @@ defined('ABSPATH') || exit;
19
  define('OMGF_PLUGIN_DIR', plugin_dir_path(__FILE__));
20
  define('OMGF_PLUGIN_FILE', __FILE__);
21
  define('OMGF_PLUGIN_BASENAME', plugin_basename(OMGF_PLUGIN_FILE));
22
- define('OMGF_STATIC_VERSION', '5.4.1');
23
  define('OMGF_DB_VERSION', '5.3.4');
24
 
25
  /**
4
  * Plugin Name: OMGF
5
  * Plugin URI: https://daan.dev/wordpress/omgf/
6
  * Description: Increase GDPR/DSVGO compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
7
+ * Version: 5.4.2
8
  * Author: Daan from Daan.dev
9
  * Author URI: https://daan.dev
10
  * License: GPL2v2 or later
19
  define('OMGF_PLUGIN_DIR', plugin_dir_path(__FILE__));
20
  define('OMGF_PLUGIN_FILE', __FILE__);
21
  define('OMGF_PLUGIN_BASENAME', plugin_basename(OMGF_PLUGIN_FILE));
22
+ define('OMGF_STATIC_VERSION', '5.4.2');
23
  define('OMGF_DB_VERSION', '5.3.4');
24
 
25
  /**
includes/admin/settings/class-optimize.php CHANGED
@@ -273,6 +273,16 @@ class OMGF_Admin_Settings_Optimize extends OMGF_Admin_Settings_Builder
273
  {
274
  ?>
275
  <div class="omgf-optimize-fonts-manage">
 
 
 
 
 
 
 
 
 
 
276
  <p>
277
 
278
  </p>
273
  {
274
  ?>
275
  <div class="omgf-optimize-fonts-manage">
276
+ <div id="omgf-optimize-preload-warning" style="display: none;">
277
+ <span class="omgf-optimize-preload-warning-close">×</span>
278
+ <h3><?php echo __('Wow! That\'s a lot of Preloads! 😲', $this->plugin_text_domain); ?></h3>
279
+ <p>
280
+ <?php echo __('You\'ve selected 5 (!) font styles to load early. Selecting more font styles to preload will affect your site\'s performance. The <code>preload</code> attribute should only be used for font styles loaded above the fold i.e. <strong>The top portion of a web page that\'s visible without scrolling</strong>.', $this->plugin_text_domain); ?>
281
+ </p>
282
+ <p>
283
+ <?php echo sprintf(__('Refer to the <a href="%s" target="_blank">Plugin documentation</a> for more information.', $this->plugin_text_domain), 'https://daan.dev/docs/omgf-pro/optimize-local-fonts/'); ?>
284
+ </p>
285
+ </div>
286
  <p>
287
 
288
  </p>
includes/class-admin.php CHANGED
@@ -200,21 +200,35 @@ class OMGF_Admin
200
  if ($value != $old_value && $old_value !== false) {
201
  global $wp_settings_errors;
202
 
 
 
203
  if (!empty($wp_settings_errors)) {
204
- $wp_settings_errors = [];
205
- }
 
206
 
207
- update_option(OMGF_Admin_Settings::OMGF_CACHE_IS_STALE, true);
 
 
208
 
209
- add_settings_error(
210
- 'general',
211
- 'omgf_cache_style',
212
- sprintf(
213
- __('OMGF\'s cached stylesheets don\'t reflect the current settings. Refresh the cache from the <a href="%s">Task Manager</a>.', $this->plugin_text_domain),
214
- admin_url(OMGF_Admin_Settings::OMGF_OPTIONS_GENERAL_PAGE_OPTIMIZE_WEBFONTS)
215
- ),
216
- 'success'
217
- );
 
 
 
 
 
 
 
 
 
218
  }
219
 
220
  return $value;
200
  if ($value != $old_value && $old_value !== false) {
201
  global $wp_settings_errors;
202
 
203
+ $show_message = true;
204
+
205
  if (!empty($wp_settings_errors)) {
206
+ foreach ($wp_settings_errors as $error) {
207
+ if (strpos($error['code'], 'omgf') !== false) {
208
+ $show_message = false;
209
 
210
+ break;
211
+ }
212
+ }
213
 
214
+ if ($show_message) {
215
+ $wp_settings_errors = [];
216
+ }
217
+ }
218
+
219
+ if ($show_message) {
220
+ update_option(OMGF_Admin_Settings::OMGF_CACHE_IS_STALE, true);
221
+
222
+ add_settings_error(
223
+ 'general',
224
+ 'omgf_cache_style',
225
+ sprintf(
226
+ __('OMGF\'s cached stylesheets don\'t reflect the current settings. Refresh the cache from the <a href="%s">Task Manager</a>.', $this->plugin_text_domain),
227
+ admin_url(OMGF_Admin_Settings::OMGF_OPTIONS_GENERAL_PAGE_OPTIMIZE_WEBFONTS)
228
+ ),
229
+ 'success'
230
+ );
231
+ }
232
  }
233
 
234
  return $value;
includes/class-omgf.php CHANGED
@@ -60,12 +60,11 @@ class OMGF
60
  * [OMGF-73] TODO: Most used Support chat widgets.
61
  */
62
  const IFRAMES_LOADING_FONTS = [
63
- 'google-ads' => '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', // Google Ads
64
- 'youtube' => '//www.youtube.com/embed/', // Youtube Embeds
65
- 'google-maps-embeds' => '//www.google.com/maps/embed', // Google Maps
66
- 'google-maps-js-api' => '//maps.google.com/maps/api/js', // Google Maps JS API
67
- 'recaptcha' => '//www.google.com/recaptcha/api.js', // Recaptcha
68
- 'tawk.to' => '//embed.tawk.to' // Tawk.to
69
  ];
70
 
71
  private $plugin_text_domain = 'host-webfonts-local';
@@ -626,6 +625,13 @@ class OMGF
626
  */
627
  public static function debug_array($name, $array)
628
  {
 
 
 
 
 
 
 
629
  if (!is_array($array) && !is_object($array)) {
630
  return;
631
  }
60
  * [OMGF-73] TODO: Most used Support chat widgets.
61
  */
62
  const IFRAMES_LOADING_FONTS = [
63
+ 'google-ads' => '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js', // Google Ads
64
+ 'youtube' => '//www.youtube.com/embed/', // Youtube Embeds
65
+ 'google-maps' => '.google.com/maps', // Google Maps
66
+ 'recaptcha' => '//www.google.com/recaptcha/api.js', // Recaptcha
67
+ 'tawk.to' => '//embed.tawk.to' // Tawk.to
 
68
  ];
69
 
70
  private $plugin_text_domain = 'host-webfonts-local';
625
  */
626
  public static function debug_array($name, $array)
627
  {
628
+ if (
629
+ OMGF_DEBUG_MODE !== 'on' ||
630
+ (OMGF_DEBUG_MODE === 'on' && file_exists(self::$log_file) && filesize(self::$log_file) > MB_IN_BYTES)
631
+ ) {
632
+ return;
633
+ }
634
+
635
  if (!is_array($array) && !is_object($array)) {
636
  return;
637
  }
includes/class-optimize.php CHANGED
@@ -199,7 +199,7 @@ class OMGF_Optimize
199
  *
200
  * @param $url Google Fonts API request, e.g. https://fonts.googleapis.com/css?family=Open+Sans:100,200,300,400italic
201
  *
202
- * @return stdClass
203
  */
204
  private function grab_fonts_object($url)
205
  {
@@ -212,7 +212,7 @@ class OMGF_Optimize
212
  $code = wp_remote_retrieve_response_code($response);
213
 
214
  if ($code !== 200) {
215
- return new stdClass();
216
  }
217
 
218
  $stylesheet = wp_remote_retrieve_body($response);
@@ -222,7 +222,7 @@ class OMGF_Optimize
222
  preg_match_all('/font-family:\s\'(.*?)\';/', $stylesheet, $font_families);
223
 
224
  if (!isset($font_families[1]) || empty($font_families[1])) {
225
- return new stdClass();
226
  }
227
 
228
  $font_families = array_unique($font_families[1]);
199
  *
200
  * @param $url Google Fonts API request, e.g. https://fonts.googleapis.com/css?family=Open+Sans:100,200,300,400italic
201
  *
202
+ * @return array
203
  */
204
  private function grab_fonts_object($url)
205
  {
212
  $code = wp_remote_retrieve_response_code($response);
213
 
214
  if ($code !== 200) {
215
+ return [];
216
  }
217
 
218
  $stylesheet = wp_remote_retrieve_body($response);
222
  preg_match_all('/font-family:\s\'(.*?)\';/', $stylesheet, $font_families);
223
 
224
  if (!isset($font_families[1]) || empty($font_families[1])) {
225
+ return [];
226
  }
227
 
228
  $font_families = array_unique($font_families[1]);
includes/frontend/class-process.php CHANGED
@@ -111,10 +111,16 @@ class OMGF_Frontend_Process
111
  add_filter('omgf_buffer_output', [$this, 'remove_resource_hints'], 11);
112
 
113
  /** Only hook into our own filter if Smart Slider 3 isn't active, as it has its own filter. */
114
- if (!function_exists('smart_slider_3_plugins_loaded')) {
 
 
 
115
  add_filter('omgf_buffer_output', [$this, 'parse']);
116
  }
117
 
 
 
 
118
  /** Smart Slider 3 compatibility */
119
  add_filter('wordpress_prepare_output', [$this, 'parse'], 11);
120
 
111
  add_filter('omgf_buffer_output', [$this, 'remove_resource_hints'], 11);
112
 
113
  /** Only hook into our own filter if Smart Slider 3 isn't active, as it has its own filter. */
114
+ if (
115
+ !function_exists('smart_slider_3_plugins_loaded')
116
+ || !function_exists('groovy_menu_init_classes')
117
+ ) {
118
  add_filter('omgf_buffer_output', [$this, 'parse']);
119
  }
120
 
121
+ /** Groovy Menu compatibility */
122
+ add_filter('groovy_menu_final_output', [$this, 'parse'], 11);
123
+
124
  /** Smart Slider 3 compatibility */
125
  add_filter('wordpress_prepare_output', [$this, 'parse'], 11);
126
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: DaanvandenBergh
3
  Tags: google, fonts, gdpr, dsvgo, 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.4.1
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,13 @@ For the FAQ, [click here](https://daan.dev/docs/omgf-pro-faq/).
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
 
 
79
  = 5.4.1 | October 12th, 2022 =
80
  * Added: make the Auto-Configure Adv. Processing notice under Detection Settings more noticable.
81
  * Added: Show info box in Task Manager when Test Mode is enabled.
3
  Tags: google, fonts, gdpr, dsvgo, 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.4.2
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.4.2 | October 18th, 2022 =
80
+ * Added: Groovy Menu compatibility
81
+ * Added: OMGF now shows a dismissable warning when you're selecting a lot of preloads.
82
+ * Fixed: Cannot use object as array error. This error would be thrown if OMGF temporarily failed to fetch Google Fonts.
83
+ * Fixed: Not all implementations of Google Maps were properly recognized by the Task Manager.
84
+ * Fixed: some debug information was always generated, even when Debug Mode wasn't enabled.
85
+
86
  = 5.4.1 | October 12th, 2022 =
87
  * Added: make the Auto-Configure Adv. Processing notice under Detection Settings more noticable.
88
  * Added: Show info box in Task Manager when Test Mode is enabled.