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
wp-optimize / templates / minify / status-tab.php

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

241 lines 12.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined('ABSPATH')) die('No direct access allowed'); ?>
2 <div id="wp-optimize-minify-status" class="wpo_section wpo_group<?php echo (!$wpo_minify_options['enabled']) ? ' wpo-feature-is-disabled' : ''; ?>">
3 <form>
4 <div class="wpo-info wpo-show">
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 <div class="wpo-info__content">
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 <div class="wpo-video-preview">
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 </div>
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 </div>
14 </div>
15 <div id="wpo_settings_warnings"></div>
16 <?php if ($show_information_notice) : ?>
17 <div class="notice notice-warning wpo-warning is-dismissible below-h2 wpo_section_notice_minify wpo-show">
18 <p>
19 <span class="dashicons dashicons-shield"></span>
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 </p>
26 </div>
27 <?php endif; ?>
28 <div class="wpo-fieldgroup wpo-show">
29 <div class="switch-container">
30 <label class="switch">
31 <input
32 name="enabled"
33 id="wpo_min_enable_minify"
34 class="wpo-save-setting"
35 type="checkbox"
36 value="true"
37 <?php checked($wpo_minify_options['enabled']); ?>
38 >
39 <span class="slider round"></span>
40 </label>
41 <label for="wpo_min_enable_minify">
42 <?php
43 esc_html_e('Enable Minify', 'wp-optimize');
44 ?>
45 </label>
46 </div>
47
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>
49
50 <?php if (!empty($active_minify_plugins)) : ?>
51 <div class="notice notice-error">
52 <p>
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 ?>
60 </p>
61 </div>
62 <?php endif; ?>
63
64 <?php if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) : ?>
65 <div class="notice notice-warning">
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>
74 </div>
75 <?php endif; ?>
76
77 <div class="wpo-minify-features">
78
79 <div class="wpo-fieldgroup__subgroup">
80 <div class="switch-container">
81 <label class="switch">
82 <input
83 name="html_minification"
84 id="wpo_min_enable_minify_html"
85 class="wpo-save-setting"
86 type="checkbox"
87 value="true"
88 <?php checked($wpo_minify_options['html_minification']);?>
89 >
90 <span class="slider round"></span>
91 </label>
92 <label for="wpo_min_enable_minify_html">
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 ?>
100 </label>
101 <span tabindex="0" class="wpo-tooltip" data-tooltip="<?php echo esc_attr($message);?>"><span class="dashicons dashicons-editor-help"></span> </span>
102 </div>
103 </div>
104
105 <div class="wpo-fieldgroup__subgroup">
106 <div class="switch-container">
107 <label class="switch">
108 <input
109 name="enable_js"
110 id="wpo_min_enable_minify_js"
111 class="wpo-save-setting"
112 type="checkbox"
113 value="true"
114 data-tabname="js"
115 <?php checked($wpo_minify_options['enable_js']);?>
116 >
117 <span class="slider round"></span>
118 </label>
119 <label for="wpo_min_enable_minify_js">
120 <?php esc_html_e('Process JavaScript files', 'wp-optimize'); ?>
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>
124 </div>
125 </div>
126
127 <div class="wpo-fieldgroup__subgroup">
128 <div class="switch-container">
129 <label class="switch">
130 <input
131 name="enable_css"
132 id="wpo_min_enable_minify_css"
133 class="wpo-save-setting"
134 type="checkbox"
135 value="true"
136 data-tabname="css"
137 <?php checked($wpo_minify_options['enable_css']);?>
138 >
139 <span class="slider round"></span>
140 </label>
141 <label for="wpo_min_enable_minify_css">
142 <?php esc_html_e('Process CSS files', 'wp-optimize'); ?>
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>
146 </div>
147 </div>
148 </div>
149 </div>
150
151 <div class="wpo-fieldgroup">
152 <div class="wpo-save-btn-container actions">
153 <input
154 class="button button-primary purge_minify_cache <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>"
155 type="submit"
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'); ?>"
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="...">
160 <span class="save-done dashicons dashicons-yes display-none"></span>
161 </div>
162 <p>
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>
164 </p>
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>
195 <p>
196 <?php esc_html_e('Last Minify cache update:', 'wp-optimize'); ?>
197 <strong id="wpo_min_cache_time">
198 <?php
199 if (empty($wpo_minify_options['last-cache-update'])) {
200 esc_html_e('Never.', 'wp-optimize');
201 } elseif (!$wpo_minify_options['enabled']) {
202 echo '-';
203 } else {
204 echo esc_html(WP_Optimize_Minify_Cache_Functions::format_date_time($wpo_minify_options['last-cache-update']));
205 }
206 ?>
207 </strong>
208 </p>
209 <?php if ($wpo_minify_options['debug']) : ?>
210 <div class="wpo-save-btn-container actions">
211 <input
212 class="button minify_increment_cache"
213 type="button"
214 value="<?php esc_attr_e('Increment cache', 'wp-optimize'); ?>"
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="...">
217 <span class="save-done dashicons dashicons-yes display-none"></span>
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>
220 <?php
221 // This is only necessary if the everything isn't purged
222 if (!wp_optimize_minify_config()->always_purge_everything()) :
223 ?>
224 <div class="wpo-save-btn-container actions">
225 <input
226 class="button purge_all_minify_cache"
227 type="button"
228 value="<?php esc_attr_e('Delete all the files generated by minifcation', 'wp-optimize'); ?>"
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="...">
231 <span class="save-done dashicons dashicons-yes display-none"></span>
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>
234 <?php
235 endif;
236 ?>
237 <?php endif; ?>
238 </div>
239 </form>
240 </div><!-- end #wp-optimize-minify-status -->
241