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 / status-tab.php

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

232 lines 11.5 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-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 _e('How to use the minify feature', 'wp-optimize'); ?> <span class="wpo-info__close"><?php _e('Close', 'wp-optimize'); ?></span></a>
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>
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>
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>
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 wp-optimize-minify-status-information-notice wpo-show">
18 <p>
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>
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 echo WPO_MINIFY_PHP_VERSION_MET ? '' : 'disabled'; ?>
38 <?php checked($wpo_minify_options['enabled']); ?>
39 >
40 <span class="slider round"></span>
41 </label>
42 <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 }
51 ?>
52 </label>
53 </div>
54
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>
56
57 <?php if (!empty($active_minify_plugins)) : ?>
58 <div class="notice notice-error">
59 <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)); ?>
61 </p>
62 </div>
63 <?php endif; ?>
64
65 <?php if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) : ?>
66 <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>
68 </div>
69 <?php endif; ?>
70
71 <div class="wpo-minify-features">
72
73 <div class="wpo-fieldgroup__subgroup">
74 <div class="switch-container">
75 <label class="switch">
76 <input
77 name="html_minification"
78 id="wpo_min_enable_minify_html"
79 class="wpo-save-setting"
80 type="checkbox"
81 value="true"
82 <?php checked($wpo_minify_options['html_minification']);?>
83 >
84 <span class="slider round"></span>
85 </label>
86 <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>
90 </label>
91 </div>
92 </div>
93
94 <div class="wpo-fieldgroup__subgroup">
95 <div class="switch-container">
96 <label class="switch">
97 <input
98 name="enable_js"
99 id="wpo_min_enable_minify_js"
100 class="wpo-save-setting"
101 type="checkbox"
102 value="true"
103 data-tabname="js"
104 <?php checked($wpo_minify_options['enable_js']);?>
105 >
106 <span class="slider round"></span>
107 </label>
108 <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>
112 </label>
113 </div>
114 </div>
115
116 <div class="wpo-fieldgroup__subgroup">
117 <div class="switch-container">
118 <label class="switch">
119 <input
120 name="enable_css"
121 id="wpo_min_enable_minify_css"
122 class="wpo-save-setting"
123 type="checkbox"
124 value="true"
125 data-tabname="css"
126 <?php checked($wpo_minify_options['enable_css']);?>
127 >
128 <span class="slider round"></span>
129 </label>
130 <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>
134 </label>
135 </div>
136 </div>
137 </div>
138 </div>
139
140 <div class="wpo-fieldgroup">
141 <p class="actions">
142 <input
143 class="button button-primary purge_minify_cache <?php echo $can_purge_the_cache ? '' : 'disabled'; ?>"
144 type="submit"
145 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="...">
149 <span class="save-done dashicons dashicons-yes display-none"></span>
150 </p>
151 <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>
153 </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; ?>
184 <p>
185 <?php _e('Last Minify cache update:', 'wp-optimize'); ?>
186 <strong id="wpo_min_cache_time">
187 <?php
188 if (empty($wpo_minify_options['last-cache-update'])) {
189 _e('Never.', 'wp-optimize');
190 } elseif (!$wpo_minify_options['enabled']) {
191 echo '-';
192 } else {
193 echo WP_Optimize_Minify_Cache_Functions::format_date_time($wpo_minify_options['last-cache-update']);
194 }
195 ?>
196 </strong>
197 </p>
198 <?php if ($wpo_minify_options['debug']) : ?>
199 <p class="actions">
200 <input
201 class="button minify_increment_cache"
202 type="button"
203 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="...">
207 <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>
210 <?php
211 // This is only necessary if the everything isn't purged
212 if (!wp_optimize_minify_config()->always_purge_everything()) :
213 ?>
214 <p class="actions">
215 <input
216 class="button purge_all_minify_cache"
217 type="button"
218 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="...">
222 <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>
225 <?php
226 endif;
227 ?>
228 <?php endif; ?>
229 </div>
230 </form>
231 </div><!-- end #wp-optimize-minify-status -->
232