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/status-tab.php +93 -84 3.2.5 → 4.7.0 View file →
@@ -1,28 +1,28 @@
1 -<?php if (!defined('WPO_VERSION')) die('No direct access allowed'); ?>
1 +<?php if (!defined('ABSPATH')) die('No direct access allowed'); ?>
2 2 <div id="wp-optimize-minify-status" class="wpo_section wpo_group<?php echo (!$wpo_minify_options['enabled']) ? ' wpo-feature-is-disabled' : ''; ?>">
3 3 <form>
4 4 <div class="wpo-info wpo-show">
5 - <a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php _e('How to use the minify feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php _e('Close', 'wp-optimize'); ?></span></a>
5 + <a class="wpo-info__trigger" href="#"><span class="dashicons dashicons-sos"></span> <?php esc_html_e('How to use the minify feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php esc_html_e('Close', 'wp-optimize'); ?></span></a>
6 6 <div class="wpo-info__content">
7 - <p><strong><?php _e('Not sure how to use the Minify feature?', 'wp-optimize'); ?></strong> <br><?php _e('Watch our how-to video below.', 'wp-optimize'); ?></p>
7 + <p><strong><?php esc_html_e('Not sure how to use the Minify feature?', 'wp-optimize'); ?></strong> <br><?php esc_html_e('Watch our how to video below.', 'wp-optimize'); ?></p>
8 8 <div class="wpo-video-preview">
9 - <a href="https://vimeo.com/402556749" data-embed="https://player.vimeo.com/video/402556749?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo trailingslashit(WPO_PLUGIN_URL); ?>images/notices/minify-video-preview.png" alt="<?php _e('Minify video preview', 'wp-optimize');?>" /></a>
9 + <a href="https://vimeo.com/1015123805" data-embed="https://player.vimeo.com/video/1015123805?color=df6926&title=0&byline=0&portrait=0" target="_blank"><img src="<?php echo esc_url(trailingslashit(WPO_PLUGIN_URL) . 'images/notices/video-thumb.jpg'); ?>" alt="<?php esc_attr_e('Minify video preview', 'wp-optimize');?>"></a>
10 10 </div>
11 - <small>(<?php _e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <a href="https://vimeo.com/402556749" target="_blank"><?php _e('Open the video in a new window', 'wp-optimize'); ?></a></small>
12 - <p><a href="<?php echo WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/faqs/category/minification/'); ?>"><?php _e('Read the documentation', 'wp-optimize'); ?></a></p>
11 + <small>(<?php esc_html_e('Loads a video hosted on vimeo.com', 'wp-optimize'); ?>) - <?php $wp_optimize->wp_optimize_url('https://vimeo.com/1015123805', __('Open the video in a new window', 'wp-optimize')); ?></small>
12 + <p><a target="_blank" href="<?php echo esc_url(WP_Optimize()->maybe_add_affiliate_params('https://teamupdraft.com/documentation/wp-optimize/topics/minification/faqs/?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=read-the-documentation-minification&utm_creative_format=text')); ?>"><?php esc_html_e('Read the documentation', 'wp-optimize'); ?></a></p>
13 13 </div>
14 14 </div>
15 15 <div id="wpo_settings_warnings"></div>
16 16 <?php if ($show_information_notice) : ?>
17 - <div class="notice notice-warning wpo-warning is-dismissible below-h2 wp-optimize-minify-status-information-notice wpo-show">
17 + <div class="notice notice-warning wpo-warning is-dismissible below-h2 wpo_section_notice_minify wpo-show">
18 18 <p>
19 19 <span class="dashicons dashicons-shield"></span>
20 - <strong><?php _e('CSS, JavaScript and HTML minification is an advanced feature.', 'wp-optimize'); ?></strong><br>
21 - <?php _ex('While enabling it will work just fine for most sites, it might need specific configuration to work properly on your website.', '"it" refers to the Minify feature.', 'wp-optimize'); ?><br>
22 - <?php _ex('If you encounter an issue and are not sure what to do, disable the feature and ask for help on the support forum.', '"it" refers to the Minify feature.', 'wp-optimize'); ?>
23 - <?php _ex('We will do our best to help you configure it.', '"it" refers to the Minify feature.', 'wp-optimize'); ?>
24 - <a href="<?php echo WP_Optimize()->maybe_add_affiliate_params('https://getwpo.com/faqs/category/minification/'); ?>"><?php _e('Read the documentation', 'wp-optimize'); ?></a>
20 + <strong><?php esc_html_e('CSS, JavaScript and HTML minification is an advanced feature.', 'wp-optimize'); ?></strong><br>
21 + <?php echo esc_html_x('While enabling it will work just fine for most sites, it might need specific configuration to work properly on your website.', '"it" refers to the Minify feature.', 'wp-optimize'); ?><br>
22 + <?php echo esc_html_x('If you encounter an issue and are not sure what to do, disable the feature and ask for help on the support forum.', '"it" refers to the Minify feature.', 'wp-optimize'); ?>
23 + <?php echo esc_html_x('We will do our best to help you configure it.', '"it" refers to the Minify feature.', 'wp-optimize'); ?>
24 + <a target="_blank" href="<?php echo esc_url(WP_Optimize()->maybe_add_affiliate_params('https://teamupdraft.com/documentation/wp-optimize/topics/minification/faqs/?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=read-the-documentation-minification&utm_creative_format=notice')); ?>"><?php esc_html_e('Read the documentation', 'wp-optimize'); ?></a>
25 25 </p>
26 26 </div>
27 27 <?php endif; ?>
28 28 <div class="wpo-fieldgroup wpo-show">
@@ -33,32 +33,31 @@
33 33 id="wpo_min_enable_minify"
34 34 class="wpo-save-setting"
35 35 type="checkbox"
36 36 value="true"
37 - <?php echo WPO_MINIFY_PHP_VERSION_MET ? '' : 'disabled'; ?>
38 37 <?php checked($wpo_minify_options['enabled']); ?>
39 38 >
40 39 <span class="slider round"></span>
41 40 </label>
42 41 <label for="wpo_min_enable_minify">
43 - <?php if (WPO_MINIFY_PHP_VERSION_MET) {
44 - _e('Enable Minify', 'wp-optimize');
45 - } else {
46 - echo __('The PHP version on your server is too old.', 'wp-optimize').' '.__('Update PHP to enable minification of JS, CSS and HTML on this website', 'wp-optimize');
47 - ?>
48 - <span tabindex="0" data-tooltip="<?php esc_attr_e('PHP version requirement (5.4 minimum) not met', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
49 - <?php
50 - }
42 + <?php
43 + esc_html_e('Enable Minify', 'wp-optimize');
51 44 ?>
52 45 </label>
53 46 </div>
54 47
55 - <p><?php _e('If this is turned on, then the default settings are that JavaScript and CSS on this website will be concatenated and minified and HTML will be minified.', 'wp-optimize'); ?> <?php _e('You can adjust the settings in the tabs above to control this to meet your requirements.', 'wp-optimize'); ?></p>
48 + <p><?php esc_html_e('If this is turned on, then the default settings are that JavaScript and CSS on this website will be concatenated and minified and HTML will be minified.', 'wp-optimize'); ?> <?php esc_html_e('You can adjust the settings in the tabs above to control this to meet your requirements.', 'wp-optimize'); ?></p>
56 49
57 50 <?php if (!empty($active_minify_plugins)) : ?>
58 51 <div class="notice notice-error">
59 52 <p>
60 - <?php printf(__('It looks like you already have an active minify plugin (%s) installed. Having more than one active plugin to minify front end assets might cause unexpected results and waste of resources.', 'wp-optimize'), implode(', ', $active_minify_plugins)); ?>
53 + <?php
54 + // translators: %s - list of active minify plugins
55 + $message = sprintf(esc_html__('It looks like you already have an active minify plugin (%s) installed.', 'wp-optimize'), implode(', ', $active_minify_plugins));
56 + $message .= ' ';
57 + $message .= esc_html__('Having more than one active plugin to minify front end assets might cause unexpected results and waste of resources.', 'wp-optimize');
58 + echo $message; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output already escaped
59 + ?>
61 60 </p>
62 61 </div>
63 62 <?php endif; ?>
64 63
@@ -63,9 +62,16 @@
63 62 <?php endif; ?>
64 63
65 64 <?php if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) : ?>
66 65 <div class="notice notice-warning">
67 - <p><span class="dashicons dashicons-info"></span> <?php printf(__('The constant %s is set to true, so no JavaScript or CSS file will be minified.', 'wp-optimize'), '<code>SCRIPT_DEBUG</code>'); ?></p>
66 + <p>
67 + <span class="dashicons dashicons-info"></span>
68 + <?php
69 + echo ' ';
70 + // translators: %s is the constant name SCRIPT_DEBUG
71 + printf(esc_html__('The constant %s is set to true, so no JavaScript or CSS file will be minified.', 'wp-optimize'), '<code>SCRIPT_DEBUG</code>');
72 + ?>
73 + </p>
68 74 </div>
69 75 <?php endif; ?>
70 76
71 77 <div class="wpo-minify-features">
@@ -83,12 +89,17 @@
83 89 >
84 90 <span class="slider round"></span>
85 91 </label>
86 92 <label for="wpo_min_enable_minify_html">
87 - <?php _e('Process HTML (works only when cache pre-loading)', 'wp-optimize'); ?>
88 - <?php // Note: the comment added by WPO regarding cacheing will not be removed (it's added later in the process) ?>
89 - <span tabindex="0" data-tooltip="<?php esc_attr_e('All HTML will be minified. It takes effect only when cache pre-loading because it takes time.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
93 + <?php esc_html_e('Process HTML (works only when cache pre-loading)', 'wp-optimize'); ?>
94 + <?php // Note: the comment added by WPO regarding caching will not be removed (it's added later in the process) ?>
95 + <?php
96 + $message = __('All HTML will be minified.', 'wp-optimize');
97 + $message .= ' ';
98 + $message .= __('It takes effect only when cache pre-loading because it takes time.', 'wp-optimize');
99 + ?>
90 100 </label>
101 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr($message);?>"><span class="dashicons dashicons-editor-help"></span> </span>
91 102 </div>
92 103 </div>
93 104
94 105 <div class="wpo-fieldgroup__subgroup">
@@ -105,12 +116,12 @@
105 116 >
106 117 <span class="slider round"></span>
107 118 </label>
108 119 <label for="wpo_min_enable_minify_js">
109 - <?php _e('Process JavaScript files', 'wp-optimize'); ?>
110 - <span tabindex="0" data-tooltip="<?php esc_attr_e('The JavaScript files will be combined and minified to lower the number and size of requests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
111 - <a href="#" class="js--wpo-goto" data-tab="js"><?php _e('Settings', 'wp-optimize'); ?></a>
120 + <?php esc_html_e('Process JavaScript files', 'wp-optimize'); ?>
112 121 </label>
122 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('The JavaScript files will be combined and minified to lower the number and size of requests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
123 + <a href="#" class="js--wpo-goto" data-tab="js"><?php esc_html_e('Settings', 'wp-optimize'); ?></a>
113 124 </div>
114 125 </div>
115 126
116 127 <div class="wpo-fieldgroup__subgroup">
@@ -127,12 +138,12 @@
127 138 >
128 139 <span class="slider round"></span>
129 140 </label>
130 141 <label for="wpo_min_enable_minify_css">
131 - <?php _e('Process CSS files', 'wp-optimize'); ?>
132 - <span tabindex="0" data-tooltip="<?php esc_attr_e('The stylesheets will be combined and minified to lower the number and size of requests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
133 - <a href="#" class="js--wpo-goto" data-tab="css"><?php _e('Settings', 'wp-optimize'); ?></a>
142 + <?php esc_html_e('Process CSS files', 'wp-optimize'); ?>
134 143 </label>
144 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('The stylesheets will be combined and minified to lower the number and size of requests.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
145 + <a href="#" class="js--wpo-goto" data-tab="css"><?php esc_html_e('Settings', 'wp-optimize'); ?></a>
135 146 </div>
136 147 </div>
137 148 </div>
138 149 </div>
@@ -137,92 +148,90 @@
137 148 </div>
138 149 </div>
139 150
140 151 <div class="wpo-fieldgroup">
141 - <p class="actions">
152 + <div class="wpo-save-btn-container actions">
142 153 <input
143 154 class="button button-primary purge_minify_cache <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>"
144 155 type="submit"
145 156 value="<?php wp_optimize_minify_config()->always_purge_everything() ? esc_attr_e('Purge the minified files', 'wp-optimize') : esc_attr_e('Reset the minified files', 'wp-optimize'); ?>"
146 - <?php echo WPO_MINIFY_PHP_VERSION_MET && $can_purge_the_cache ? '' : 'disabled'; ?>
147 - />
148 - <img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
157 + <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>
158 + >
159 + <img class="wpo_spinner" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="...">
149 160 <span class="save-done dashicons dashicons-yes display-none"></span>
150 - </p>
161 + </div>
151 162 <p>
152 - <span><?php _e("The new minified files will be regenerated when visiting your website's pages.", 'wp-optimize'); ?> <a href="https://getwpo.com/faqs/what-does-reset-the-minified-files-actually-do/"><?php _e('Read more about what this does in our FAQs.', 'wp-optimize'); ?></a> (<?php _e('This will also purge the page cache', 'wp-optimize'); ?>)</span>
163 + <span><?php esc_html_e("The new minified files will be regenerated when visiting your website's pages.", "wp-optimize"); ?> <?php $wp_optimize->wp_optimize_url('https://teamupdraft.com/documentation/wp-optimize/topics/minification/faqs/what-does-reset-the-minified-files-do/?utm_source=wpo-plugin&utm_medium=referral&utm_campaign=paac&utm_content=what-does-purge-the-minified-files-do&utm_creative_format=text', __('Read more about what this does in our FAQs.', 'wp-optimize')); ?> (<?php esc_html_e('This will also purge the page cache', 'wp-optimize'); ?>)</span>
153 164 </p>
154 - <?php if (WPO_MINIFY_PHP_VERSION_MET) : ?>
155 - <?php _e('Minify cache size:', 'wp-optimize'); ?>
156 - <ul class="ul-disc">
157 - <li><?php _e('Current cache:', 'wp-optimize'); ?>
158 - <strong id="wpo_min_cache_size">
159 - <?php
160 - if ($wpo_minify_options['enabled']) {
161 - echo esc_html(WP_Optimize_Minify_Cache_Functions::get_cachestats($cache_dir));
162 - } else {
163 - _e('No minified files are present', 'wp-optimize');
164 - }
165 - ?>
166 - </strong>
167 - <a href="#" class="js--wpo-goto" data-tab="advanced"><?php _e('View the files', 'wp-optimize'); ?></a>
168 - </li>
169 - <li>
170 - <?php _e('Total cache:', 'wp-optimize'); ?>
171 - <strong id="wpo_min_cache_total_size">
172 - <?php
173 - if ($wpo_minify_options['enabled']) {
174 - echo esc_html(WP_Optimize_Minify_Cache_Functions::get_cachestats(WPO_CACHE_MIN_FILES_DIR));
175 - } else {
176 - _e('No minified files are present', 'wp-optimize');
177 - }
178 - ?>
179 - </strong>
180 - <strong tabindex="0" data-tooltip="<?php _e('This includes the older, non-expired cache, as well as the temporary files used to generate the minified files.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></strong>
181 - </li>
182 - </ul>
183 - <?php endif; ?>
165 +
166 + <?php esc_html_e('Minify cache size:', 'wp-optimize'); ?>
167 + <ul class="ul-disc wpo-minify-cache-size">
168 + <li><?php esc_html_e('Current cache:', 'wp-optimize'); ?>
169 + <strong id="wpo_min_cache_size">
170 + <?php
171 + if ($wpo_minify_options['enabled']) {
172 + echo esc_html(WP_Optimize_Minify_Cache_Functions::get_cachestats($cache_dir));
173 + } else {
174 + esc_html_e('No minified files are present', 'wp-optimize');
175 + }
176 + ?>
177 + </strong>
178 + <a href="#" class="js--wpo-goto" data-tab="advanced"><?php esc_html_e('View the files', 'wp-optimize'); ?></a>
179 + </li>
180 + <li>
181 + <?php esc_html_e('Total cache:', 'wp-optimize'); ?>
182 + <strong id="wpo_min_cache_total_size">
183 + <?php
184 + if ($wpo_minify_options['enabled']) {
185 + echo esc_html(WP_Optimize_Minify_Cache_Functions::get_cachestats(WPO_CACHE_MIN_FILES_DIR));
186 + } else {
187 + esc_html_e('No minified files are present', 'wp-optimize');
188 + }
189 + ?>
190 + </strong>
191 + <strong tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('This includes the older, non-expired cache, as well as the temporary files used to generate the minified files.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></strong>
192 + <a href="#" class="wpo-minify-download-metas-button"><?php esc_html_e('Download debug log', 'wp-optimize'); ?></a>
193 + </li>
194 + </ul>
184 195 <p>
185 - <?php _e('Last Minify cache update:', 'wp-optimize'); ?>
196 + <?php esc_html_e('Last Minify cache update:', 'wp-optimize'); ?>
186 197 <strong id="wpo_min_cache_time">
187 198 <?php
188 199 if (empty($wpo_minify_options['last-cache-update'])) {
189 - _e('Never.', 'wp-optimize');
200 + esc_html_e('Never.', 'wp-optimize');
190 201 } elseif (!$wpo_minify_options['enabled']) {
191 202 echo '-';
192 203 } else {
193 - echo WP_Optimize_Minify_Cache_Functions::format_date_time($wpo_minify_options['last-cache-update']);
204 + echo esc_html(WP_Optimize_Minify_Cache_Functions::format_date_time($wpo_minify_options['last-cache-update']));
194 205 }
195 206 ?>
196 207 </strong>
197 208 </p>
198 209 <?php if ($wpo_minify_options['debug']) : ?>
199 - <p class="actions">
210 + <div class="wpo-save-btn-container actions">
200 211 <input
201 212 class="button minify_increment_cache"
202 213 type="button"
203 214 value="<?php esc_attr_e('Increment cache', 'wp-optimize'); ?>"
204 - <?php echo WPO_MINIFY_PHP_VERSION_MET ? '' : 'disabled'; ?>
205 - />
206 - <img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
215 + >
216 + <img class="wpo_spinner" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="...">
207 217 <span class="save-done dashicons dashicons-yes display-none"></span>
208 - <strong tabindex="0" data-tooltip="<?php _e('This will reset the files generated by minify, but use the existing minify temporary files.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></strong>
209 - </p>
218 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('This will reset the files generated by minify, but use the existing minify temporary files.', 'wp-optimize');?>" style="display: inline-block;"><span class="dashicons dashicons-editor-help"></span></span>
219 + </div>
210 220 <?php
211 221 // This is only necessary if the everything isn't purged
212 222 if (!wp_optimize_minify_config()->always_purge_everything()) :
213 223 ?>
214 - <p class="actions">
224 + <div class="wpo-save-btn-container actions">
215 225 <input
216 226 class="button purge_all_minify_cache"
217 227 type="button"
218 228 value="<?php esc_attr_e('Delete all the files generated by minifcation', 'wp-optimize'); ?>"
219 - <?php echo WPO_MINIFY_PHP_VERSION_MET ? '' : 'disabled'; ?>
220 - />
221 - <img class="wpo_spinner" src="<?php echo esc_attr(admin_url('images/spinner-2x.gif')); ?>" alt="...">
229 + >
230 + <img class="wpo_spinner" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="...">
222 231 <span class="save-done dashicons dashicons-yes display-none"></span>
223 - <strong tabindex="0" data-tooltip="<?php _e('If you are using an unsupported cache plugin, then you will also need to purge your page cache when doing this.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></strong>
224 - </p>
232 + <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php esc_attr_e('If you are using an unsupported cache plugin, then you will also need to purge your page cache when doing this.', 'wp-optimize');?>" style="display: inline-block;"><span class="dashicons dashicons-editor-help"></span></span>
233 + </div>
225 234 <?php
226 235 endif;
227 236 ?>
228 237 <?php endif; ?>