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

330 lines 13.1 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 _e('Minify cache information', 'wp-optimize'); ?></h3>
4 <div class="wpo-fieldgroup">
5 <p>
6 <?php _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 htmlspecialchars($cache_path['cachedir']);
12 ?>
13 </strong>
14 </p>
15
16 <h3><?php _e('List of processed files', 'wp-optimize'); ?></h3>
17
18 <h4><?php _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 )
33 );
34 }
35 }
36 ?>
37 <li class="no-files-yet<?php echo $processed_js ? ' hidden' : ''; ?>">
38 <span class="filename"><?php _e('There are no processed files yet.', 'wp-optimize'); ?></span>
39 </li>
40 </ul>
41 </div>
42
43 <h4><?php _e('CSS files', 'wp-optimize'); ?></h4>
44 <div id="wpo_min_cssprocessed">
45 <?php if ($wpo_minify_options['inline_css']) : ?>
46 <p><?php _e('There are no merged CSS files listed here, because you are inlining all CSS directly', 'wp-optimize'); ?></p>
47 <?php else : ?>
48 <ul class="processed">
49 <?php
50 $processed_css = 0;
51 if ($files && isset($files['css']) && is_array($files['css']) && $files['css']) {
52 $processed_css = count($files['css']);
53 foreach ($files['css'] as $css_file) {
54 WP_Optimize()->include_template(
55 'minify/cached-file.php',
56 false,
57 array(
58 'file' => $css_file
59 )
60 );
61 }
62 }
63 // No files were found
64 ?>
65 <li class="no-files-yet<?php echo $processed_css ? ' hidden' : ''; ?>">
66 <span class="filename"><?php _e('There are no processed files yet.', 'wp-optimize'); ?></span>
67 </li>
68 </ul>
69 <?php endif; ?>
70 </div>
71
72 </div>
73
74 <form method="post" action="#">
75
76 <h3><?php _e('Advanced options', 'wp-optimize'); ?></h3>
77 <div class="wpo-fieldgroup">
78 <div class="wpo-fieldgroup__subgroup">
79 <label for="wpo_min_cache_lifespan">
80 <?php _e('Cache lifespan', 'wp-optimize'); ?>
81 </label>
82 <p>
83 <input
84 name="cache_lifespan"
85 id="wpo_min_cache_lifespan"
86 class="cache_lifespan wpo-save-setting"
87 type="number"
88 min="0"
89 value="<?php echo intval($wpo_minify_options['cache_lifespan']);?>"
90 > <?php _e('days', 'wp-optimize'); ?>
91 </p>
92 <p>
93 <?php _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'); ?>
94 <br><?php _e('Enter 0 to never keep stale cache.', 'wp-optimize'); ?>
95 </p>
96 </div>
97
98 <div class="switch-container">
99 <label class="switch">
100 <input
101 name="debug"
102 id="wpo_min_enable_minify_debug"
103 class="debug wpo-save-setting"
104 type="checkbox"
105 value="true"
106 <?php checked($wpo_minify_options['debug']);?>
107 >
108 <span class="slider round"></span>
109 </label>
110 <label for="wpo_min_enable_minify_debug">
111 <?php _e('Enable debug mode', 'wp-optimize'); ?>
112 </label>
113 </div>
114 <p><?php _e('Enabling the debug mode will add various comments and show more information in the files list.', 'wp-optimize'); ?> <?php _e('It also adds extra actions in the status tab.', 'wp-optimize'); ?></p>
115 </div>
116 <h3><?php _e('Default exclusions', 'wp-optimize'); ?></h3>
117 <div class="wpo-fieldgroup">
118 <div class="switch-container">
119 <label class="switch">
120 <input
121 name="edit_default_exclutions"
122 id="wpo_min_edit_default_exclutions"
123 class="debug wpo-save-setting"
124 type="checkbox"
125 value="true"
126 <?php checked($wpo_minify_options['edit_default_exclutions']);?>
127 >
128 <span class="slider round"></span>
129 </label>
130 <label for="wpo_min_edit_default_exclutions">
131 <?php _e('Edit default exclusions', 'wp-optimize'); ?>
132 </label>
133 </div>
134 <p><?php _e('By default, WP-Optimize excludes a list of files that are known to cause problems when minified or combined.'); ?>
135 <?php _e('Enable this option to see or edit those files.'); ?></p>
136 <div class="wpo-minify-default-exclusions<?php echo $wpo_minify_options['edit_default_exclutions'] ? '' : ' hidden'; ?>">
137 <h3><?php _e('Known incompatible files', 'wp-optimize'); ?></h3>
138 <fieldset>
139 <label for="ignore_list">
140 <?php _e('List of files that can\'t or shouldn\'t be minified or merged.', 'wp-optimize'); ?>
141 <?php _e('Do not edit this if you are not sure what it is.', 'wp-optimize'); ?>
142 <br><?php _e('Tick the checkbox to merge / minify the corresponding file anyways.', 'wp-optimize'); ?>
143 <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>
144 </label>
145 <?php
146 $user_excluded_ignorelist_items = is_array($wpo_minify_options['ignore_list']) ? $wpo_minify_options['ignore_list'] : array();
147 if (empty($default_ignore)) {
148 echo '<p>'.__('Refresh the page to see the list', 'wp-optimize').'</p>';
149 } else {
150 foreach ($default_ignore as $ignore_item) {
151 ?>
152 <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 $ignore_item; ?></span></label>
153 <?php
154 }
155 }
156 ?>
157 </fieldset>
158
159 <h3><?php _e('IE incompatible files', 'wp-optimize'); ?></h3>
160 <fieldset>
161 <label for="blacklist">
162 <?php _e('List of excluded files used for IE compatibility.', 'wp-optimize'); ?>
163 <?php _e('Do not edit this if you are not sure what it is.', 'wp-optimize'); ?>
164 <br><?php _e('Tick the checkbox to merge / minify the corresponding file anyways.', 'wp-optimize'); ?>
165 </label>
166 <?php
167 $user_excluded_blacklist_items = is_array($wpo_minify_options['blacklist']) ? $wpo_minify_options['blacklist'] : array();
168 if (empty($default_ie_blacklist)) {
169 echo '<p>'.__('Refresh the page to see the list', 'wp-optimize').'</p>';
170 } else {
171 foreach ($default_ie_blacklist as $blacklist_item) {
172 ?>
173 <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 $blacklist_item; ?></span></label>
174 <?php
175 }
176 }
177 ?>
178 </fieldset>
179 </div>
180 </div>
181
182 <?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
183 <div class="wpo-fieldgroup">
184 <fieldset>
185 <br />
186 <label for="enabled_css_preload">
187 <input
188 name="enabled_css_preload"
189 type="checkbox"
190 id="enabled_css_preload"
191 value="1"
192 <?php echo checked($wpo_minify_options['enabled_css_preload']); ?>
193 >
194 <?php _e('Enable WP-O Minify CSS files preloading', 'wp-optimize'); ?>
195 <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>
196 </label>
197 <br />
198 <label for="enabled_js_preload">
199 <input
200 name="enabled_js_preload"
201 type="checkbox"
202 id="enabled_js_preload"
203 value="1"
204 <?php echo checked($wpo_minify_options['enabled_js_preload']); ?>
205 >
206 <?php _e('Enable WP-O Minify JavaScript files Preload', 'wp-optimize'); ?>
207 <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>
208 </label>
209 </fieldset>
210 </div>
211 <h3 class="title">
212 <?php _e('HTTP Headers', 'wp-optimize'); ?>
213 </h3>
214 <p class="wpo_min-bold-green">
215 <?php _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'); ?>
216 </p>
217 <p class="wpo_min-bold-green">
218 <?php _e('Preload Headers: Use this for preloading specific, high priority resources that exist across all of your pages.', 'wp-optimize'); ?>
219 </p>
220 <p class="wpo_min-bold-green">
221 <?php _e('Note: Some servers do not support http push or headers. 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'); ?>
222 </p>
223
224 <h3><?php _e('Preconnect Headers', 'wp-optimize'); ?></h3>
225 <div class="wpo-fieldgroup">
226 <fieldset>
227 <legend class="screen-reader-text">
228 <?php _e('Preconnect', 'wp-optimize'); ?>
229 </legend>
230 <label for="hpreconnect">
231 <span class="wpo_min-label-pad">
232 <?php _e('Use only the strictly minimum necessary domain names, (CDN or frequent embeds):', 'wp-optimize'); ?>
233 </span>
234 </label>
235 <textarea
236 name="hpreconnect"
237 rows="7"
238 cols="50"
239 id="hpreconnect"
240 class="large-text code"
241 placeholder="https://cdn.example.com"
242 disabled
243 ><?php echo esc_textarea($wpo_minify_options['hpreconnect']); ?></textarea>
244 <p>
245 <?php _e('Use the complete scheme (http:// or https://) followed by the domain name only (no file paths).', 'wp-optimize'); ?>
246 </p>
247 <p>
248 <?php _e('Examples: https://fonts.googleapis.com, https://fonts.gstatic.com', 'wp-optimize'); ?>
249 </p>
250 </fieldset>
251 </div>
252
253 <h3><?php _e('External URLs to merge', 'wp-optimize'); ?></h3>
254 <div class="wpo-fieldgroup">
255 <fieldset>
256 <label for="merge_allowed_urls">
257 <?php _e('List of external domains that can be fetched and merged:', 'wp-optimize'); ?>
258 <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>
259 </label>
260 <textarea
261 name="merge_allowed_urls"
262 rows="7"
263 cols="50"
264 id="merge_allowed_urls"
265 class="large-text code"
266 placeholder="<?php esc_attr_e('e.g.: example.com', 'wp-optimize'); ?>"
267 ><?php echo esc_textarea($wpo_minify_options['merge_allowed_urls']); ?></textarea>
268 </fieldset>
269 </div>
270
271 <h1><?php _e('CDN Options', 'wp-optimize'); ?></h1>
272 <p class="wpo_min-bold-green">
273 <?php printf(__('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>'); ?>
274 <?php _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'); ?>
275 </p>
276
277 <h3><?php _e('Your CDN domain', 'wp-optimize'); ?></h3>
278 <div class="wpo-fieldgroup">
279 <fieldset>
280 <label for="cdn_url">
281 <p>
282 <input
283 type="text"
284 name="cdn_url"
285 id="cdn_url"
286 value="<?php echo isset($wpo_minify_options['cdn_url']) ? esc_attr($wpo_minify_options['cdn_url']) : ''; ?>"
287 size="80"
288 />
289 </p>
290 <p>
291 <?php _e('Will rewrite the static assets urls inside WP-O Minify-merged files to your CDN domain. Usage: cdn.example.com', 'wp-optimize'); ?>
292 </p>
293 </label>
294 </fieldset>
295 </div>
296
297 <h3><?php _e('Force the CDN Usage', 'wp-optimize'); ?></h3>
298 <div class="wpo-fieldgroup">
299 <p class="wpo_min-bold-green wpo_min-rowintro">
300 <?php _e('If you force this, your JS files may not load for certain slow internet users on Google Chrome.', 'wp-optimize'); ?>
301 </p>
302 <fieldset>
303 <label for="cdn_force">
304 <input
305 name="cdn_force"
306 type="checkbox"
307 id="cdn_force"
308 value="1"
309 <?php echo checked($wpo_minify_options['cdn_force']); ?>
310 >
311 <?php _e('I know what I\'m doing...', 'wp-optimize'); ?>
312 <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>
313 </label>
314 </fieldset>
315 </div>
316 <?php endif; ?>
317
318 <p class="submit">
319 <input
320 class="wp-optimize-save-minify-settings button button-primary"
321 type="submit"
322 value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
323 >
324 <img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
325 <span class="save-done dashicons dashicons-yes display-none"></span>
326 </p>
327 <input type="hidden" name="minify_advanced_tab" value="1">
328 </form>
329 </div>
330