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

Version Description

| December 5th, 2022 = * Added: 'omgf_optimize_run_args' filter to allow adding attional GET-parameters before running optimization. * Improved: always use protocol relative ('//' instead of 'https://') URLs when generating and loading stylesheets to avoid SSL- and permalinks related quirks in WordPress. * Added: Auto-Configure Subsets feature and moved the Used Subset(s) option to the Advanced Settings tab. * Added: compatibility for WP.com's "GDPR compliant" Google Fonts API. * Fixed: Array to string conversion in PHPH 8.1 while escaping arrays.

Download this release

Release Info

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

Code changes from version 5.4.3 to 5.5.0

assets/css/omgf-admin.css CHANGED
@@ -127,12 +127,16 @@
127
  content: "\f460";
128
  color: #0074D9;
129
  }
130
- .omgf form .advanced-processing-notice {
 
 
131
  padding: 18px 12px;
 
132
  border: 1px solid #ececec;
133
  border-left: 4px solid #ececec;
134
  }
135
- .omgf form .advanced-processing-notice.success {
 
136
  border: 1px solid #7FDBFF;
137
  border-left: 4px solid #7FDBFF;
138
  background-color: #E0EDF3;
127
  content: "\f460";
128
  color: #0074D9;
129
  }
130
+ .omgf form .advanced-processing-notice,
131
+ .omgf form .used-subsets-notice {
132
+ display: block;
133
  padding: 18px 12px;
134
+ margin-bottom: 0.5em;
135
  border: 1px solid #ececec;
136
  border-left: 4px solid #ececec;
137
  }
138
+ .omgf form .advanced-processing-notice.info,
139
+ .omgf form .used-subsets-notice.info {
140
  border: 1px solid #7FDBFF;
141
  border-left: 4px solid #7FDBFF;
142
  background-color: #E0EDF3;
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;;AAEA,KATF,eASG;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J,QAAC,MAAO;EACN,mBAAA;;AAIJ;EACE,UAAA;EACA,gBAAA;;AAGF,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;;;;;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
@@ -156,12 +156,15 @@
156
  }
157
  }
158
 
159
- .advanced-processing-notice {
 
 
160
  padding: 18px 12px;
 
161
  border: 1px solid #ececec;
162
  border-left: 4px solid #ececec;
163
 
164
- &.success {
165
  border: 1px solid #7FDBFF;
166
  border-left: 4px solid #7FDBFF;
167
  background-color: #E0EDF3;
156
  }
157
  }
158
 
