PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | templates/minify/font-settings-tab.php +169 -132 3.7.0 → 4.7.0 View file →
@@ -1,5 +1,5 @@
1 -<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
1 +<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?>
2 2 <div class="wpo_section wpo_group">
3 3 <form>
4 4 <div id="wpo_settings_warnings"></div>
5 5 <h3><?php esc_html_e('Google Fonts', 'wp-optimize'); ?></h3>
@@ -4,161 +4,198 @@
4 4 <div id="wpo_settings_warnings"></div>
5 5 <h3><?php esc_html_e('Google Fonts', 'wp-optimize'); ?></h3>
6 6 <div class="wpo-fieldgroup">
7 7 <fieldset>
8 - <label for="disable_google_fonts_processing">
9 - <input
10 - name="disable_google_fonts_processing"
11 - type="checkbox"
12 - id="disable_google_fonts_processing"
13 - value="1"
14 - <?php echo checked($wpo_minify_options['disable_google_fonts_processing']); ?>
15 - >
16 - <?php esc_html_e('Disable Google Fonts processing', 'wp-optimize'); ?>
17 - <span tabindex="0" data-tooltip="<?php esc_attr_e('If enabled, stylesheets from Google Fonts will bypass WP-Optimize processing, allowing standard WordPress processing to be used instead.', 'wp-optimize');?> <?php esc_attr_e('This can be helpful if you are using other plugins that work with Google Fonts and experience conflicts with WP-Optimize.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
18 - </label>
8 + <div class="wpo-fieldgroup__subgroup show-if-enabled">
9 + <label for="disable_google_fonts_processing">
10 + <input
11 + name="disable_google_fonts_processing"
12 + type="checkbox"
13 + id="disable_google_fonts_processing"
14 + value="1"
15 + <?php checked($wpo_minify_options['disable_google_fonts_processing']); ?>
16 + >
17 + <?php esc_html_e('Disable Google Fonts processing', 'wp-optimize'); ?>
18 + </label>
19 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('If enabled, stylesheets from Google Fonts will bypass WP-Optimize processing, allowing standard WordPress processing to be used instead.', 'wp-optimize');?> <?php esc_attr_e('This can be helpful if you are using other plugins that work with Google Fonts and experience conflicts with WP-Optimize.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
20 + </div>
19 21 <?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
20 - <label for="merge_google_fonts">
22 + <div class="wpo-fieldgroup__subgroup show-if-enabled">
23 + <label for="merge_google_fonts">
24 + <input
25 + name="merge_google_fonts"
26 + type="checkbox"
27 + id="merge_google_fonts"
28 + class="google_fonts_option"
29 + value="1"
30 + <?php checked($wpo_minify_options['merge_google_fonts']); ?>
31 + >
32 + <?php esc_html_e('Merge fonts from Google Fonts into one request', 'wp-optimize'); ?>
33 + </label>
34 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('This improves speed when loading multiple fonts from Google Fonts.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
35 + </div>
36 + <?php endif; ?>
37 + <div class="wpo-fieldgroup__subgroup show-if-enabled">
38 + <label for="remove_googlefonts">
21 39 <input
22 - name="merge_google_fonts"
40 + name="remove_googlefonts"
23 41 type="checkbox"
24 - id="merge_google_fonts"
42 + id="remove_googlefonts"
25 43 class="google_fonts_option"
26 44 value="1"
27 - <?php echo checked($wpo_minify_options['merge_google_fonts']); ?>
45 + <?php checked($wpo_minify_options['remove_googlefonts']); ?>
28 46 >
29 - <?php esc_html_e('Merge fonts from Google Fonts into one request', 'wp-optimize'); ?>
30 - <span tabindex="0" data-tooltip="<?php esc_attr_e('This improves speed when loading multiple fonts from Google Fonts.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
47 + <?php esc_html_e('Do not load Google Fonts', 'wp-optimize'); ?>
31 48 </label>
32 - <?php endif; ?>
33 - <label for="remove_googlefonts">
34 - <input
35 - name="remove_googlefonts"
36 - type="checkbox"
37 - id="remove_googlefonts"
38 - class="google_fonts_option"
39 - value="1"
40 - <?php echo checked($wpo_minify_options['remove_googlefonts']); ?>
41 - >
42 - <?php esc_html_e('Do not load Google Fonts', 'wp-optimize'); ?>
43 - <span tabindex="0" data-tooltip="<?php esc_attr_e('If enabled, stylesheets from Google Fonts will not be loaded on the site and system fallback fonts will be used instead.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
44 - </label>
45 - <label for="enable_display_swap">
46 - <input
47 - name="enable_display_swap"
48 - type="checkbox"
49 - id="enable_display_swap"
50 - class="google_fonts_option"
51 - value="1"
52 - <?php echo checked($wpo_minify_options['enable_display_swap']); ?>
53 - >
54 - <?php esc_html_e('Add "display=swap" to Google Fonts requests', 'wp-optimize'); ?>
55 - <span tabindex="0" data-tooltip="<?php esc_attr_e('This feature of Google Fonts is encouraged for better accessibility, but may result in a visible font change.', 'wp-optimize'); ?>"><span class="dashicons dashicons-editor-help"></span></span>
56 - </label>
49 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('If enabled, stylesheets from Google Fonts will not be loaded on the site and system fallback fonts will be used instead.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
50 + </div>
51 + <div class="wpo-fieldgroup__subgroup show-if-enabled">
52 + <label for="enable_display_swap">
53 + <input
54 + name="enable_display_swap"
55 + type="checkbox"
56 + id="enable_display_swap"
57 + class="google_fonts_option"
58 + value="1"
59 + <?php checked($wpo_minify_options['enable_display_swap']); ?>
60 + >
61 + <?php esc_html_e('Add "display=swap" to Google Fonts requests', 'wp-optimize'); ?>
62 + </label>
63 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('This feature of Google Fonts is encouraged for better accessibility, but may result in a visible font change.', 'wp-optimize'); ?>"><span class="dashicons dashicons-editor-help"></span></span><br>
64 + </div>
65 + <div class="wpo-fieldgroup__subgroup">
66 + <label for="host_local_google_fonts">
67 + <input
68 + name="host_local_google_fonts"
69 + type="checkbox"
70 + id="host_local_google_fonts"
71 + class="google_fonts_option skip-disable-processing"
72 + value="1"
73 + disabled
74 + >
75 + <?php esc_html_e('Host Google Fonts locally', 'wp-optimize'); ?>
76 + </label>
77 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('If enabled, stylesheet and font files from Google Fonts will be hosted locally.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
78 + <div class="wpo-inline-advertise">
79 + <a class="" href="https://teamupdraft.com/wp-optimize/pricing/?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_creative_format=overlay&utm_content=host-local-google-fonts" target="_blank"><?php esc_html_e('Upgrade to WP-Optimize Premium to unlock Host Google Fonts feature.', 'wp-optimize'); ?></a>
80 + </div>
81 + </div>
57 82 </fieldset>
58 - <p class="wpo_min-bold-green wpo_min-rowintro">
83 + <p class="wpo_min-bold-green wpo_min-rowintro show-if-enabled">
59 84 <?php esc_html_e('Choose how to include fonts from Google Fonts on your pages, when available:', 'wp-optimize'); ?>
60 85 </p>
61 - <fieldset>
62 - <label>
63 - <input
64 - type="radio"
65 - class="google_fonts_option"
66 - name="gfonts_method"
67 - value="inherit"
68 - <?php echo checked('inherit' === $wpo_minify_options['gfonts_method']); ?>
69 - >
70 - <?php esc_html_e('Inherit from the CSS settings', 'wp-optimize'); ?>
71 - <span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be merged or inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
72 - </label>
73 - <label>
74 - <input
75 - type="radio"
76 - class="google_fonts_option"
77 - name="gfonts_method"
78 - value="inline"
79 - <?php echo checked('inline' === $wpo_minify_options['gfonts_method']); ?>
80 - >
81 - <?php esc_html_e('Inline google font CSS files', 'wp-optimize'); ?>
82 - <span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
83 - </label>
84 - <label>
85 - <input
86 - type="radio"
87 - class="google_fonts_option"
88 - name="gfonts_method"
89 - value="async"
90 - <?php echo checked('async' === $wpo_minify_options['gfonts_method']); ?>
91 - >
92 - <?php esc_html_e('Asynchronously load CSS files from Google Fonts', 'wp-optimize'); ?>
93 - <span tabindex="0" data-tooltip="<?php esc_attr_e('Will use \'preload\' with LoadCSS polyfill', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
94 - </label>
95 - <label>
96 - <input
97 - type="radio"
98 - class="google_fonts_option"
99 - name="gfonts_method"
100 - value="exclude"
101 - <?php echo checked('exclude' === $wpo_minify_options['gfonts_method']); ?>
102 - >
103 - <?php esc_html_e('Asynchronously load fonts from Google Fonts using JavaScript', 'wp-optimize'); ?>
104 - <span tabindex="0" data-tooltip="<?php esc_attr_e('Use if you want to exclude the CSS from Google Fonts from performance tests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
105 - </label>
86 + <fieldset class="show-if-enabled">
87 + <div class="wpo-fieldgroup__subgroup">
88 + <label>
89 + <input
90 + type="radio"
91 + class="google_fonts_option"
92 + name="gfonts_method"
93 + value="inherit"
94 + <?php checked('inherit' === $wpo_minify_options['gfonts_method']); ?>
95 + >
96 + <?php esc_html_e('Inherit from the CSS settings', 'wp-optimize'); ?>
97 + </label>
98 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('The stylesheets will be merged or inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
99 + </div>
100 + <div class="wpo-fieldgroup__subgroup">
101 + <label>
102 + <input
103 + type="radio"
104 + class="google_fonts_option"
105 + name="gfonts_method"
106 + value="inline"
107 + <?php checked('inline' === $wpo_minify_options['gfonts_method']); ?>
108 + >
109 + <?php esc_html_e('Inline google font CSS files', 'wp-optimize'); ?>
110 + </label>
111 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('The stylesheets will be inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
112 + </div>
113 + <div class="wpo-fieldgroup__subgroup">
114 + <label>
115 + <input
116 + type="radio"
117 + class="google_fonts_option"
118 + name="gfonts_method"
119 + value="async"
120 + <?php checked('async' === $wpo_minify_options['gfonts_method']); ?>
121 + >
122 + <?php esc_html_e('Asynchronously load CSS files from Google Fonts', 'wp-optimize'); ?>
123 + </label>
124 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('Will use \'preload\' with LoadCSS polyfill', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
125 + </div>
126 + <div class="wpo-fieldgroup__subgroup">
127 + <label>
128 + <input
129 + type="radio"
130 + class="google_fonts_option"
131 + name="gfonts_method"
132 + value="exclude"
133 + <?php checked('exclude' === $wpo_minify_options['gfonts_method']); ?>
134 + >
135 + <?php esc_html_e('Asynchronously load fonts from Google Fonts using JavaScript', 'wp-optimize'); ?>
136 + </label>
137 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('Use if you want to exclude the CSS from Google Fonts from performance tests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
138 + </div>
106 139 </fieldset>
107 140 </div>
108 141
109 - <h3><?php esc_html_e('Font Awesome', 'wp-optimize'); ?></h3>
110 - <div class="wpo-fieldgroup">
142 + <h3 class="show-if-enabled"><?php esc_html_e('Font Awesome', 'wp-optimize'); ?></h3>
143 + <div class="wpo-fieldgroup show-if-enabled">
111 144 <p class="wpo_min-bold-green wpo_min-rowintro">
112 145 <?php esc_html_e('Choose how to include Font Awesome (only available if it has \'font-awesome\' in the url):', 'wp-optimize'); ?>
113 146 </p>
114 147 <fieldset>
115 - <label><input
116 - type="radio"
117 - name="fawesome_method"
118 - value="inherit"
119 - <?php echo checked('inherit' === $wpo_minify_options['fawesome_method']); ?>
120 - >
121 - <?php esc_html_e('Inherit from the CSS settings', 'wp-optimize'); ?>
122 - <span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be merged or inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
123 - </label>
124 - <label><input
125 - type="radio"
126 - name="fawesome_method"
127 - value="inline"
128 - <?php echo checked('inline' === $wpo_minify_options['fawesome_method']); ?>
129 - >
130 - <?php esc_html_e('Inline the Font Awesome CSS file', 'wp-optimize'); ?>
131 - </label>
132 - <label>
133 - <input
148 + <div class="wpo-fieldgroup__subgroup">
149 + <label><input
134 150 type="radio"
135 151 name="fawesome_method"
136 - value="async"
137 - <?php echo checked('async' === $wpo_minify_options['fawesome_method']); ?>
152 + value="inherit"
153 + <?php checked('inherit' === $wpo_minify_options['fawesome_method']); ?>
154 + >
155 + <?php esc_html_e('Inherit from the CSS settings', 'wp-optimize'); ?>
156 + </label>
157 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('The stylesheets will be merged or inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
158 + </div>
159 + <div class="wpo-fieldgroup__subgroup">
160 + <label><input
161 + type="radio"
162 + name="fawesome_method"
163 + value="inline"
164 + <?php checked('inline' === $wpo_minify_options['fawesome_method']); ?>
165 + >
166 + <?php esc_html_e('Inline the Font Awesome CSS file', 'wp-optimize'); ?>
167 + </label>
168 + </div>
169 + <div class="wpo-fieldgroup__subgroup">
170 + <label>
171 + <input
172 + type="radio"
173 + name="fawesome_method"
174 + value="async"
175 + <?php checked('async' === $wpo_minify_options['fawesome_method']); ?>
176 + >
177 + <?php esc_html_e('Asynchronously load the Font Awesome CSS file', 'wp-optimize'); ?>
178 + </label>
179 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('Will use \'preload\' with LoadCSS polyfill', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
180 + </div>
181 + <div class="wpo-fieldgroup__subgroup">
182 + <label><input
183 + type="radio"
184 + name="fawesome_method"
185 + value="exclude"
186 + <?php checked('exclude' === $wpo_minify_options['fawesome_method']); ?>
138 187 >
139 - <?php esc_html_e('Asynchronously load the Font Awesome CSS file', 'wp-optimize'); ?>
140 - <span tabindex="0" data-tooltip="<?php esc_attr_e('Will use \'preload\' with LoadCSS polyfill', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
141 - </label>
142 - <label><input
143 - type="radio"
144 - name="fawesome_method"
145 - value="exclude"
146 - <?php echo checked('exclude' === $wpo_minify_options['fawesome_method']); ?>
147 - >
148 - <?php esc_html_e('Asynchronously load the Font Awesome stylesheet using JavaScript', 'wp-optimize'); ?>
149 - <span tabindex="0" data-tooltip="<?php esc_attr_e('Use if you want to exclude Font Awesome from page speed tests (PageSpeed Insights, GTMetrix...)', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
150 - </label>
188 + <?php esc_html_e('Asynchronously load the Font Awesome stylesheet using JavaScript', 'wp-optimize'); ?>
189 + </label>
190 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('Use if you want to exclude Font Awesome from page speed tests (PageSpeed Insights, GTMetrix...)', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span><br>
191 + </div>
151 192 </fieldset>
152 193 </div>
153 194
154 - <p class="submit">
155 - <input
156 - class="wp-optimize-save-minify-settings button button-primary"
157 - type="submit"
158 - value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
159 - >
160 - <img class="wpo_spinner" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); ?>" alt="...">
195 + <div class="wpo-save-btn-container">
196 + <input class="wp-optimize-save-minify-settings button button-primary" type="submit" value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>">
197 + <img class="wpo_spinner" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="...">
161 198 <span class="save-done dashicons dashicons-yes display-none"></span>
162 - </p>
199 + </div>
163 200 </form>
164 201 </div>