Version Description
Added experimental enqueue order option.
Download this release
Release Info
Developer | DaanvandenBergh |
Plugin | OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. |
Version | 2.3.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.9 to 2.3.0
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: 2.
|
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: 2.3.0
|
8 |
* Author: Daan van den Bergh
|
9 |
* Author URI: https://daan.dev
|
10 |
* License: GPL2v2 or later
|
includes/admin/class-settings.php
CHANGED
@@ -36,6 +36,7 @@ class OMGF_Admin_Settings extends OMGF_Admin
|
|
36 |
const OMGF_SETTING_ENABLE_PRELOAD = 'omgf_preload';
|
37 |
const OMGF_SETTING_DB_VERSION = 'omgf_db_version';
|
38 |
const OMGF_SETTING_UNINSTALL = 'omgf_uninstall';
|
|
|
39 |
|
40 |
/**
|
41 |
* OMGF_Admin_Settings constructor.
|
36 |
const OMGF_SETTING_ENABLE_PRELOAD = 'omgf_preload';
|
37 |
const OMGF_SETTING_DB_VERSION = 'omgf_db_version';
|
38 |
const OMGF_SETTING_UNINSTALL = 'omgf_uninstall';
|
39 |
+
const OMGF_SETTING_ENQUEUE_ORDER = 'omgf_enqueue_order';
|
40 |
|
41 |
/**
|
42 |
* OMGF_Admin_Settings constructor.
|
includes/class-omgf.php
CHANGED
@@ -64,6 +64,7 @@ class OMGF
|
|
64 |
define('OMGF_DISPLAY_OPTION', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_DISPLAY_OPTION)) ?: 'auto');
|
65 |
define('OMGF_REMOVE_GFONTS', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_REMOVE_GOOGLE_FONTS)));
|
66 |
define('OMGF_PRELOAD', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_ENABLE_PRELOAD)));
|
|
|
67 |
define('OMGF_UNINSTALL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_UNINSTALL)));
|
68 |
}
|
69 |
/**
|
64 |
define('OMGF_DISPLAY_OPTION', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_DISPLAY_OPTION)) ?: 'auto');
|
65 |
define('OMGF_REMOVE_GFONTS', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_REMOVE_GOOGLE_FONTS)));
|
66 |
define('OMGF_PRELOAD', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_ENABLE_PRELOAD)));
|
67 |
+
define('OMGF_ENQUEUE_ORDER', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_ENQUEUE_ORDER, 100)));
|
68 |
define('OMGF_UNINSTALL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_SETTING_UNINSTALL)));
|
69 |
}
|
70 |
/**
|
includes/frontend/class-functions.php
CHANGED
@@ -27,7 +27,7 @@ class OMGF_Frontend_Functions
|
|
27 |
{
|
28 |
// @formatter:off
|
29 |
add_action('wp_print_styles', array($this, 'is_remove_google_fonts_enabled'), PHP_INT_MAX - 1000);
|
30 |
-
add_action('wp_enqueue_scripts', array($this, 'enqueue_stylesheet'),
|
31 |
|
32 |
if (OMGF_AUTO_DETECT_ENABLED) {
|
33 |
add_action('wp_print_styles', array($this, 'auto_detect_fonts'), PHP_INT_MAX - 10000);
|
27 |
{
|
28 |
// @formatter:off
|
29 |
add_action('wp_print_styles', array($this, 'is_remove_google_fonts_enabled'), PHP_INT_MAX - 1000);
|
30 |
+
add_action('wp_enqueue_scripts', array($this, 'enqueue_stylesheet'), OMGF_ENQUEUE_ORDER);
|
31 |
|
32 |
if (OMGF_AUTO_DETECT_ENABLED) {
|
33 |
add_action('wp_print_styles', array($this, 'auto_detect_fonts'), PHP_INT_MAX - 10000);
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://daan.dev/donate/
|
|
4 |
Tags: google, fonts, host, save, local, locally, webfonts, update, minimize, external, requests, leverage, browser, cache
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.3
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -115,6 +115,9 @@ N/A
|
|
115 |
|
116 |
== Changelog ==
|
117 |
|
|
|
|
|
|
|
118 |
= 2.2.9 =
|
119 |
Fixed bug that would throw excessive notices if PHP logging is enabled.
|
120 |
fonts.css was loaded too late, so some minification plugins couldn't capture it.
|
4 |
Tags: google, fonts, host, save, local, locally, webfonts, update, minimize, external, requests, leverage, browser, cache
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 5.3
|
7 |
+
Stable tag: 2.3.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
115 |
|
116 |
== Changelog ==
|
117 |
|
118 |
+
= 2.3.0 =
|
119 |
+
Added experimental enqueue order option.
|
120 |
+
|
121 |
= 2.2.9 =
|
122 |
Fixed bug that would throw excessive notices if PHP logging is enabled.
|
123 |
fonts.css was loaded too late, so some minification plugins couldn't capture it.
|
templates/admin/block-basic-settings.phtml
CHANGED
@@ -122,6 +122,19 @@ $utmTags = '?utm_source=omgf&utm_medium=plugin&utm_campaign=settings';
|
|
122 |
</p>
|
123 |
</td>
|
124 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
<tr valign="top">
|
126 |
<th scope="row">
|
127 |
<label for="<?= OMGF_Admin_Settings::OMGF_SETTING_UNINSTALL ?>">
|
122 |
</p>
|
123 |
</td>
|
124 |
</tr>
|
125 |
+
<tr valign="top">
|
126 |
+
<th scope="row">
|
127 |
+
<label for="<?= OMGF_Admin_Settings::OMGF_SETTING_ENQUEUE_ORDER; ?>">
|
128 |
+
<?php _e('Change enqueue order of stylesheet? (experimental)', 'host-webfonts-local'); ?>
|
129 |
+
</label>
|
130 |
+
</th>
|
131 |
+
<td>
|
132 |
+
<input type="number" name="<?= OMGF_Admin_Settings::OMGF_SETTING_ENQUEUE_ORDER; ?>" id="<?= OMGF_Admin_Settings::OMGF_SETTING_ENQUEUE_ORDER ?>" min="0" value="<?= OMGF_ENQUEUE_ORDER; ?>" />
|
133 |
+
<p class="description">
|
134 |
+
<?php _e('Lower this value if the generated stylesheet (<code>fonts.css</code>) is not captured by your CSS minification/combining plugin.', 'host-webfonts-local'); ?>
|
135 |
+
</p>
|
136 |
+
</td>
|
137 |
+
</tr>
|
138 |
<tr valign="top">
|
139 |
<th scope="row">
|
140 |
<label for="<?= OMGF_Admin_Settings::OMGF_SETTING_UNINSTALL ?>">
|
templates/admin/block-welcome.phtml
CHANGED
@@ -55,7 +55,7 @@ $utmTags = '?utm_source=omgf&utm_medium=plugin&utm_campaign=support_tab';
|
|
55 |
<?= sprintf(__('I am convinced that knowledge should be free. That\'s why I will never charge you for the plugins I create and I will help you to succeed in your projects through the %stutorials%s on my blog.', 'host-webfonts-local'), '<a href="' . OMGF_SITE_URL . '/how-to/' . $utmTags . '" target="_blank">', '</a>'); ?>
|
56 |
</p>
|
57 |
<p>
|
58 |
-
<?= sprintf(__('However, my time is just as valuable as yours. Consider supporting me by either %sdonating%s or leaving a %s5-star review%s on Wordpress.org.', 'host-webfonts-local'), '<a href="' . OMGF_SITE_URL . '/donate" target="_blank">', '</a>', '<a target="_blank" href="https://wordpress.org/support/plugin/host-
|
59 |
</p>
|
60 |
<p>
|
61 |
<a target="_blank" class="button button-primary button-hero" href="<?= OMGF_SITE_URL; ?>/donate/?utm_source=omgf&utm_medium=plugin&utm_campaign=donate_button"><span class="dashicons-before dashicons-heart"> <?php _e('Donate', 'host-webfonts-local'); ?></span></a>
|
55 |
<?= sprintf(__('I am convinced that knowledge should be free. That\'s why I will never charge you for the plugins I create and I will help you to succeed in your projects through the %stutorials%s on my blog.', 'host-webfonts-local'), '<a href="' . OMGF_SITE_URL . '/how-to/' . $utmTags . '" target="_blank">', '</a>'); ?>
|
56 |
</p>
|
57 |
<p>
|
58 |
+
<?= sprintf(__('However, my time is just as valuable as yours. Consider supporting me by either %sdonating%s or leaving a %s5-star review%s on Wordpress.org.', 'host-webfonts-local'), '<a href="' . OMGF_SITE_URL . '/donate" target="_blank">', '</a>', '<a target="_blank" href="https://wordpress.org/support/plugin/host-webfonts-local/reviews/?rate=5#new-post">', '</a>'); ?>
|
59 |
</p>
|
60 |
<p>
|
61 |
<a target="_blank" class="button button-primary button-hero" href="<?= OMGF_SITE_URL; ?>/donate/?utm_source=omgf&utm_medium=plugin&utm_campaign=donate_button"><span class="dashicons-before dashicons-heart"> <?php _e('Donate', 'host-webfonts-local'); ?></span></a>
|