159
+ .advanced-processing-notice,
160
+ .used-subsets-notice {
161
+ display: block;
162
  padding: 18px 12px;
163
+ margin-bottom: .5em;
164
  border: 1px solid #ececec;
165
  border-left: 4px solid #ececec;
166
 
167
+ &.info {
168
  border: 1px solid #7FDBFF;
169
  border-left: 4px solid #7FDBFF;
170
  background-color: #E0EDF3;
assets/css/omgf-admin.min.css CHANGED
@@ -1 +1 @@
1
- .omgf .button-cancel{color:#a00;text-decoration:none;border-color:transparent;box-shadow:none;background:0 0;border-radius:3px;white-space:nowrap}.omgf .button-cancel.omgf-refresh{color:#ff851b}.omgf .button-cancel.omgf-empty,.omgf .button-cancel.omgf-refresh{padding:1px 10px!important}.omgf .button-cancel:hover{cursor:pointer;background:#d54e21;color:#fff;border-color:#d54e21}.omgf .button-cancel:hover#omgf-refresh{color:#fff;background:#ff851b;border-color:#ff851b}.omgf-nav{padding:1em 0 1.5em}.omgf-nav a{cursor:pointer}.omgf-nav .dashicons-before:before{margin-right:.25em;line-height:1.15em}.omgf form{max-width:1350px}.omgf form .dashicons{line-height:15px}.omgf form .omgf-task-manager .task-manager-row{padding-left:0;line-height:1.33}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice{padding:18px 12px;border:1px solid #ececec;border-left:4px solid #ececec}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice ol{margin-left:1em}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice.warning{border:1px solid #ffdc00;border-left:4px solid #ffdc00;background-color:#fffbdf}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice.success{border:1px solid #2ecc40;border-left:4px solid #2ecc40;background-color:#2ecc40}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice.info{border:1px solid #7fdbff;border-left:4px solid #7fdbff;background-color:#e0edf3}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice h4{margin-top:0}.omgf form .omgf-task-manager ul{margin-top:5px;list-style:none;margin-left:.5em;padding-left:0}.omgf form .omgf-task-manager ul li{padding-left:1.5em;text-indent:-2em;line-height:1.5em}.omgf form .omgf-task-manager ul li:before{font-family:dashicons;font-size:16px;vertical-align:-3px}.omgf form .omgf-task-manager ul li.stale:before{content:"\f534";color:#ff851b}.omgf form .omgf-task-manager ul li.found:before{content:"\f15e";color:#2ecc40}.omgf form .omgf-task-manager ul li.not-found:before{content:"\f158";color:#ff4136}.omgf form .omgf-task-manager ul li.stale-cache-notice:before{content:"\f348";color:#0074d9}.omgf form .omgf-task-manager ul li.unloaded:before{content:"\f460";color:#0074d9}.omgf form .advanced-processing-notice{padding:18px 12px;border:1px solid #ececec;border-left:4px solid #ececec}.omgf form .advanced-processing-notice.success{border:1px solid #7fdbff;border-left:4px solid #7fdbff;background-color:#e0edf3}.omgf-optimize-fonts-container{text-align:center;padding:25px 50px;max-width:1024px;margin:20px auto 0 220px;overflow:visible;position:relative}.omgf-optimize-fonts-container .option-title{position:absolute;left:-220px;top:0;font-weight:600;font-size:14px;color:#1d2327}.omgf-optimize-fonts-container h3{font-size:1.3em;margin-top:0}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage{text-align:left}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage #omgf-optimize-preload-warning{position:fixed;top:50%;left:33%;width:33%;padding:20px 40px;background-color:#fff5b5;border:2px solid #ffdc00;border-radius:4px;box-shadow:1px 1px 333px #333;z-index:1000}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage #omgf-optimize-preload-warning .omgf-optimize-preload-warning-close{float:right;font-size:2em;line-height:.45;cursor:pointer}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table{width:100%;border-collapse:collapse}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table thead th{width:13%}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody{border:1px solid #ccd0d4}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody th{padding:5px 0 0 10px;width:40%}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td{padding-bottom:5px;width:13%}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td .unload-mass-action{font-size:.9em}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td .unload-mass-action:hover{cursor:pointer}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td .family{padding:0 10px 0;font-weight:600}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody tr:last-child td{padding-bottom:10px}.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-pros{margin-right:10px}.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-cons,.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-pros{text-align:left;width:48%;display:inline-block;vertical-align:top}.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-cons span:before,.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-pros span:before{vertical-align:-4px}.omgf-optimize-fonts-container .omgf-optimize-fonts-description label{font-size:18px;font-weight:700}.omgf-optimize-fonts-container .omgf-optimize-fonts-tooltip{padding:0 15px 5px}.omgf-optimize-fonts-container p,.omgf-optimize-fonts-container ul{text-align:justify}.tooltip{position:relative;font-size:16px;line-height:16px;height:12px}.tooltip .tooltip-text{visibility:hidden;position:absolute;top:100%;left:100%;z-index:10000;background-color:rgba(0,0,0,.75);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:.8em;color:#fff;line-height:1.5;width:250px;padding:10px;margin-left:-125px;border-radius:3px}.tooltip .tooltip-text a{color:#fff}.tooltip .tooltip-text .illustration{margin-top:10px}.tooltip:hover .tooltip-text{visibility:visible}.omgf-warning{color:red;font-weight:600}#omgf-help-form .postbox{padding:0 15px 5px}#omgf-help-form .postbox .column-container{display:flex;flex-flow:row wrap;justify-content:space-between}#omgf-help-form .postbox .column-container .column ul li{margin-bottom:10px}#omgf-help-form .postbox .column-container .column ul li:last-child{margin-bottom:none}#omgf-help-form .postbox .column-container .column ul li a{text-decoration:none;line-height:1.45}#omgf-help-form .postbox .column-container .column ul li a i.dashicons{margin-right:5px;color:#646970}#omgf-help-form .postbox .column-container .column.last{margin-right:45px}#omgf-help-form .postbox .column-container .column.last .signature{text-align:center}#omgf-help-form .postbox .column-container .column.last .signature .dashicons-heart{color:#ff4136}@media only screen and (max-width:782px){.omgf-optimize-fonts-container{margin:20px 0}.omgf-optimize-fonts-container .option-title{position:relative;left:initial;top:initial}}.omgf-loading{position:fixed;background-color:rgba(255,255,255,.6);width:100%;height:100%;top:0;text-align:center}.omgf-loading .spinner{top:50%;left:50%;position:absolute;-ms-transform:translateX(-50%);transform:translateX(-50%)}#footer-thankyou a{vertical-align:-.65em}#footer-thankyou .dashicons.ffwp-heart{vertical-align:middle}#footer-thankyou .dashicons.ffwp-heart:before{color:#ff4136}#footer-thankyou .signature-image{width:96px}
1
+ .omgf .button-cancel{color:#a00;text-decoration:none;border-color:transparent;box-shadow:none;background:0 0;border-radius:3px;white-space:nowrap}.omgf .button-cancel.omgf-refresh{color:#ff851b}.omgf .button-cancel.omgf-empty,.omgf .button-cancel.omgf-refresh{padding:1px 10px!important}.omgf .button-cancel:hover{cursor:pointer;background:#d54e21;color:#fff;border-color:#d54e21}.omgf .button-cancel:hover#omgf-refresh{color:#fff;background:#ff851b;border-color:#ff851b}.omgf-nav{padding:1em 0 1.5em}.omgf-nav a{cursor:pointer}.omgf-nav .dashicons-before:before{margin-right:.25em;line-height:1.15em}.omgf form{max-width:1350px}.omgf form .dashicons{line-height:15px}.omgf form .omgf-task-manager .task-manager-row{padding-left:0;line-height:1.33}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice{padding:18px 12px;border:1px solid #ececec;border-left:4px solid #ececec}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice ol{margin-left:1em}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice.warning{border:1px solid #ffdc00;border-left:4px solid #ffdc00;background-color:#fffbdf}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice.success{border:1px solid #2ecc40;border-left:4px solid #2ecc40;background-color:#ddf7e0}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice.info{border:1px solid #7fdbff;border-left:4px solid #7fdbff;background-color:#e0edf3}.omgf form .omgf-task-manager .task-manager-row .task-manager-notice h4{margin-top:0}.omgf form .omgf-task-manager ul{margin-top:5px;list-style:none;margin-left:.5em;padding-left:0}.omgf form .omgf-task-manager ul li{padding-left:1.5em;text-indent:-2em;line-height:1.5em}.omgf form .omgf-task-manager ul li:before{font-family:dashicons;font-size:16px;vertical-align:-3px}.omgf form .omgf-task-manager ul li.stale:before{content:"\f534";color:#ff851b}.omgf form .omgf-task-manager ul li.found:before{content:"\f15e";color:#2ecc40}.omgf form .omgf-task-manager ul li.not-found:before{content:"\f158";color:#ff4136}.omgf form .omgf-task-manager ul li.stale-cache-notice:before{content:"\f348";color:#0074d9}.omgf form .omgf-task-manager ul li.unloaded:before{content:"\f460";color:#0074d9}.omgf form .advanced-processing-notice,.omgf form .used-subsets-notice{display:block;padding:18px 12px;margin-bottom:.5em;border:1px solid #ececec;border-left:4px solid #ececec}.omgf form .advanced-processing-notice.info,.omgf form .used-subsets-notice.info{border:1px solid #7fdbff;border-left:4px solid #7fdbff;background-color:#e0edf3}.omgf-optimize-fonts-container{text-align:center;padding:25px 50px;max-width:1024px;margin:20px auto 0 220px;overflow:visible;position:relative}.omgf-optimize-fonts-container .option-title{position:absolute;left:-220px;top:0;font-weight:600;font-size:14px;color:#1d2327}.omgf-optimize-fonts-container h3{font-size:1.3em;margin-top:0}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage{text-align:left}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage #omgf-optimize-preload-warning{position:fixed;top:50%;left:33%;width:33%;padding:20px 40px;background-color:#fff5b5;border:2px solid #ffdc00;border-radius:4px;box-shadow:1px 1px 333px #333;z-index:1000}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage #omgf-optimize-preload-warning .omgf-optimize-preload-warning-close{float:right;font-size:2em;line-height:.45;cursor:pointer}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table{width:100%;border-collapse:collapse}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table thead th{width:13%}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody{border:1px solid #ccd0d4}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody th{padding:5px 0 0 10px;width:40%}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td{padding-bottom:5px;width:13%}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td .unload-mass-action{font-size:.9em}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td .unload-mass-action:hover{cursor:pointer}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody td .family{padding:0 10px 0;font-weight:600}.omgf-optimize-fonts-container .omgf-optimize-fonts-manage table tbody tr:last-child td{padding-bottom:10px}.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-pros{margin-right:10px}.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-cons,.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-pros{text-align:left;width:48%;display:inline-block;vertical-align:top}.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-cons span:before,.omgf-optimize-fonts-container .omgf-optimize-fonts-description .omgf-optimize-fonts-pros span:before{vertical-align:-4px}.omgf-optimize-fonts-container .omgf-optimize-fonts-description label{font-size:18px;font-weight:700}.omgf-optimize-fonts-container .omgf-optimize-fonts-tooltip{padding:0 15px 5px}.omgf-optimize-fonts-container p,.omgf-optimize-fonts-container ul{text-align:justify}.tooltip{position:relative;font-size:16px;line-height:16px;height:12px}.tooltip .tooltip-text{visibility:hidden;position:absolute;top:100%;left:100%;z-index:10000;background-color:rgba(0,0,0,.75);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:.8em;color:#fff;line-height:1.5;width:250px;padding:10px;margin-left:-125px;border-radius:3px}.tooltip .tooltip-text a{color:#fff}.tooltip .tooltip-text .illustration{margin-top:10px}.tooltip:hover .tooltip-text{visibility:visible}.omgf-warning{color:red;font-weight:600}#omgf-help-form .postbox{padding:0 15px 5px}#omgf-help-form .postbox .column-container{display:flex;flex-flow:row wrap;justify-content:space-between}#omgf-help-form .postbox .column-container .column ul li{margin-bottom:10px}#omgf-help-form .postbox .column-container .column ul li:last-child{margin-bottom:none}#omgf-help-form .postbox .column-container .column ul li a{text-decoration:none;line-height:1.45}#omgf-help-form .postbox .column-container .column ul li a i.dashicons{margin-right:5px;color:#646970}#omgf-help-form .postbox .column-container .column.last{margin-right:45px}#omgf-help-form .postbox .column-container .column.last .signature{text-align:center}#omgf-help-form .postbox .column-container .column.last .signature .dashicons-heart{color:#ff4136}@media only screen and (max-width:782px){.omgf-optimize-fonts-container{margin:20px 0}.omgf-optimize-fonts-container .option-title{position:relative;left:initial;top:initial}}.omgf-loading{position:fixed;background-color:rgba(255,255,255,.6);width:100%;height:100%;top:0;text-align:center}.omgf-loading .spinner{top:50%;left:50%;position:absolute;-ms-transform:translateX(-50%);transform:translateX(-50%)}#footer-thankyou a{vertical-align:-.65em}#footer-thankyou .dashicons.ffwp-heart{vertical-align:middle}#footer-thankyou .dashicons.ffwp-heart:before{color:#ff4136}#footer-thankyou .signature-image{width:96px}
assets/js/omgf-admin.js CHANGED
@@ -41,7 +41,7 @@ jQuery(document).ready(function ($) {
41
  $('.omgf-optimize-fonts-manage .load-all').on('click', this.load_all);
42
 
43
  // Buttons (AJAX, etc.)
44
- $('#omgf-save-optimize').on('click', function () { $('#omgf-optimize-settings-form #submit').click(); });
45
  $(document).on('click', 'a[id^=omgf-hide-notice-]', this.hide_notice);
46
  $('#omgf-remove-stylesheet').on('click', this.remove_stylesheet_from_db);
47
  $('.omgf-refresh, #omgf-cache-refresh').on('click', this.refresh_cache);
41
  $('.omgf-optimize-fonts-manage .load-all').on('click', this.load_all);
42
 
43
  // Buttons (AJAX, etc.)
44
+ $('#omgf-save-optimize, #omgf-optimize-again').on('click', function () { $('#omgf-optimize-settings-form #submit').click(); });
45
  $(document).on('click', 'a[id^=omgf-hide-notice-]', this.hide_notice);
46
  $('#omgf-remove-stylesheet').on('click', this.remove_stylesheet_from_db);
47
  $('.omgf-refresh, #omgf-cache-refresh').on('click', this.refresh_cache);
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/DSVGO compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
7
- * Version: 5.4.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.4.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/DSGVO compliance, reduce DNS requests and leverage browser cache by automatically downloading Google Fonts to your server.
7
+ * Version: 5.5.0
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.5.0');
23
  define('OMGF_DB_VERSION', '5.3.4');
24
 
25
  /**
includes/admin/class-settings.php CHANGED
@@ -23,13 +23,14 @@ class OMGF_Admin_Settings extends OMGF_Admin
23
  /**
24
  * Transients
25
  */
26
- const OMGF_NEWS_REEL = 'omgf_news_reel';
27
- const OMGF_OPTIMIZE_HAS_RUN = 'omgf_optimize_has_run';
28
- const OMGF_CACHE_IS_STALE = 'omgf_cache_is_stale';
29
- const OMGF_CURRENT_DB_VERSION = 'omgf_current_db_version';
30
- const OMGF_CACHE_TIMESTAMP = 'omgf_cache_timestamp';
31
- const OMGF_FOUND_IFRAMES = 'omgf_found_iframes';
32
- const OMGF_HIDDEN_NOTICES = 'omgf_hidden_notices';
 
33
 
34
  /**
35
  * Settings Fields
@@ -116,8 +117,8 @@ class OMGF_Admin_Settings extends OMGF_Admin
116
  /**
117
  * Optimize Fonts
118
  */
 
119
  const OMGF_OPTIMIZE_SETTING_DISPLAY_OPTION = 'omgf_display_option';
120
- const OMGF_OPTIMIZE_SETTING_SUBSETS = 'omgf_subsets';
121
  const OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS = 'omgf_optimized_fonts';
122
  const OMGF_OPTIMIZE_SETTING_PRELOAD_FONTS = 'omgf_preload_fonts';
123
  const OMGF_OPTIMIZE_SETTING_UNLOAD_FONTS = 'omgf_unload_fonts';
@@ -129,6 +130,7 @@ class OMGF_Admin_Settings extends OMGF_Admin
129
  * Advanced Settings
130
  */
131
  const OMGF_ADV_SETTING_COMPATIBILITY = 'omgf_compatibility';
 
132
  const OMGF_ADV_SETTING_DEBUG_MODE = 'omgf_debug';
133
  const OMGF_ADV_SETTING_UNINSTALL = 'omgf_uninstall';
134
 
@@ -400,7 +402,7 @@ class OMGF_Admin_Settings extends OMGF_Admin
400
 
401
  ?>
402
  <?php if ($this->active_tab !== self::OMGF_SETTINGS_FIELD_HELP) : ?>
403
- <?php submit_button($this->submit_button_text, 'primary', 'submit', false, empty($this->get_settings()) || (empty($this->get_settings()) && defined('OMGF_PRO_AUTO_CONFIG') && OMGF_PRO_AUTO_CONFIG) ? 'disabled' : null); ?>
404
  <?php endif; ?>
405
  </form>
406
  <?php
23
  /**
24
  * Transients
25
  */
26
+ const OMGF_AVAILABLE_USED_SUBSETS = 'omgf_available_used_subsets';
27
+ const OMGF_NEWS_REEL = 'omgf_news_reel';
28
+ const OMGF_OPTIMIZE_HAS_RUN = 'omgf_optimize_has_run';
29
+ const OMGF_CACHE_IS_STALE = 'omgf_cache_is_stale';
30
+ const OMGF_CURRENT_DB_VERSION = 'omgf_current_db_version';
31
+ const OMGF_CACHE_TIMESTAMP = 'omgf_cache_timestamp';
32
+ const OMGF_FOUND_IFRAMES = 'omgf_found_iframes';
33
+ const OMGF_HIDDEN_NOTICES = 'omgf_hidden_notices';
34
 
35
  /**
36
  * Settings Fields
117
  /**
118
  * Optimize Fonts
119
  */
120
+ const OMGF_OPTIMIZE_SETTING_AUTO_SUBSETS = 'omgf_auto_subsets';
121
  const OMGF_OPTIMIZE_SETTING_DISPLAY_OPTION = 'omgf_display_option';
 
122
  const OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS = 'omgf_optimized_fonts';
123
  const OMGF_OPTIMIZE_SETTING_PRELOAD_FONTS = 'omgf_preload_fonts';
124
  const OMGF_OPTIMIZE_SETTING_UNLOAD_FONTS = 'omgf_unload_fonts';
130
  * Advanced Settings
131
  */
132
  const OMGF_ADV_SETTING_COMPATIBILITY = 'omgf_compatibility';
133
+ const OMGF_ADV_SETTING_SUBSETS = 'omgf_subsets';
134
  const OMGF_ADV_SETTING_DEBUG_MODE = 'omgf_debug';
135
  const OMGF_ADV_SETTING_UNINSTALL = 'omgf_uninstall';
136
 
402
 
403
  ?>
404
  <?php if ($this->active_tab !== self::OMGF_SETTINGS_FIELD_HELP) : ?>
405
+ <?php submit_button($this->submit_button_text, 'primary', 'submit', false, empty($this->get_settings()) ? 'disabled' : null); ?>
406
  <?php endif; ?>
407
  </form>
408
  <?php
includes/admin/settings/class-advanced.php CHANGED
@@ -36,9 +36,10 @@ class OMGF_Admin_Settings_Advanced extends OMGF_Admin_Settings_Builder
36
  add_filter('omgf_advanced_settings_content', [$this, 'do_cache_dir'], 50);
37
  add_filter('omgf_advanced_settings_content', [$this, 'do_promo_fonts_source_url'], 60);
38
  add_filter('omgf_advanced_settings_content', [$this, 'do_compatibility'], 70);
39
- add_filter('omgf_advanced_settings_content', [$this, 'do_debug_mode'], 80);
40
- add_filter('omgf_advanced_settings_content', [$this, 'do_download_log'], 90);
41
- add_filter('omgf_advanced_settings_content', [$this, 'do_uninstall'], 100);
 
42
 
43
  // Close
44
  add_filter('omgf_advanced_settings_content', [$this, 'do_after'], 200);
@@ -104,6 +105,23 @@ class OMGF_Admin_Settings_Advanced extends OMGF_Admin_Settings_Builder
104
  );
105
  }
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  public function do_debug_mode()
108
  {
109
  $this->do_checkbox(
36
  add_filter('omgf_advanced_settings_content', [$this, 'do_cache_dir'], 50);
37
  add_filter('omgf_advanced_settings_content', [$this, 'do_promo_fonts_source_url'], 60);
38
  add_filter('omgf_advanced_settings_content', [$this, 'do_compatibility'], 70);
39
+ add_filter('omgf_advanced_settings_content', [$this, 'do_used_subsets'], 80);
40
+ add_filter('omgf_advanced_settings_content', [$this, 'do_debug_mode'], 90);
41
+ add_filter('omgf_advanced_settings_content', [$this, 'do_download_log'], 100);
42
+ add_filter('omgf_advanced_settings_content', [$this, 'do_uninstall'], 110);
43
 
44
  // Close
45
  add_filter('omgf_advanced_settings_content', [$this, 'do_after'], 200);
105
  );
106
  }
107
 
108
+ /**
109
+ * Preload Subsets
110
+ *
111
+ * @return void
112
+ */
113
+ public function do_used_subsets()
114
+ {
115
+ $this->do_select(
116
+ __('Used Subset(s)', $this->plugin_text_domain),
117
+ OMGF_Admin_Settings::OMGF_ADV_SETTING_SUBSETS,
118
+ OMGF_Admin_Settings::OMGF_SUBSETS,
119
+ OMGF_SUBSETS,
120
+ (OMGF_AUTO_SUBSETS == 'on' ? '<span class="used-subsets-notice info">' . sprintf(__('Any changes made to this setting will be overwritten, because <strong>Auto-configure Used Subsets</strong> is enabled. <a href="%s">Disable it</a> if you wish to manage <strong>Used Subset(s)</strong> yourself. <u>Novice users shouldn\'t change this setting</u>!', $this->plugin_text_domain), admin_url(OMGF_Admin_Settings::OMGF_OPTIONS_GENERAL_PAGE_OPTIMIZE_WEBFONTS)) . '</span>' : '') . __('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),
121
+ true
122
+ );
123
+ }
124
+
125
  public function do_debug_mode()
126
  {
127
  $this->do_checkbox(
includes/admin/settings/class-detection.php CHANGED
@@ -31,7 +31,7 @@ class OMGF_Admin_Settings_Detection extends OMGF_Admin_Settings_Builder
31
 
32
  // Settings
33
  add_filter('omgf_detection_settings_content', [$this, 'google_fonts_processing'], 30);
34
- add_filter('omgf_detection_settings_content', [$this, 'promo_advanced_processing'], 60);
35
 
36
  // Close
37
  add_filter('omgf_detection_settings_content', [$this, 'do_after'], 100);
31
 
32
  // Settings
33
  add_filter('omgf_detection_settings_content', [$this, 'google_fonts_processing'], 30);
34
+ add_filter('omgf_detection_settings_content', [$this, 'promo_advanced_processing'], 50);
35
 
36
  // Close
37
  add_filter('omgf_detection_settings_content', [$this, 'do_after'], 100);
includes/admin/settings/class-optimize.php CHANGED
@@ -45,7 +45,6 @@ class OMGF_Admin_Settings_Optimize extends OMGF_Admin_Settings_Builder
45
  add_filter('omgf_optimize_settings_content', [$this, 'do_display_option'], 40);
46
  add_filter('omgf_optimize_settings_content', [$this, 'do_promo_apply_font_display_globally'], 50);
47
  add_filter('omgf_optimize_settings_content', [$this, 'do_promo_remove_async_google_fonts'], 60);
48
- add_filter('omgf_optimize_settings_content', [$this, 'do_use_subsets'], 70);
49
  add_filter('omgf_optimize_settings_content', [$this, 'do_after'], 100);
50
 
51
  add_filter('omgf_optimize_settings_content', [$this, 'do_optimize_fonts_container'], 200);
@@ -142,11 +141,19 @@ class OMGF_Admin_Settings_Optimize extends OMGF_Admin_Settings_Builder
142
  </td>
143
  </tr>
144
  <?php
 
 
 
 
 
 
 
 
145
  $this->do_checkbox(
146
  __('Auto-Configure Adv. Processing (Pro)', $this->plugin_text_domain),
147
  'omgf_pro_auto_config',
148
  defined('OMGF_PRO_AUTO_CONFIG') && OMGF_PRO_AUTO_CONFIG,
149
- sprintf(__('Is OMGF not detecting all Google Fonts? Check this box <u>before</u> starting the optimization to auto-configure OMGF Pro\'s <a href="%s">Advanced Processing</a> features and "dig deeper" for Google Fonts where needed.', $this->plugin_text_domain), admin_url('options-general.php?page=optimize-webfonts&tab=omgf-detection-settings')) . ' ' . $this->promo,
150
  !defined('OMGF_PRO_AUTO_CONFIG'),
151
  'task-manager-row'
152
  );
@@ -217,23 +224,6 @@ class OMGF_Admin_Settings_Optimize extends OMGF_Admin_Settings_Builder
217
  );
218
  }
219
 
220
- /**
221
- * Preload Subsets
222
- *
223
- * @return void
224
- */
225
- public function do_use_subsets()
226
- {
227
- $this->do_select(
228
- __('Used Subset(s)', $this->plugin_text_domain),
229
- OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_SUBSETS,
230
- OMGF_Admin_Settings::OMGF_SUBSETS,
231
- OMGF_SUBSETS,
232
- __('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),
233
- true
234
- );
235
- }
236
-
237
  /**
238
  *
239
  */
45
  add_filter('omgf_optimize_settings_content', [$this, 'do_display_option'], 40);
46
  add_filter('omgf_optimize_settings_content', [$this, 'do_promo_apply_font_display_globally'], 50);
47
  add_filter('omgf_optimize_settings_content', [$this, 'do_promo_remove_async_google_fonts'], 60);
 
48
  add_filter('omgf_optimize_settings_content', [$this, 'do_after'], 100);
49
 
50
  add_filter('omgf_optimize_settings_content', [$this, 'do_optimize_fonts_container'], 200);
141
  </td>
142
  </tr>
143
  <?php
144
+ $this->do_checkbox(
145
+ __('Auto-Configure Subsets', $this->plugin_text_domain),
146
+ OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_AUTO_SUBSETS,
147
+ OMGF_AUTO_SUBSETS,
148
+ sprintf(__('When this option is checked, %s will set the <strong>Used Subset(s)</strong> option to only use subsets that\'re available for <u>all</u> detected font families. Novice users are advised to leave this enabled.', $this->plugin_text_domain), apply_filters('omgf_settings_page_title', 'OMGF')),
149
+ false,
150
+ 'task-manager-row'
151
+ );
152
  $this->do_checkbox(
153
  __('Auto-Configure Adv. Processing (Pro)', $this->plugin_text_domain),
154
  'omgf_pro_auto_config',
155
  defined('OMGF_PRO_AUTO_CONFIG') && OMGF_PRO_AUTO_CONFIG,
156
+ sprintf(__('Is %s not detecting all Google Fonts? Check this box <u>before</u> starting the optimization to auto-configure OMGF Pro\'s <a href="%s">Advanced Processing</a> features and "dig deeper" for Google Fonts where needed. Novice users are advised to leave this enabled.', $this->plugin_text_domain), apply_filters('omgf_settings_page_title', 'OMGF'), admin_url('options-general.php?page=optimize-webfonts&tab=omgf-detection-settings')) . ' ' . $this->promo,
157
  !defined('OMGF_PRO_AUTO_CONFIG'),
158
  'task-manager-row'
159
  );
224
  );
225
  }
226
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
  /**
228
  *
229
  */
includes/class-admin.php CHANGED
@@ -35,7 +35,9 @@ class OMGF_Admin
35
  /**
36
  * Filterable list of options that marks the cache as stale.
37
  */
38
- $this->stale_cache_options = apply_filters('omgf_admin_stale_cache_options', []);
 
 
39
 
40
  add_action('admin_enqueue_scripts', [$this, 'enqueue_admin_scripts']);
41
  add_action('admin_notices', [$this, 'print_notices']);
35
  /**
36
  * Filterable list of options that marks the cache as stale.
37
  */
38
+ $this->stale_cache_options = apply_filters('omgf_admin_stale_cache_options', [
39
+ OMGF_Admin_Settings::OMGF_ADV_SETTING_SUBSETS
40
+ ]);
41
 
42
  add_action('admin_enqueue_scripts', [$this, 'enqueue_admin_scripts']);
43
  add_action('admin_notices', [$this, 'print_notices']);
includes/class-ajax.php CHANGED
@@ -186,11 +186,12 @@ class OMGF_AJAX
186
  'init' => $initiator,
187
  'exclude' => [],
188
  'queue' => [
189
- OMGF_Admin_Settings::OMGF_OPTIMIZE_HAS_RUN,
190
  OMGF_Admin_Settings::OMGF_CACHE_IS_STALE,
191
  OMGF_Admin_Settings::OMGF_CACHE_TIMESTAMP,
192
- OMGF_Admin_Settings::OMGF_HIDDEN_NOTICES,
193
  OMGF_Admin_Settings::OMGF_FOUND_IFRAMES,
 
 
194
  OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_CACHE_KEYS,
195
  OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS,
196
  OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_UNLOAD_FONTS,
186
  'init' => $initiator,
187
  'exclude' => [],
188
  'queue' => [
189
+ OMGF_Admin_Settings::OMGF_AVAILABLE_USED_SUBSETS,
190
  OMGF_Admin_Settings::OMGF_CACHE_IS_STALE,
191
  OMGF_Admin_Settings::OMGF_CACHE_TIMESTAMP,
 
192
  OMGF_Admin_Settings::OMGF_FOUND_IFRAMES,
193
+ OMGF_Admin_Settings::OMGF_HIDDEN_NOTICES,
194
+ OMGF_Admin_Settings::OMGF_OPTIMIZE_HAS_RUN,
195
  OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_CACHE_KEYS,
196
  OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS,
197
  OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_UNLOAD_FONTS,
includes/class-omgf.php CHANGED
@@ -39,7 +39,9 @@ class OMGF
39
  'oxygen',
40
  'optimizepress',
41
  'popup-maker',
42
- 'thrive'
 
 
43
  ];
44
 
45
  /**
@@ -130,8 +132,9 @@ class OMGF
130
  define('OMGF_SITE_URL', 'https://daan.dev');
131
  define('OMGF_CACHE_IS_STALE', esc_attr(get_option(OMGF_Admin_Settings::OMGF_CACHE_IS_STALE)));
132
  define('OMGF_CURRENT_DB_VERSION', esc_attr(get_option(OMGF_Admin_Settings::OMGF_CURRENT_DB_VERSION)));
 
133
  define('OMGF_DISPLAY_OPTION', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_DISPLAY_OPTION, 'swap')) ?: 'swap');
134
- define('OMGF_SUBSETS', $this->esc_array(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_SUBSETS, ['latin', 'latin-ext'])) ?: ['latin', 'latin-ext']);
135
  define('OMGF_UNLOAD_STYLESHEETS', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_UNLOAD_STYLESHEETS, '')));
136
  define('OMGF_CACHE_KEYS', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_CACHE_KEYS, '')));
137
  define('OMGF_TEST_MODE', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_TEST_MODE)));
@@ -139,7 +142,7 @@ class OMGF
139
  define('OMGF_DEBUG_MODE', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_DEBUG_MODE)));
140
  define('OMGF_UNINSTALL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_UNINSTALL)));
141
  define('OMGF_UPLOAD_DIR', apply_filters('omgf_upload_dir', WP_CONTENT_DIR . '/uploads/omgf'));
142
- define('OMGF_UPLOAD_URL', apply_filters('omgf_upload_url', WP_CONTENT_URL . '/uploads/omgf'));
143
  }
144
 
145
  /**
@@ -154,6 +157,8 @@ class OMGF
154
 
155
  /**
156
  * Escape each value of an option array.
 
 
157
  */
158
  private function esc_array($array)
159
  {
@@ -162,6 +167,16 @@ class OMGF
162
  }
163
 
164
  foreach ($array as &$element) {
 
 
 
 
 
 
 
 
 
 
165
  $element = esc_attr($element);
166
  }
167
 
@@ -326,6 +341,7 @@ class OMGF
326
  * @since v4.5.7
327
  *
328
  * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
 
329
  *
330
  * @return array
331
  */
@@ -439,6 +455,50 @@ class OMGF
439
  return '';
440
  }
441
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
442
  /**
443
  * Download $url and save as $filename.$extension to $path.
444
  *
39
  'oxygen',
40
  'optimizepress',
41
  'popup-maker',
42
+ 'premium-stock-market-widgets',
43
+ 'thrive',
44
+ 'woozone'
45
  ];
46
 
47
  /**
132
  define('OMGF_SITE_URL', 'https://daan.dev');
133
  define('OMGF_CACHE_IS_STALE', esc_attr(get_option(OMGF_Admin_Settings::OMGF_CACHE_IS_STALE)));
134
  define('OMGF_CURRENT_DB_VERSION', esc_attr(get_option(OMGF_Admin_Settings::OMGF_CURRENT_DB_VERSION)));
135
+ define('OMGF_AUTO_SUBSETS', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_AUTO_SUBSETS, 'on')) ?: 'on');
136
  define('OMGF_DISPLAY_OPTION', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_DISPLAY_OPTION, 'swap')) ?: 'swap');
137
+ define('OMGF_SUBSETS', $this->esc_array(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_SUBSETS, ['latin', 'latin-ext'])) ?: ['latin', 'latin-ext']);
138
  define('OMGF_UNLOAD_STYLESHEETS', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_UNLOAD_STYLESHEETS, '')));
139
  define('OMGF_CACHE_KEYS', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_CACHE_KEYS, '')));
140
  define('OMGF_TEST_MODE', esc_attr(get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_TEST_MODE)));
142
  define('OMGF_DEBUG_MODE', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_DEBUG_MODE)));
143
  define('OMGF_UNINSTALL', esc_attr(get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_UNINSTALL)));
144
  define('OMGF_UPLOAD_DIR', apply_filters('omgf_upload_dir', WP_CONTENT_DIR . '/uploads/omgf'));
145
+ define('OMGF_UPLOAD_URL', apply_filters('omgf_upload_url', str_replace(['http:', 'https:'], '', WP_CONTENT_URL . '/uploads/omgf')));
146
  }
147
 
148
  /**
157
 
158
  /**
159
  * Escape each value of an option array.
160
+ *
161
+ * @since v5.5.0 Make sure sub-elements are properly escaped as well.
162
  */
163
  private function esc_array($array)
164
  {
167
  }
168
 
169
  foreach ($array as &$element) {
170
+ if (is_array($element)) {
171
+ $element = $this->esc_array($element);
172
+
173
+ continue;
174
+ }
175
+
176
+ if (!is_string($element)) {
177
+ continue;
178
+ }
179
+
180
  $element = esc_attr($element);
181
  }
182
 
341
  * @since v4.5.7
342
  *
343
  * @param array $maybe_add If it doesn't exist, it's added to the cache layer.
344
+ * @param bool $force_add
345
  *
346
  * @return array
347
  */
455
  return '';
456
  }
457
 
458
+ /**
459
+ * @since v5.4.4 Returns the subsets that're available in all requested fonts/stylesheets.
460
+ *
461
+ * Functions as a temporary cache layer to reduce DB reads with get_option().
462
+ *
463
+ * @return array
464
+ */
465
+ public static function available_used_subsets($maybe_add = [], $intersect = false)
466
+ {
467
+ static $subsets = [];
468
+
469
+ if (empty($subsets)) {
470
+ $subsets = get_option(OMGF_Admin_Settings::OMGF_AVAILABLE_USED_SUBSETS, []) ?: [];
471
+ }
472
+
473
+ /**
474
+ * get_option() should take care of this, but sometimes it doesn't.
475
+ */
476
+ if (is_string($subsets)) {
477
+ $subsets = unserialize($subsets);
478
+ }
479
+
480
+ /**
481
+ * If $maybe_add doesn't exist in the cache layer yet, add it.
482
+ */
483
+ if (!empty($maybe_add) && (!isset($subsets[key($maybe_add)]))) {
484
+ $subsets = array_merge($subsets, $maybe_add);
485
+ }
486
+
487
+ /**
488
+ * Return only subsets that're available in all font families.
489
+ *
490
+ * @see OMGF_Optimize_Run
491
+ */
492
+ if ($intersect) {
493
+ /**
494
+ * We can't always control what's in $subsets and empty arrays could occur, throwing warnings.
495
+ */
496
+ return @call_user_func_array('array_intersect', array_values(array_filter($subsets)));
497
+ }
498
+
499
+ return $subsets;
500
+ }
501
+
502
  /**
503
  * Download $url and save as $filename.$extension to $path.
504
  *
includes/class-optimize.php CHANGED
@@ -18,6 +18,9 @@ defined('ABSPATH') || exit;
18
 
19
  class OMGF_Optimize
20
  {
 
 
 
21
  const USER_AGENT = [
22
  'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0',
23
  ];
@@ -47,6 +50,13 @@ class OMGF_Optimize
47
  */
48
  private $variable_fonts = [];
49
 
 
 
 
 
 
 
 
50
  /** @var string */
51
  private $plugin_text_domain = 'host-webfonts-local';
52
 
@@ -182,6 +192,17 @@ class OMGF_Optimize
182
 
183
  update_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS, $optimized_fonts);
184
 
 
 
 
 
 
 
 
 
 
 
 
185
  switch ($this->return) {
186
  case 'path':
187
  return $local_file;
@@ -327,7 +348,7 @@ class OMGF_Optimize
327
  * Parse stylesheets for subsets, which in Google Fonts stylesheets are always
328
  * included, commented above each @font-face statements, e.g. /* latin-ext */ /*
329
  */
330
- private function parse_subsets($stylesheet)
331
  {
332
  OMGF::debug(__('Parsing subsets.', $this->plugin_text_domain));
333
 
@@ -339,6 +360,11 @@ class OMGF_Optimize
339
 
340
  $subsets = array_unique($subsets[1]);
341
 
 
 
 
 
 
342
  OMGF::debug_array(__('Subset @font-face statements', $this->plugin_text_domain), $subsets);
343
 
344
  return $subsets;
18
 
19
  class OMGF_Optimize
20
  {
21
+ /**
22
+ * User Agents set to be used to make requests to the Google Fonts API.
23
+ */
24
  const USER_AGENT = [
25
  'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0',
26
  ];
50
  */
51
  private $variable_fonts = [];
52
 
53
+ /**
54
+ * @var array $available_used_subsets Contains an array_intersect() of subsets that're set to be used AND are actually available.
55
+ *
56
+ * @since v5.4.4
57
+ */
58
+ private $available_used_subsets = [];
59
+
60
  /** @var string */
61
  private $plugin_text_domain = 'host-webfonts-local';
62
 
192
 
193
  update_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_OPTIMIZED_FONTS, $optimized_fonts);
194
 
195
+ /**
196
+ * @since v5.4.4 Stores the subsets actually available in this configuration to the database.
197
+ *
198
+ * @see OMGF_Optimize_Run
199
+ */
200
+ if (OMGF_AUTO_SUBSETS == 'on') {
201
+ $available_used_subsets = OMGF::available_used_subsets($this->available_used_subsets);
202
+
203
+ update_option(OMGF_Admin_Settings::OMGF_AVAILABLE_USED_SUBSETS, $available_used_subsets);
204
+ }
205
+
206
  switch ($this->return) {
207
  case 'path':
208
  return $local_file;
348
  * Parse stylesheets for subsets, which in Google Fonts stylesheets are always
349
  * included, commented above each @font-face statements, e.g. /* latin-ext */ /*
350
  */
351
+ private function parse_subsets($stylesheet, $font_family)
352
  {
353
  OMGF::debug(__('Parsing subsets.', $this->plugin_text_domain));
354
 
360
 
361
  $subsets = array_unique($subsets[1]);
362
 
363
+ /**
364
+ * @since v5.4.4 Stores all subsets that are selected to be used AND are actually available in this font-family.
365
+ */
366
+ $this->available_used_subsets[$font_family] = array_intersect($subsets, OMGF_SUBSETS);
367
+
368
  OMGF::debug_array(__('Subset @font-face statements', $this->plugin_text_domain), $subsets);
369
 
370
  return $subsets;
includes/db/migrate/class-v533.php CHANGED
@@ -30,10 +30,10 @@ class OMGF_DB_Migrate_V533
30
  */
31
  private function init()
32
  {
33
- $subsets = get_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_SUBSETS);
34
 
35
  if (!$subsets) {
36
- update_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_SETTING_SUBSETS, ['latin', 'latin-ext']);
37
  }
38
 
39
  /**
30
  */
31
  private function init()
32
  {
33
+ $subsets = get_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_SUBSETS);
34
 
35
  if (!$subsets) {
36
+ update_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_SUBSETS, ['latin', 'latin-ext']);
37
  }
38
 
39
  /**
includes/frontend/class-process.php CHANGED
@@ -33,7 +33,7 @@ class OMGF_Frontend_Process
33
  'fl_builder',
34
  'siteorigin_panels_live_editor',
35
  'tve',
36
- 'vc_action',
37
  'perfmatters' // Perfmatter's Frontend Script Manager.
38
  ];
39
 
@@ -372,9 +372,11 @@ class OMGF_Frontend_Process
372
  * @since v5.4.0 Added compatibility for BunnyCDN's "GDPR compliant" Google Fonts API.
373
  *
374
  * @since v5.4.1 Make sure hitting the domain, not a subfolder generated by some plugins.
 
 
375
  */
376
  $links = array_filter($links[0], function ($link) {
377
- return strpos($link, 'fonts.googleapis.com/css') !== false || strpos($link, 'fonts.bunny.net/css') !== false;
378
  });
379
 
380
  $google_fonts = $this->build_fonts_set($links);
33
  'fl_builder',
34
  'siteorigin_panels_live_editor',
35
  'tve',
36
+ 'vc_action', // WP Bakery
37
  'perfmatters' // Perfmatter's Frontend Script Manager.
38
  ];
39
 
372
  * @since v5.4.0 Added compatibility for BunnyCDN's "GDPR compliant" Google Fonts API.
373
  *
374
  * @since v5.4.1 Make sure hitting the domain, not a subfolder generated by some plugins.
375
+ *
376
+ * @since v5.5.0 Added compatibility for WP.com's "GDPR compliant" Google Fonts API.
377
  */
378
  $links = array_filter($links[0], function ($link) {
379
+ return strpos($link, 'fonts.googleapis.com/css') !== false || strpos($link, 'fonts.bunny.net/css') !== false || strpos($link, 'fonts-api.wp-com/css') !== false;
380
  });
381
 
382
  $google_fonts = $this->build_fonts_set($links);
includes/optimize/class-run.php CHANGED
@@ -43,15 +43,10 @@ class OMGF_Optimize_Run
43
  update_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_HAS_RUN, true);
44
 
45
  $front_html = $this->get_front_html(get_home_url());
46
- $error = false;
47
 
48
  if (is_wp_error($front_html) || wp_remote_retrieve_response_code($front_html) != 200) {
49
  $this->frontend_fetch_failed($front_html);
50
-
51
- $error = true;
52
- }
53
-
54
- if (!$error) {
55
  $this->optimization_succeeded();
56
  }
57
  }
@@ -64,22 +59,30 @@ class OMGF_Optimize_Run
64
  */
65
  private function get_front_html($url)
66
  {
67
- return wp_remote_get(
68
  $this->no_cache_optimize_url($url),
69
  [
70
  'timeout' => 60
71
  ]
72
  );
 
 
73
  }
74
 
75
  /**
 
 
76
  * @param $url
 
 
77
  *
78
  * @return string
79
  */
80
  private function no_cache_optimize_url($url)
81
  {
82
- return add_query_arg(['omgf_optimize' => 1, 'nocache' => substr(md5(microtime()), rand(0, 26), 5)], $url);
 
 
83
  }
84
 
85
  /**
@@ -100,6 +103,72 @@ class OMGF_Optimize_Run
100
  'omgf-cache-notice',
101
  'warning'
102
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
103
  }
104
 
105
  /**
43
  update_option(OMGF_Admin_Settings::OMGF_OPTIMIZE_HAS_RUN, true);
44
 
45
  $front_html = $this->get_front_html(get_home_url());
 
46
 
47
  if (is_wp_error($front_html) || wp_remote_retrieve_response_code($front_html) != 200) {
48
  $this->frontend_fetch_failed($front_html);
49
+ } else {
 
 
 
 
50
  $this->optimization_succeeded();
51
  }
52
  }
59
  */
60
  private function get_front_html($url)
61
  {
62
+ $result = wp_remote_get(
63
  $this->no_cache_optimize_url($url),
64
  [
65
  'timeout' => 60
66
  ]
67
  );
68
+
69
+ return $result;
70
  }
71
 
72
  /**
73
+ * Generate a request to $uri including the required parameters for OMGF to run in the frontend.
74
+ *
75
  * @param $url
76
+ *
77
+ * @since v5.4.4 Added omgf_optimize_run_args filter so other plugins can add query parameters to the Save & Optimize routine.
78
  *
79
  * @return string
80
  */
81
  private function no_cache_optimize_url($url)
82
  {
83
+ $args = apply_filters('omgf_optimize_run_args', ['omgf_optimize' => 1, 'nocache' => substr(md5(microtime()), rand(0, 26), 5)]);
84
+
85
+ return add_query_arg($args, $url);
86
  }
87
 
88
  /**
103
  'omgf-cache-notice',
104
  'warning'
105
  );
106
+
107
+ /**
108
+ * @since v5.4.4 Check if selected Used Subset(s) are actually available in all detected font families,
109
+ * and update the Used Subset(s) option if not.
110
+ */
111
+ $available_used_subsets = OMGF::available_used_subsets(null, true);
112
+
113
+ if (OMGF_AUTO_SUBSETS == 'on') {
114
+ /**
115
+ * Show a notice
116
+ */
117
+ if ($available_used_subsets && !empty($diff = array_diff(OMGF_SUBSETS, $available_used_subsets))) {
118
+ OMGF_Admin_Notice::set_notice(
119
+ sprintf(
120
+ _n(
121
+ '%s is removed as a Used Subset, as not all detected font families are available in this subset. <a href="#" id="omgf-optimize-again">Run optimization again</a> to process these changes.',
122
+ '%s are removed as Used Subset(s), as not all detected font families are available in these subsets. <a href="#" id="omgf-optimize-again">Run optimization again</a> to process these changes.',
123
+ count($diff),
124
+ 'host-webfonts-local'
125
+ ),
126
+ $this->fluent_implode($diff)
127
+ ),
128
+ 'omgf-used-subsets-removed',
129
+ 'info'
130
+ );
131
+ }
132
+
133
+ if ($available_used_subsets) {
134
+ update_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_SUBSETS, $available_used_subsets);
135
+ } elseif (!empty($diff = array_diff(OMGF_SUBSETS, ['latin']))) {
136
+ /**
137
+ * If detected fonts aren't available in any of the subsets that were selected, just set Used Subsets to Latin
138
+ * to make sure nothing breaks.
139
+ */
140
+ OMGF_Admin_Notice::set_notice(
141
+ sprintf(
142
+ __('Used Subset(s) is set to Latin, since all detected font-families aren\'t available in %s. <a href="#" id="omgf-optimize-again">Run optimization again</a> to process these changes.', 'host-webfonts-local'),
143
+ $this->fluent_implode($diff)
144
+ ),
145
+ 'omgf-used-subsets-defaults',
146
+ 'info'
147
+ );
148
+
149
+ update_option(OMGF_Admin_Settings::OMGF_ADV_SETTING_SUBSETS, ['latin']);
150
+ }
151
+ }
152
+ }
153
+
154
+ /**
155
+ * Generate a fluent sentence from array, e.g. "1, 2, 3 and 4".
156
+ *
157
+ * @since v5.4.4
158
+ *
159
+ * @param array $array
160
+ *
161
+ * @return string
162
+ */
163
+ private function fluent_implode($array)
164
+ {
165
+ if (count($array) == 1) {
166
+ return ucfirst(reset($array));
167
+ }
168
+
169
+ $last = array_pop($array);
170
+
171
+ return implode(', ', array_map('ucfirst', $array)) . ' and ' . ucfirst($last);
172
  }
