Version Description
| September 21st, 2022 = * Fixed: Since Latin Extended is an addon for Latin, it shouldn't be allowed to select it by itself in the Used Subset(s) option. * Added: Compatibility fix for Logo Carousel (Pro), which (like Category Slider Pro for WooCommerce) adds a random unique identifier to Google Fonts stylesheets on each pageload. Why? Does it hate cache? :'-(
Download this release
Release Info
Developer | DaanvandenBergh |
Plugin | OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. |
Version | 5.3.8 |
Comparing to | |
See all releases |
Code changes from version 5.3.7 to 5.3.8
- assets/js/omgf-admin.js +21 -0
- host-webfonts-local.php +3 -3
- includes/admin/settings/class-optimize.php +1 -1
- includes/frontend/class-process.php +10 -3
- readme.txt +5 -1
assets/js/omgf-admin.js
CHANGED
@@ -30,6 +30,7 @@ jQuery(document).ready(function ($) {
|
|
30 |
*/
|
31 |
init: function () {
|
32 |
// Settings
|
|
|
33 |
$('.omgf-optimize-fonts-manage .unload').on('change', this.unload_stylesheets);
|
34 |
$('.omgf-optimize-fonts-manage .unload, .omgf-optimize-fonts-manage .fallback-font-stack select').on('change', this.generate_cache_key);
|
35 |
$('.omgf-optimize-fonts-manage .unload').on('change', this.toggle_preload);
|
@@ -50,6 +51,26 @@ jQuery(document).ready(function ($) {
|
|
50 |
setInterval(this.loop_ticker_items, 4000);
|
51 |
},
|
52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
/**
|
54 |
*
|
55 |
*/
|
30 |
*/
|
31 |
init: function () {
|
32 |
// Settings
|
33 |
+
$('.omgf-subsets').on('change', this.maybe_select_latin);
|
34 |
$('.omgf-optimize-fonts-manage .unload').on('change', this.unload_stylesheets);
|
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);
|
51 |
setInterval(this.loop_ticker_items, 4000);
|
52 |
},
|
53 |
|
54 |
+
/**
|
55 |
+
* Also select Latin, if Latin Extended is selected.
|
56 |
+
*
|
57 |
+
* @param {'change'} event
|
58 |
+
*/
|
59 |
+
maybe_select_latin: function (event) {
|
60 |
+
var value = this.value,
|
61 |
+
target = event.target,
|
62 |
+
className = target.className,
|
63 |
+
options = ['latin', 'latin-ext'];
|
64 |
+
|
65 |
+
if (value === 'latin-ext') {
|
66 |
+
options.forEach(function (value) {
|
67 |
+
var option = document.querySelector('.' + className + ' option[value=' + value + ']');
|
68 |
+
|
69 |
+
option.selected = true;
|
70 |
+
});
|
71 |
+
}
|
72 |
+
},
|
73 |
+
|
74 |
/**
|
75 |
*
|
76 |
*/
|
host-webfonts-local.php
CHANGED
@@ -3,8 +3,8 @@
|
|
3 |
/**
|
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.
|
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.3.
|
23 |
define('OMGF_DB_VERSION', '5.3.4');
|
24 |
|
25 |
/**
|
3 |
/**
|
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.3.8
|
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.3.8');
|
23 |
define('OMGF_DB_VERSION', '5.3.4');
|
24 |
|
25 |
/**
|
includes/admin/settings/class-optimize.php
CHANGED
@@ -218,7 +218,7 @@ class OMGF_Admin_Settings_Optimize extends OMGF_Admin_Settings_Builder
|
|
218 |
OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_SUBSETS,
|
219 |
OMGF_Admin_Settings::OMGF_SUBSETS,
|
220 |
OMGF_SUBSETS,
|
221 |
-
__('
|
222 |
true
|
223 |
);
|
224 |
}
|
218 |
OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_SUBSETS,
|
219 |
OMGF_Admin_Settings::OMGF_SUBSETS,
|
220 |
OMGF_SUBSETS,
|
221 |
+
__('A subset is a (limited) set of characters belonging to an alphabet. Default: <code>latin</code>, <code>latin-ext</code>. Limit the selection to subsets your site actually uses. Selecting <u>too many</u> subsets can negatively impact performance! <em>Latin Extended is an add-on for Latin and can\'t be used by itself. Use CTRL + click to select multiple values.</em>', $this->plugin_text_domain),
|
222 |
true
|
223 |
);
|
224 |
}
|
includes/frontend/class-process.php
CHANGED
@@ -429,13 +429,20 @@ class OMGF_Frontend_Process
|
|
429 |
$google_fonts[$key]['id'] = str_replace('-1', '-' . strlen($href['href']), $id);
|
430 |
} elseif (strpos($id, 'sp-wpcp-google-fonts') !== false) {
|
431 |
/**
|
432 |
-
* Compatibility fix for Category Slider Pro for WooCommerce
|
433 |
*
|
434 |
* @since v5.3.7 This plugin finds it necessary to provide each Google Fonts stylesheet with a
|
435 |
-
* unique identifier, to make sure its never cached. The worst idea
|
436 |
-
* of that, it throws OMGF off the rails entirely, eventually crashing the site.
|
437 |
*/
|
438 |
$google_fonts[$key]['id'] = 'sp-wpcp-google-fonts';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
439 |
} else {
|
440 |
$google_fonts[$key]['id'] = $id;
|
441 |
}
|
429 |
$google_fonts[$key]['id'] = str_replace('-1', '-' . strlen($href['href']), $id);
|
430 |
} elseif (strpos($id, 'sp-wpcp-google-fonts') !== false) {
|
431 |
/**
|
432 |
+
* Compatibility fix for Category Slider Pro for WooCommerce by ShapedPlugin
|
433 |
*
|
434 |
* @since v5.3.7 This plugin finds it necessary to provide each Google Fonts stylesheet with a
|
435 |
+
* unique identifier on each pageload, to make sure its never cached. The worst idea ever.
|
436 |
+
* On top of that, it throws OMGF off the rails entirely, eventually crashing the site.
|
437 |
*/
|
438 |
$google_fonts[$key]['id'] = 'sp-wpcp-google-fonts';
|
439 |
+
} elseif (strpos($id, 'sp-lc-google-fonts') !== false) {
|
440 |
+
/**
|
441 |
+
* Compatibility fix for Logo Carousel Pro by ShapedPlugin
|
442 |
+
*
|
443 |
+
* @since v5.3.8 Same reason as above.
|
444 |
+
*/
|
445 |
+
$google_fonts[$key]['id'] = 'sp-lc-google-fonts';
|
446 |
} else {
|
447 |
$google_fonts[$key]['id'] = $id;
|
448 |
}
|
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.3.
|
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,10 @@ For the FAQ, [click here](https://daan.dev/docs/omgf-pro-faq/).
|
|
76 |
|
77 |
== Changelog ==
|
78 |
|
|
|
|
|
|
|
|
|
79 |
= 5.3.7 | September 14th, 2022 =
|
80 |
* Added: output_array() debug function to allow printing arrays in the debug log.
|
81 |
* Fixes: Cannot use output buffering in output buffering display handlers
|
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.3.8
|
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.8 | September 21st, 2022 =
|
80 |
+
* Fixed: Since Latin Extended is an addon for Latin, it shouldn't be allowed to select it by itself in the Used Subset(s) option.
|
81 |
+
* Added: Compatibility fix for Logo Carousel (Pro), which (like Category Slider Pro for WooCommerce) adds a random unique identifier to Google Fonts stylesheets on each pageload. Why? Does it hate cache? :'-(
|
82 |
+
|
83 |
= 5.3.7 | September 14th, 2022 =
|
84 |
* Added: output_array() debug function to allow printing arrays in the debug log.
|
85 |
* Fixes: Cannot use output buffering in output buffering display handlers
|