PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 3.4.1
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v3.4.1
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
wp-optimize / templates / minify / advanced-tab.php

advanced-tab.php in WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance 3.4.1, at templates/minify/advanced-tab.php

342 lines 13.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
2 <div id="wp-optimize-minify-advanced" class="wpo_section wpo_group">
3 <h3><?php esc_html_e('Minify cache information', 'wp-optimize'); ?></h3>
4 <div class="wpo-fieldgroup">
5 <p>
6 <?php esc_html_e('Current cache path:', 'wp-optimize'); ?>
7 <strong class="wpo_min_cache_path">
8 <?php
9
10 $cache_path = WPO_MINIFY_PHP_VERSION_MET ? WP_Optimize_Minify_Cache_Functions::cache_path() : array("cachedir" => __('none', 'wp-optimize'));
11 echo esc_html($cache_path['cachedir']);
12 ?>
13 </strong>
14 </p>
15
16 <h3><?php esc_html_e('List of processed files', 'wp-optimize'); ?></h3>
17
18 <h4><?php esc_html_e('JavaScript files', 'wp-optimize'); ?></h4>
19 <div id="wpo_min_jsprocessed">
20 <ul class="processed">
21 <?php
22 $processed_js = 0;
23 // Some files exist
24 if ($files && isset($files['js']) && is_array($files['js']) && $files['js']) {
25 $processed_js = count($files['js']);
26 foreach ($files['js'] as $js_file) {
27 WP_Optimize()->include_template(
28 'minify/cached-file.php',
29 false,
30 array(
31 'file' => $js_file,
32 'minify_config' => wp_optimize_minify_config()->get(),
33 )
34 );
35 }
36 }
37 ?>
38 <li class="no-files-yet<?php echo $processed_js ? ' hidden' : ''; ?>">
39 <span class="filename"><?php esc_html_e('There are no processed files yet.', 'wp-optimize'); ?></span>
40 </li>
41 </ul>
42 </div>
43
44 <h4><?php esc_html_e('CSS files', 'wp-optimize'); ?></h4>
45 <div id="wpo_min_cssprocessed">
46 <?php if ($wpo_minify_options['inline_css']) : ?>
47 <p><?php esc_html_e('There are no merged CSS files listed here, because you are inlining all CSS directly', 'wp-optimize'); ?></p>
48 <?php else : ?>
49 <ul class="processed">
50 <?php
51 $processed_css = 0;
52 if ($files && isset($files['css']) && is_array($files['css']) && $files['css']) {
53 $processed_css = count($files['css']);
54 foreach ($files['css'] as $css_file) {
55 WP_Optimize()->include_template(
56 'minify/cached-file.php',
57 false,
58 array(
59 'file' => $css_file,
60 'minify_config' => wp_optimize_minify_config()->get(),
61 )
62 );
63 }
64 }
65 // No files were found
66 ?>
67 <li class="no-files-yet<?php echo $processed_css ? ' hidden' : ''; ?>">
68 <span class="filename"><?php esc_html_e('There are no processed files yet.', 'wp-optimize'); ?></span>
69 </li>
70 </ul>
71 <?php endif; ?>
72 </div>
73
74 </div>
75
76 <form method="post" action="#">
77
78 <h3><?php esc_html_e('Advanced options', 'wp-optimize'); ?></h3>
79 <div class="wpo-fieldgroup">
80 <div class="wpo-fieldgroup__subgroup">
81 <label for="wpo_min_cache_lifespan">
82 <?php esc_html_e('Cache lifespan', 'wp-optimize'); ?>
83 </label>
84 <p>
85 <input
86 name="cache_lifespan"
87 id="wpo_min_cache_lifespan"
88 class="cache_lifespan wpo-save-setting"
89 type="number"
90 min="0"
91 value="<?php echo intval($wpo_minify_options['cache_lifespan']);?>"
92 > <?php esc_html_e('days', 'wp-optimize'); ?>
93 </p>
94 <p>
95 <?php esc_html_e('In order to prevent broken pages when using a third party page caching, WP-Optimize keeps the stale minified cache for 30 days.', 'wp-optimize'); ?>
96 <br><?php esc_html_e('Enter 0 to never keep stale cache.', 'wp-optimize'); ?>
97 </p>
98 </div>
99
100 <div class="switch-container">
101 <label class="switch">
102 <input
103 name="debug"
104 id="wpo_min_enable_minify_debug"
105 class="debug wpo-save-setting"
106 type="checkbox"
107 value="true"
108 <?php checked($wpo_minify_options['debug']);?>
109 >
110 <span class="slider round"></span>
111 </label>
112 <label for="wpo_min_enable_minify_debug">
113 <?php esc_html_e('Enable debug mode', 'wp-optimize'); ?>
114 </label>
115 </div>
116 <p><?php esc_html_e('Enabling the debug mode will add various comments and show more information in the files list.', 'wp-optimize'); ?> <?php esc_html_e('It also adds extra actions in the status tab.', 'wp-optimize'); ?></p>
117 </div>
118 <h3><?php esc_html_e('Default exclusions', 'wp-optimize'); ?></h3>
119 <div class="wpo-fieldgroup">
120 <div class="switch-container">
121 <label class="switch">
122 <input
123 name="edit_default_exclutions"
124 id="wpo_min_edit_default_exclutions"
125 class="debug wpo-save-setting"
126 type="checkbox"
127 value="true"
128 <?php checked($wpo_minify_options['edit_default_exclutions']);?>
129 >
130 <span class="slider round"></span>
131 </label>
132 <label for="wpo_min_edit_default_exclutions">
133 <?php esc_html_e('Edit default exclusions', 'wp-optimize'); ?>
134 </label>
135 </div>
136 <p><?php esc_html_e('By default, WP-Optimize excludes a list of files that are known to cause problems when minified or combined.', 'wp-optimize'); ?>
137 <?php esc_html_e('Enable this option to see or edit those files.', 'wp-optimize'); ?></p>
138 <div class="wpo-minify-default-exclusions<?php echo $wpo_minify_options['edit_default_exclutions'] ? '' : ' hidden'; ?>">
139 <h3><?php esc_html_e('Known incompatible files', 'wp-optimize'); ?></h3>
140 <fieldset>
141 <label for="ignore_list">
142 <?php esc_html_e('List of files that can\'t or shouldn\'t be minified or merged.', 'wp-optimize'); ?>
143 <?php esc_html_e('Do not edit this if you are not sure what it is.', 'wp-optimize'); ?>
144 <br><?php esc_html_e('Tick the checkbox to merge / minify the corresponding file anyways.', 'wp-optimize'); ?>
145 <span tabindex="0" data-tooltip="<?php esc_attr_e('Files that have been consistently reported by other users to cause trouble when merged', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
146 </label>
147 <?php
148 $user_excluded_ignorelist_items = is_array($wpo_minify_options['ignore_list']) ? $wpo_minify_options['ignore_list'] : array();
149 if (empty($default_ignore)) {
150 echo '<p>'.esc_html__('Refresh the page to see the list', 'wp-optimize').'</p>';
151 } else {
152 foreach ($default_ignore as $ignore_item) {
153 ?>
154 <label class="ignore-list-item"><input type="checkbox" name="ignore_list[]" value="<?php echo esc_attr($ignore_item); ?>"<?php checked(in_array($ignore_item, $user_excluded_ignorelist_items)); ?>><span class="ignore-item"><?php echo esc_html($ignore_item); ?></span></label>
155 <?php
156 }
157 }
158 ?>
159 </fieldset>
160
161 <h3><?php esc_html_e('IE incompatible files', 'wp-optimize'); ?></h3>
162 <fieldset>
163 <label for="blacklist">
164 <?php esc_html_e('List of excluded files used for IE compatibility.', 'wp-optimize'); ?>
165 <?php esc_html_e('Do not edit this if you are not sure what it is.', 'wp-optimize'); ?>
166 <br><?php esc_html_e('Tick the checkbox to merge / minify the corresponding file anyways.', 'wp-optimize'); ?>
167 </label>
168 <?php
169 $user_excluded_blacklist_items = is_array($wpo_minify_options['blacklist']) ? $wpo_minify_options['blacklist'] : array();
170 if (empty($default_ie_blacklist)) {
171 echo '<p>'.esc_html__('Refresh the page to see the list', 'wp-optimize').'</p>';
172 } else {
173 foreach ($default_ie_blacklist as $blacklist_item) {
174 ?>
175 <label class="black-list-item"><input type="checkbox" name="blacklist[]" value="<?php echo esc_attr($blacklist_item); ?>"<?php checked(in_array($blacklist_item, $user_excluded_blacklist_items)); ?>><span class="ignore-item"><?php echo esc_html($blacklist_item); ?></span></label>
176 <?php
177 }
178 }
179 ?>
180 </fieldset>
181 </div>
182 </div>
183
184 <?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
185 <div class="wpo-fieldgroup">
186 <fieldset>
187 <br>
188 <label for="enabled_css_preload">
189 <input
190 name="enabled_css_preload"
191 type="checkbox"
192 id="enabled_css_preload"
193 value="1"
194 <?php echo checked($wpo_minify_options['enabled_css_preload']); ?>
195 >
196 <?php esc_html_e('Enable WP-O Minify CSS files preloading', 'wp-optimize'); ?>
197 <span tabindex="0" data-tooltip="<?php esc_attr_e('Automatically create HTTP headers for WP-O Minify-generated CSS files (when not inlined)', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
198 </label>
199 <br>
200 <label for="enabled_js_preload">
201 <input
202 name="enabled_js_preload"
203 type="checkbox"
204 id="enabled_js_preload"
205 value="1"
206 <?php echo checked($wpo_minify_options['enabled_js_preload']); ?>
207 >
208 <?php esc_html_e('Enable WP-O Minify JavaScript files Preload', 'wp-optimize'); ?>
209 <span tabindex="0" data-tooltip="<?php esc_attr_e('Automatically create HTTP headers for WP-O Minify-generated JS files', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
210 </label>
211 </fieldset>
212 </div>
213 <h3 class="title">
214 <?php esc_html_e('HTTP Headers', 'wp-optimize'); ?>
215 </h3>
216 <p class="wpo_min-bold-green">
217 <?php esc_html_e('Preconnect Headers: This will add link headers to your HTTP response to instruct the browser to preconnect to other domains (e.g.: fonts, images, videos, etc)', 'wp-optimize'); ?>
218 </p>
219 <p class="wpo_min-bold-green">
220 <?php esc_html_e('Preload Headers: Use this for preloading specific, high priority resources that exist across all of your pages.', 'wp-optimize'); ?>
221 </p>
222 <p class="wpo_min-bold-green">
223 <?php
224 $message = __('Note: Some servers do not support HTTP push or headers.', 'wp-optimize');
225 $message .= ' ';
226 $message .= __('If you get a server error: a) rename the plugin directory via (S)FTP or your hosting control panel, b) go to your plugins page (plugin will be disabled on access), c) rename it back and d) activate it back (reset to default settings).', 'wp-optimize');
227 echo esc_html($message);
228 ?>
229 </p>
230
231 <h3><?php esc_html_e('Preconnect Headers', 'wp-optimize'); ?></h3>
232 <div class="wpo-fieldgroup">
233 <fieldset>
234 <legend class="screen-reader-text">
235 <?php esc_html_e('Preconnect', 'wp-optimize'); ?>
236 </legend>
237 <label for="hpreconnect">
238 <span class="wpo_min-label-pad">
239 <?php esc_html_e('Use only the strictly minimum necessary domain names, (CDN or frequent embeds):', 'wp-optimize'); ?>
240 </span>
241 </label>
242 <textarea
243 name="hpreconnect"
244 rows="7"
245 cols="50"
246 id="hpreconnect"
247 class="large-text code"
248 placeholder="https://cdn.example.com"
249 disabled
250 ><?php echo esc_textarea($wpo_minify_options['hpreconnect']); ?></textarea>
251 <p>
252 <?php esc_html_e('Use the complete scheme (http:// or https://) followed by the domain name only (no file paths).', 'wp-optimize'); ?>
253 </p>
254 <p>
255 <?php esc_html_e('Examples: https://fonts.googleapis.com, https://fonts.gstatic.com', 'wp-optimize'); ?>
256 </p>
257 </fieldset>
258 </div>
259
260 <h3><?php esc_html_e('External URLs to merge', 'wp-optimize'); ?></h3>
261 <div class="wpo-fieldgroup">
262 <fieldset>
263 <label for="merge_allowed_urls">
264 <?php esc_html_e('List of external domains that can be fetched and merged:', 'wp-optimize'); ?>
265 <span tabindex="0" data-tooltip="<?php esc_attr_e('Add any external "domain" for JavaScript or CSS files that can be fetched and merged by WP-Optimize, e.g.: cdnjs.cloudflare.com', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
266 </label>
267 <textarea
268 name="merge_allowed_urls"
269 rows="7"
270 cols="50"
271 id="merge_allowed_urls"
272 class="large-text code"
273 placeholder="<?php esc_attr_e('e.g.: example.com', 'wp-optimize'); ?>"
274 ><?php echo esc_textarea($wpo_minify_options['merge_allowed_urls']); ?></textarea>
275 </fieldset>
276 </div>
277
278 <h1><?php esc_html_e('CDN Options', 'wp-optimize'); ?></h1>
279 <p class="wpo_min-bold-green">
280 <?php printf(esc_html__('When the "Enable defer on processed JavaScript files" option is enabled, JavaScript and CSS files will not be loaded from the CDN due to %scompatibility%s reasons.', 'wp-optimize'), '<a target="_blank" href="https://www.chromestatus.com/feature/5718547946799104">', '</a>'); ?>
281 <?php esc_html_e('However, you can define a CDN Domain below, in order to use it for all of the static assets "inside" your CSS and JS files.', 'wp-optimize'); ?>
282 </p>
283
284 <h3><?php esc_html_e('Your CDN domain', 'wp-optimize'); ?></h3>
285 <div class="wpo-fieldgroup">
286 <fieldset>
287 <label for="cdn_url">
288 <p>
289 <input
290 type="text"
291 name="cdn_url"
292 id="cdn_url"
293 value="<?php echo isset($wpo_minify_options['cdn_url']) ? esc_attr($wpo_minify_options['cdn_url']) : ''; ?>"
294 size="80"
295 >
296 </p>
297 <p>
298 <?php
299 $message = __('Will rewrite the static assets urls inside WP-O Minify-merged files to your CDN domain.', 'wp-optimize');
300 $message .= ' ';
301 $message .= __('Usage: cdn.example.com', 'wp-optimize');
302 echo esc_html($message);
303 ?>
304 </p>
305 </label>
306 </fieldset>
307 </div>
308
309 <h3><?php esc_html_e('Force the CDN Usage', 'wp-optimize'); ?></h3>
310 <div class="wpo-fieldgroup">
311 <p class="wpo_min-bold-green wpo_min-rowintro">
312 <?php esc_html_e('If you force this, your JS files may not load for certain slow internet users on Google Chrome.', 'wp-optimize'); ?>
313 </p>
314 <fieldset>
315 <label for="cdn_force">
316 <input
317 name="cdn_force"
318 type="checkbox"
319 id="cdn_force"
320 value="1"
321 <?php echo checked($wpo_minify_options['cdn_force']); ?>
322 >
323 <?php esc_html_e('I know what I\'m doing...', 'wp-optimize'); ?>
324 <span tabindex="0" data-tooltip="<?php esc_attr_e('Load my JS files from the CDN, even when "defer for Pagespeed Insights" is enabled', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
325 </label>
326 </fieldset>
327 </div>
328 <?php endif; ?>
329
330 <p class="submit">
331 <input
332 class="wp-optimize-save-minify-settings button button-primary"
333 type="submit"
334 value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
335 >
336 <img class="wpo_spinner" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); ?>" alt="...">
337 <span class="save-done dashicons dashicons-yes display-none"></span>
338 </p>
339 <input type="hidden" name="minify_advanced_tab" value="1">
340 </form>
341 </div>
342