173
 
174
  /**
readme.md CHANGED
@@ -25,7 +25,7 @@ All Google Fonts are listed in the **Optimize Local Fonts** section of OMGF's se
25
  ### Other Features include
26
 
27
  - **Variable Fonts** support,
28
- - **Remove unused subsets** to reduce the size of the CSS stylesheet,
29
  - **Remove Resource Hints** (preload, preconnect, dns-prefetch) pointing to `fonts.googleapis.com` or `fonts.gstatic.com`,
30
  - **Ensure text remains visible during webfont load** by forcing the _font-display_ attribute to your Google Fonts,
31
  - **Ensure text remains visible during webfont load** by forcing the _font-display_ attribute to all your other fonts! (OMGF Pro required),
25
  ### Other Features include
26
 
27
  - **Variable Fonts** support,
28
+ - Automatically **Remove unused subsets** to reduce the size of the CSS stylesheet up to 90%!
29
  - **Remove Resource Hints** (preload, preconnect, dns-prefetch) pointing to `fonts.googleapis.com` or `fonts.gstatic.com`,
30
  - **Ensure text remains visible during webfont load** by forcing the _font-display_ attribute to your Google Fonts,
31
  - **Ensure text remains visible during webfont load** by forcing the _font-display_ attribute to all your other fonts! (OMGF Pro required),
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === OMGF | GDPR/DSVGO Compliant, Faster Google Fonts. Easy. ===
2
  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.1
6
- Stable tag: 5.4.3
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -33,7 +33,7 @@ All Google Fonts are listed in the **Optimize Local Fonts** section of OMGF's se
33
  = Other Features include =
34
 
35
  - **Variable Fonts** support,
36
- - **Remove unused subsets** to reduce the size of the CSS stylesheet,
37
  - **Remove Resource Hints** (preload, preconnect, dns-prefetch) pointing to `fonts.googleapis.com` or `fonts.gstatic.com`,
38
  - **Ensure text remains visible during webfont load** by forcing the *font-display* attribute to your Google Fonts,
39
  - **Ensure text remains visible during webfont load** by forcing the *font-display* attribute to all your other fonts! (OMGF Pro required),
@@ -76,6 +76,13 @@ For the FAQ, [click here](https://daan.dev/docs/omgf-pro-faq/).
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
 
 
79
  = 5.4.3 | November 7th, 2022 =
80
  * Tested with WP 6.1
81
  * OMGF will now warn you when it detects you're using the following scripts loading Google Fonts in iframes:
1
+ === OMGF | GDPR/DSGVO Compliant, Faster Google Fonts. Easy. ===
2
  Contributors: DaanvandenBergh
3
+ Tags: google, fonts, gdpr, dsgvo, cache, speed, preload, font-display, webfonts, subsets, remove, minimize, external, requests
4
  Requires at least: 4.6
5
  Tested up to: 6.1
6
+ Stable tag: 5.5.0
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
33
  = Other Features include =
34
 
35
  - **Variable Fonts** support,
36
+ - Automatically **Remove unused subsets** to reduce the size of the CSS stylesheet with ~90%!
37
  - **Remove Resource Hints** (preload, preconnect, dns-prefetch) pointing to `fonts.googleapis.com` or `fonts.gstatic.com`,
38
  - **Ensure text remains visible during webfont load** by forcing the *font-display* attribute to your Google Fonts,
39
  - **Ensure text remains visible during webfont load** by forcing the *font-display* attribute to all your other fonts! (OMGF Pro required),
76
 
77
  == Changelog ==
78
 
79
+ = 5.5.0 | December 5th, 2022 =
80
+ * Added: 'omgf_optimize_run_args' filter to allow adding attional GET-parameters before running optimization.
81
+ * Improved: always use protocol relative ('//' instead of 'https://') URLs when generating and loading stylesheets to avoid SSL- and permalinks related quirks in WordPress.
82
+ * Added: Auto-Configure Subsets feature and moved the Used Subset(s) option to the Advanced Settings tab.
83
+ * Added: compatibility for WP.com's "GDPR compliant" Google Fonts API.
84
+ * Fixed: Array to string conversion in PHPH 8.1 while escaping arrays.
85
+
86
  = 5.4.3 | November 7th, 2022 =
87
  * Tested with WP 6.1
88
  * OMGF will now warn you when it detects you're using the following scripts loading Google Fonts in iframes: