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

Version Description

  • Comma-separated search now works better (supports ',' as well as ', ')
  • Search results are now added to the old subsets results. Allowing for more flexible search.
Download this release

Release Info

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

Code changes from version 3.1.1 to 3.1.2

css/omgf-admin.css CHANGED
@@ -66,7 +66,6 @@
66
  #omgf-search {
67
  line-height: 38px;
68
  width: 360px;
69
- font-size: 20px;
70
  padding: 3px 10px;
71
  }
72
 
66
  #omgf-search {
67
  line-height: 38px;
68
  width: 360px;
 
69
  padding: 3px 10px;
70
  }
71
 
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: 3.1.1
8
  * Author: Daan van den Bergh
9
  * Author URI: https://daan.dev
10
  * License: GPL2v2 or later
@@ -20,7 +20,7 @@ defined('ABSPATH') || exit;
20
  define('OMGF_PLUGIN_DIR', plugin_dir_path(__FILE__));
21
  define('OMGF_PLUGIN_FILE', __FILE__);
22
  define('OMGF_DB_VERSION', '3.0.0');
23
- define('OMGF_STATIC_VERSION', '3.0.0');
24
  define('OMGF_WEB_FONT_LOADER_VERSION', '1.6.26');
25
 
26
  /**
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: 3.1.2
8
  * Author: Daan van den Bergh
9
  * Author URI: https://daan.dev
10
  * License: GPL2v2 or later
20
  define('OMGF_PLUGIN_DIR', plugin_dir_path(__FILE__));
21
  define('OMGF_PLUGIN_FILE', __FILE__);
22
  define('OMGF_DB_VERSION', '3.0.0');
23
+ define('OMGF_STATIC_VERSION', '3.1.2');
24
  define('OMGF_WEB_FONT_LOADER_VERSION', '1.6.26');
25
 
26
  /**
includes/class-ajax.php CHANGED
@@ -44,13 +44,17 @@ class OMGF_AJAX
44
  */
45
  public function search_font_subsets()
46
  {
 
 
47
  delete_option(OMGF_Admin_Settings::OMGF_SETTING_SUBSETS);
48
- delete_option(OMGF_Admin_Settings::OMGF_SETTING_FONTS);
49
 
50
  if (!($query = $_POST['search_query'])) {
51
  OMGF_Admin_Notice::set_notice(__('Search query not found.', 'host-webfonts-local'), true, 'warning');
52
  }
53
 
 
 
54
  $searchQueries = explode(',', sanitize_text_field($query));
55
 
56
  foreach ($searchQueries as $searchQuery) {
@@ -68,7 +72,9 @@ class OMGF_AJAX
68
  $response[] = $subsets;
69
  }
70
 
71
- update_option(OMGF_Admin_Settings::OMGF_SETTING_SUBSETS, $response);
 
 
72
 
73
  OMGF_Admin_Notice::set_notice(__('Subset search complete. Select subsets to generate a list of available font styles.', 'host-webfonts-local'));
74
  }
44
  */
45
  public function search_font_subsets()
46
  {
47
+ $option_subsets = get_option(OMGF_Admin_Settings::OMGF_SETTING_SUBSETS) ?: [];
48
+
49
  delete_option(OMGF_Admin_Settings::OMGF_SETTING_SUBSETS);
50
+
51
 
52
  if (!($query = $_POST['search_query'])) {
53
  OMGF_Admin_Notice::set_notice(__('Search query not found.', 'host-webfonts-local'), true, 'warning');
54
  }
55
 
56
+ $query = strtolower(str_replace(', ', ',', $query));
57
+ $query = str_replace(' ', '-', $query);
58
  $searchQueries = explode(',', sanitize_text_field($query));
59
 
60
  foreach ($searchQueries as $searchQuery) {
72
  $response[] = $subsets;
73
  }
74
 
75
+ $option_subsets = array_merge($option_subsets, $response);
76
+
77
+ update_option(OMGF_Admin_Settings::OMGF_SETTING_SUBSETS, $option_subsets);
78
 
79
  OMGF_Admin_Notice::set_notice(__('Subset search complete. Select subsets to generate a list of available font styles.', 'host-webfonts-local'));
80
  }
js/omgf-admin.js CHANGED
@@ -59,7 +59,7 @@ jQuery(document).ready(function ($) {
59
  * Triggered when Search is clicked.
60
  */
61
  click_search: function () {
62
- searchQuery = $('#omgf-search').val().replace(/\s/g, '-').toLowerCase();
63
  omgf_admin.search_subsets(searchQuery);
64
  },
65
 
59
  * Triggered when Search is clicked.
60
  */
61
  click_search: function () {
62
+ searchQuery = $('#omgf-search').val();
63
  omgf_admin.search_subsets(searchQuery);
64
  },
65
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: DaanvandenBergh
3
  Tags: google, fonts, preload, font-display, webfonts, subsets, remove, minimize, external, requests, leverage, browser, cache
4
  Requires at least: 4.6
5
  Tested up to: 5.4
6
- Stable tag: 3.1.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -105,6 +105,10 @@ N/A
105
 
106
  == Changelog ==
107
 
 
 
 
 
108
  = 3.1.1 =
109
  * Fixed bug in Web Font Loader.
110
  * Fixed bug where sometimes stylesheet would still be enqueued, even though the file didn't exist.
3
  Tags: google, fonts, preload, font-display, webfonts, subsets, remove, minimize, external, requests, leverage, browser, cache
4
  Requires at least: 4.6
5
  Tested up to: 5.4
6
+ Stable tag: 3.1.2
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
105
 
106
  == Changelog ==
107
 
108
+ = 3.1.2 =
109
+ * Comma-separated search now works better (supports ',' as well as ', ')
110
+ * Search results are now added to the old subsets results. Allowing for more flexible search.
111
+
112
  = 3.1.1 =
113
  * Fixed bug in Web Font Loader.
114
  * Fixed bug where sometimes stylesheet would still be enqueued, even though the file didn't exist.
templates/admin/block-generate-stylesheet.phtml CHANGED
@@ -24,7 +24,7 @@ $utmTags = '?utm_source=omgf&utm_medium=plugin&utm_campaign=settings';
24
 
25
  <div class="omgf-search-section">
26
  <div class="omgf-search-box">
27
- <input type="text" id="omgf-search" class="form-input-tip ui-autocomplete-input" placeholder="<?php _e('Search... (e.g. Roboto,Open Sans)', 'host-webfonts-local'); ?>" />
28
  <input type="button" id="omgf-search-subsets" class="button button-primary button-hero" value="<?php _e('Search', 'host-webfonts-local'); ?>"/>
29
  <input type="button" id="omgf-auto-detect" class="button button-secondary button-hero" value="<?= __('Auto Detect', 'host-webfonts-local'); ?>" />
30
  </div>
24
 
25
  <div class="omgf-search-section">
26
  <div class="omgf-search-box">
27
+ <input type="text" id="omgf-search" class="form-input-tip ui-autocomplete-input" placeholder="<?php _e('Search... [e.g. Roboto, Open Sans, Poppins]', 'host-webfonts-local'); ?>" />
28
  <input type="button" id="omgf-search-subsets" class="button button-primary button-hero" value="<?php _e('Search', 'host-webfonts-local'); ?>"/>
29
  <input type="button" id="omgf-auto-detect" class="button button-secondary button-hero" value="<?= __('Auto Detect', 'host-webfonts-local'); ?>" />
30
  </div>