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

Version Description

  • Fixed: using print_r() in an output buffer caused 500 errors.
    • Removed the remaining (one) entries of OMGF::debug, because of this and Test Mode now allows for much user-friendly testing, anyway.
    • the OMGF::debug() wrapper is still there for hardcore in code debugging.
  • Several code tweaks and fixes.
Download this release

Release Info

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

Code changes from version 5.1.0 to 5.1.1

assets/css/omgf-admin.css CHANGED
@@ -117,34 +117,6 @@
117
  width: 100%;
118
  border-collapse: collapse;
119
  }
120
- .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table .tooltip {
121
- position: relative;
122
- font-size: 16px;
123
- line-height: 16px;
124
- height: 12px;
125
- }
126
- .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table .tooltip .tooltip-text {
127
- visibility: hidden;
128
- position: absolute;
129
- top: 100%;
130
- left: 100%;
131
- z-index: 10000;
132
- background-color: rgba(0, 0, 0, 0.75);
133
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
134
- font-size: 0.8em;
135
- color: #fff;
136
- line-height: 1.5;
137
- width: 250px;
138
- padding: 10px;
139
- margin-left: -125px;
140
- border-radius: 3px;
141
- }
142
- .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table .tooltip .tooltip-text .illustration {
143
- margin-top: 10px;
144
- }
145
- .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table .tooltip:hover .tooltip-text {
146
- visibility: visible;
147
- }
148
  .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table thead th {
149
  width: 13%;
150
  }
@@ -194,6 +166,34 @@
194
  .omgf-optimize-fonts-container ul {
195
  text-align: justify;
196
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  #omgf-help-form .postbox {
198
  padding: 0 15px 5px;
199
  }
117
  width: 100%;
118
  border-collapse: collapse;
119
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
120
  .omgf-optimize-fonts-container .omgf-optimize-fonts-manage table thead th {
121
  width: 13%;
122
  }
166
  .omgf-optimize-fonts-container ul {
167
  text-align: justify;
168
  }
169
+ .tooltip {
170
+ position: relative;
171
+ font-size: 16px;
172
+ line-height: 16px;
173
+ height: 12px;
174
+ }
175
+ .tooltip .tooltip-text {
176
+ visibility: hidden;
177
+ position: absolute;
178
+ top: 100%;
179
+ left: 100%;
180
+ z-index: 10000;
181
+ background-color: rgba(0, 0, 0, 0.75);
182
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
183
+ font-size: 0.8em;
184
+ color: #fff;
185
+ line-height: 1.5;
186
+ width: 250px;
187
+ padding: 10px;
188
+ margin-left: -125px;
189
+ border-radius: 3px;
190
+ }
191
+ .tooltip .tooltip-text .illustration {
192
+ margin-top: 10px;
193
+ }
194
+ .tooltip:hover .tooltip-text {
195
+ visibility: visible;
196
+ }
197
  #omgf-help-form .postbox {
198
  padding: 0 15px 5px;
199
  }
assets/css/omgf-admin.css.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["omgf-admin.less"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAkBA,KACE;EACE,WAAA;EACA,qBAAA;EACA,yBAAA;EACA,gBAAA;EACA,eAAA;EACA,kBAAA;EACA,mBAAA;EACA,4BAAA;;AAEA,KAVF,eAUG;EACC,eAAA;EACA,mBAAA;EACA,WAAA;EACA,qBAAA;;;;;AAQN;EACE,oBAAA;;AADF,SAGE;EACE,eAAA;;AAJJ,SAOE,kBAAiB;EACf,oBAAA;EACA,mBAAA;;AAIJ,KAAM;EACJ,iBAAA;;AADF,KAAM,KAGJ;EACE,iBA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A;EACA,iBAAA;EACA,YAAA;;AAJF,QAME;EACE,kBAAA;EACA,kBAAA;EACA,SAAA;EACA,UAAA;EACA,cAAA;EACA,qCAAA;EACA,gDAA8C,oDAA+C,4BAA7F;EACA,gBAAA;EACA,WAAA;EACA,gBAAA;EACA,YAAA;EACA,aAAA;EACA,mBAAA;EACA,kBAAA;;AApBJ,QAME,cAgBE;EACE,gBAAA;;AAIJ,QAAC,MAAO;EACN,mBAAA;;AAIJ,eACE;EACE,mBAAA;;AAFJ,eACE,SAGE;EACE,aAAA;EACA,mBAAA;EACA,8BAAA;;AAPN,eACE,SAGE,kBAKE,QACE,GACE;EACE,mBAAA;;AAEA,eAbV,SAGE,kBAKE,QACE,GACE,GAGG;EACC,mBAAA;;AAfd,eACE,SAGE,kBAKE,QACE,GACE,GAOE;EACE,qBAAA;EACA,iBAAA;;AAGE,eAtBd,SAGE,kBAKE,QACE,GACE,GAOE,EAIE,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;;;;;AAOH,gBACC;EACE,uBAAA;;AAIA,gBADF,WACG;EACC,sBAAA;;AAGF,gBALF,WAKG,WAAW;EACV,cAAA;;AAXL,gBAeC;EACE,WAAA"}
assets/css/omgf-admin.less CHANGED
@@ -141,38 +141,6 @@
141
  width: 100%;
142
  border-collapse: collapse;
143
 
144
- .tooltip {
145
- position: relative;
146
- font-size: 16px;
147
- line-height: 16px;
148
- height: 12px;
149
-
150
- .tooltip-text {
151
- visibility: hidden;
152
- position: absolute;
153
- top: 100%;
154
- left: 100%;
155
- z-index: 10000;
156
- background-color: rgba(0, 0, 0, 0.75);
157
- font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
158
- font-size: .8em;
159
- color: #fff;
160
- line-height: 1.5;
161
- width: 250px;
162
- padding: 10px;
163
- margin-left: -125px;
164
- border-radius: 3px;
165
-
166
- .illustration {
167
- margin-top: 10px;
168
- }
169
- }
170
-
171
- &:hover .tooltip-text {
172
- visibility: visible;
173
- }
174
- }
175
-
176
  thead {
177
  th {
178
  width: 13%;
@@ -245,6 +213,38 @@
245
  }
246
  }
247
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  #omgf-help-form {
249
  .postbox {
250
  padding: 0 15px 5px;
141
  width: 100%;
142
  border-collapse: collapse;
143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  thead {
145
  th {
146
  width: 13%;
213
  }
214
  }
215
 
216
+ .tooltip {
217
+ position: relative;
218
+ font-size: 16px;
219
+ line-height: 16px;
220
+ height: 12px;
221
+
222
+ .tooltip-text {
223
+ visibility: hidden;
224
+ position: absolute;
225
+ top: 100%;
226
+ left: 100%;
227
+ z-index: 10000;
228
+ background-color: rgba(0, 0, 0, 0.75);
229
+ font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;
230
+ font-size: .8em;
231
+ color: #fff;
232
+ line-height: 1.5;
233
+ width: 250px;
234
+ padding: 10px;
235
+ margin-left: -125px;
236
+ border-radius: 3px;
237
+
238
+ .illustration {
239
+ margin-top: 10px;
240
+ }
241
+ }
242
+
243
+ &:hover .tooltip-text {
244
+ visibility: visible;
245
+ }
246
+ }
247
+
248
  #omgf-help-form {
249
  .postbox {
250
  padding: 0 15px 5px;
assets/js/omgf-admin.js CHANGED
@@ -20,7 +20,7 @@ jQuery(document).ready(function ($) {
20
  empty_cache_directory_xhr: false,
21
  optimize_xhr: false,
22
  cache_prefix: '-mod-',
23
- cache_section: $('.omgf-empty').data('cache-section'),
24
  nonce: $('.omgf-empty').data('nonce'),
25
 
26
  /**
@@ -295,7 +295,7 @@ jQuery(document).ready(function ($) {
295
  data: {
296
  action: 'omgf_empty_dir',
297
  nonce: omgf_admin.nonce,
298
- section: omgf_admin.cache_section
299
  },
300
  beforeSend: function () {
301
  omgf_admin.show_loader();
@@ -306,7 +306,7 @@ jQuery(document).ready(function ($) {
306
  });
307
  },
308
 
309
- show_loader_before_submit: function (e) {
310
  omgf_admin.show_loader();
311
  },
312
 
20
  empty_cache_directory_xhr: false,
21
  optimize_xhr: false,
22
  cache_prefix: '-mod-',
23
+ flush_action_init: $('.omgf-empty').data('init'),
24
  nonce: $('.omgf-empty').data('nonce'),
25
 
26
  /**
295
  data: {
296
  action: 'omgf_empty_dir',
297
  nonce: omgf_admin.nonce,
298
+ init: omgf_admin.flush_action_init
299
  },
300
  beforeSend: function () {
301
  omgf_admin.show_loader();
306
  });
307
  },
308
 
309
+ show_loader_before_submit: function () {
310
  omgf_admin.show_loader();
311
  },
312
 
host-webfonts-local.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: OMGF
5
  * Plugin URI: https://ffw.press/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.1.0
8
  * Author: Daan from FFW.Press
9
  * Author URI: https://ffw.press
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.0.0');
23
  define('OMGF_DB_VERSION', '5.0.0');
24
 
25
  /**
4
  * Plugin Name: OMGF
5
  * Plugin URI: https://ffw.press/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.1.1
8
  * Author: Daan from FFW.Press
9
  * Author URI: https://ffw.press
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.1.1');
23
  define('OMGF_DB_VERSION', '5.0.0');
24
 
25
  /**
includes/admin/settings/class-optimize.php CHANGED
@@ -143,7 +143,7 @@ class OMGF_Admin_Settings_Optimize extends OMGF_Admin_Settings_Builder
143
  <tr>
144
  <th scope="row"><?php _e('Flush Cache', $this->plugin_text_domain); ?></th>
145
  <td class="task-manager-row">
146
- <a id="omgf-empty" data-cache-section="/*" data-nonce="<?= wp_create_nonce(OMGF_Admin_Settings::OMGF_ADMIN_PAGE); ?>" class="omgf-empty button-cancel"><?php _e('Empty Cache Directory', $this->plugin_text_domain); ?></a>
147
  </td>
148
  </tr>
149
  <?php
143
  <tr>
144
  <th scope="row"><?php _e('Flush Cache', $this->plugin_text_domain); ?></th>
145
  <td class="task-manager-row">
146
+ <a id="omgf-empty" data-init="<?= OMGF_Admin_Settings::OMGF_ADMIN_PAGE; ?>" data-nonce="<?= wp_create_nonce(OMGF_Admin_Settings::OMGF_ADMIN_PAGE); ?>" class="omgf-empty button-cancel"><?php _e('Empty Cache Directory', $this->plugin_text_domain); ?></a>
147
  </td>
148
  </tr>
149
  <?php
includes/class-ajax.php CHANGED
@@ -100,7 +100,7 @@ class OMGF_AJAX
100
 
101
  add_filter('omgf_clean_up_instructions', function () {
102
  return [
103
- 'section' => '/',
104
  'exclude' => [],
105
  'queue' => [
106
  OMGF_Admin_Settings::OMGF_CACHE_IS_STALE
@@ -108,7 +108,7 @@ class OMGF_AJAX
108
  ];
109
  });
110
 
111
- $this->empty_cache('/');
112
 
113
  delete_option(OMGF_Admin_Settings::OMGF_CACHE_IS_STALE);
114
  }
@@ -127,19 +127,10 @@ class OMGF_AJAX
127
  wp_die(__("Hmmm, you're not supposed to be here.", $this->plugin_text_domain));
128
  }
129
 
130
- $section = str_replace('*', '', $_POST['section']);
131
- $set_path = rtrim(OMGF_UPLOAD_DIR . $section, '/');
132
- $resolved_path = realpath(OMGF_UPLOAD_DIR . $section);
133
-
134
- if ($resolved_path != $set_path) {
135
- wp_die(__('Attempted path traversal detected. Sorry, no script kiddies allowed!', $this->plugin_text_domain));
136
- }
137
-
138
  try {
139
- $section = $_POST['section'];
140
- $entries = array_filter((array) glob(OMGF_UPLOAD_DIR . $section));
141
 
142
- $this->empty_cache($section, $entries);
143
 
144
  OMGF_Admin_Notice::set_notice(__('Cache directory successfully emptied.', $this->plugin_text_domain));
145
  } catch (\Exception $e) {
@@ -152,13 +143,13 @@ class OMGF_AJAX
152
  }
153
  }
154
 
155
- private function empty_cache($section)
156
  {
157
- $entries = array_filter((array) glob(OMGF_UPLOAD_DIR . $section));
158
  $instructions = apply_filters(
159
  'omgf_clean_up_instructions',
160
  [
161
- 'section' => $section,
162
  'exclude' => [],
163
  'queue' => [
164
  OMGF_Admin_Settings::OMGF_CACHE_IS_STALE,
100
 
101
  add_filter('omgf_clean_up_instructions', function () {
102
  return [
103
+ 'init' => OMGF_Admin_Settings::OMGF_ADMIN_PAGE,
104
  'exclude' => [],
105
  'queue' => [
106
  OMGF_Admin_Settings::OMGF_CACHE_IS_STALE
108
  ];
109
  });
110
 
111
+ $this->empty_cache();
112
 
113
  delete_option(OMGF_Admin_Settings::OMGF_CACHE_IS_STALE);
114
  }
127
  wp_die(__("Hmmm, you're not supposed to be here.", $this->plugin_text_domain));
128
  }
129
 
 
 
 
 
 
 
 
 
130
  try {
131
+ $init = $_POST['init'] ?? '';
 
132
 
133
+ $this->empty_cache($init);
134
 
135
  OMGF_Admin_Notice::set_notice(__('Cache directory successfully emptied.', $this->plugin_text_domain));
136
  } catch (\Exception $e) {
143
  }
144
  }
145
 
146
+ private function empty_cache($initiator = 'optimize-webfonts')
147
  {
148
+ $entries = array_filter((array) glob(OMGF_UPLOAD_DIR . '/*'));
149
  $instructions = apply_filters(
150
  'omgf_clean_up_instructions',
151
  [
152
+ 'init' => $initiator,
153
  'exclude' => [],
154
  'queue' => [
155
  OMGF_Admin_Settings::OMGF_CACHE_IS_STALE,
includes/frontend/class-process.php CHANGED
@@ -319,8 +319,6 @@ class OMGF_Frontend_Process
319
  {
320
  $google_fonts = [];
321
 
322
- OMGF::debug(sprintf(__('Building fonts set for handle %s, using $s', 'host-webfonts-local'), $handle, print_r($links, true)));
323
-
324
  foreach ($links as $key => $link) {
325
  preg_match('/id=[\'"](?P<id>.*?)[\'"]/', $link, $id);
326
 
@@ -336,8 +334,6 @@ class OMGF_Frontend_Process
336
  $google_fonts[$key]['href'] = $href['href'];
337
  }
338
 
339
- OMGF::debug(sprintf(__('Built set: %s', 'host-webfonts-local'), print_r($google_fonts, true)));
340
-
341
  return $google_fonts;
342
  }
343
 
@@ -403,8 +399,6 @@ class OMGF_Frontend_Process
403
  $search = [];
404
  $replace = [];
405
 
406
- OMGF::debug(__('Building Search/Replace set...', 'host-webfonts-local'));
407
-
408
  foreach ($google_fonts as $key => $stack) {
409
  $handle = $stack['id'];
410
 
319
  {
320
  $google_fonts = [];
321
 
 
 
322
  foreach ($links as $key => $link) {
323
  preg_match('/id=[\'"](?P<id>.*?)[\'"]/', $link, $id);
324
 
334
  $google_fonts[$key]['href'] = $href['href'];
335
  }
336
 
 
 
337
  return $google_fonts;
338
  }
339
 
399
  $search = [];
400
  $replace = [];
401
 
 
 
402
  foreach ($google_fonts as $key => $stack) {
403
  $handle = $stack['id'];
404
 
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.9
6
- Stable tag: 5.1.0
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -75,6 +75,12 @@ For the FAQ, [click here](https://docs.ffw.press/category/76-omgf-pro---faq).
75
 
76
  == Changelog ==
77
 
 
 
 
 
 
 
78
  = 5.1.0 =
79
  * Added: Test Mode, which allows you to test optimizations before releasing them to the public.
80
  This option replaces Optimize for Logged-in Administrators/Editors.
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.9
6
+ Stable tag: 5.1.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
75
 
76
  == Changelog ==
77
 
78
+ = 5.1.1 =
79
+ * Fixed: using `print_r()` in an output buffer caused 500 errors.
80
+ - Removed the remaining (one) entries of `OMGF::debug`, because of this and Test Mode now allows for much user-friendly testing, anyway.
81
+ - the `OMGF::debug()` wrapper is still there for hardcore in code debugging.
82
+ * Several code tweaks and fixes.
83
+
84
  = 5.1.0 =
85
  * Added: Test Mode, which allows you to test optimizations before releasing them to the public.
86
  This option replaces Optimize for Logged-in Administrators/Editors.