PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.5.3
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.5.3
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 / css-settings-tab.php

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

212 lines 9.7 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='wpo_section_css' class="wpo_section wpo_group">
3 <div id="wpo_settings_warnings"></div>
4 <div class="notice notice-warning wpo-warning is-dismissible wpo_section_notice_css" style="<?php echo $show_section_notice ? '' : 'display:none;'; ?>">
5 <p>
6 <span class="dashicons dashicons-shield"></span>
7 <strong><?php esc_html_e('Enable merging of CSS files into one to reduce HTTP requests.', 'wp-optimize'); ?></strong><br>
8 <?php echo wp_kses_post($notice_text);?>
9 </p>
10 </div>
11 <form>
12 <h3><?php esc_html_e('CSS options', 'wp-optimize'); ?></h3>
13 <div class="wpo-fieldgroup">
14 <fieldset>
15 <div class="wpo-fieldgroup__subgroup">
16 <label for="enable_css_minification">
17 <input
18 name="enable_css_minification"
19 type="checkbox"
20 id="enable_css_minification"
21 value="1"
22 <?php echo checked($wpo_minify_options['enable_css_minification']); ?>
23 >
24 <?php esc_html_e('Enable minification of CSS files', 'wp-optimize'); ?>
25 </label>
26 </div>
27 <div id="enable_unused_css_removal_wrapper" class="wpo-fieldgroup__subgroup" style="<?php echo $show_unused_css ? ' display:block;' : ' display:none'; ?>">
28 <label for="enable_unused_css" style="<?php echo 'margin-left: 20px;'; ?>">
29 <input
30 name="enable_unused_css"
31 type="checkbox"
32 id="enable_unused_css"
33 value="1"
34 <?php checked($wpo_minify_options['enable_unused_css']); ?>
35 >
36 <?php esc_html_e('Enable removal of unused rules from CSS files (Experimental)', 'wp-optimize'); ?>
37 </label>
38 <span tabindex="0" data-tooltip="<?php esc_attr_e('If some of the design is breaking on the frontend, disabling removal of unused CSS rules might fix the issues.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
39 </div>
40 <div class="wpo-fieldgroup__subgroup">
41 <label for="enable_merging_of_css">
42 <input
43 name="enable_merging_of_css"
44 type="checkbox"
45 id="enable_merging_of_css"
46 value="1"
47 <?php echo checked($wpo_minify_options['enable_merging_of_css']); ?>
48 >
49 <?php esc_html_e('Enable merging of CSS files', 'wp-optimize'); ?>
50 </label>
51 <span tabindex="0" data-tooltip="<?php echo esc_attr($tooltip); ?>"><span class="dashicons dashicons-editor-help"></span> </span>
52 </div>
53 <div class="wpo-fieldgroup__subgroup">
54 <label for="inline_css" class="label-with-tooltip">
55 <input
56 name="inline_css"
57 type="checkbox"
58 id="inline_css"
59 value="1"
60 <?php echo checked($wpo_minify_options['inline_css']); ?>
61 >
62 <?php esc_html_e('Inline CSS', 'wp-optimize'); ?> - <?php esc_html_e('Recommended if the CSS files are small enough.', 'wp-optimize'); ?>
63 </label>
64 <span tabindex="0" data-tooltip="<?php esc_attr_e('When enabled, small CSS files will be inlined.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
65 </div>
66 <div class="wpo-fieldgroup__subgroup">
67 <label for="remove_print_mediatypes" class="label-with-tooltip">
68 <input
69 name="remove_print_mediatypes"
70 type="checkbox"
71 id="remove_print_mediatypes"
72 value="1"
73 <?php echo checked($wpo_minify_options['remove_print_mediatypes']); ?>
74 >
75 <?php esc_html_e('Strip the "print" related stylesheets', 'wp-optimize'); ?>
76 </label>
77 <span tabindex="0" data-tooltip='<?php esc_attr_e('When selected, any CSS files with the media type "print" will be removed.', 'wp-optimize');?> <?php esc_html_e('Enable if your site does not need specific print styles.', 'wp-optimize');?>'><span class="dashicons dashicons-editor-help"></span> </span>
78 </div>
79 <?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
80 <div class="wpo-fieldgroup__subgroup">
81 <label for="remove_css">
82 <input
83 name="remove_css"
84 type="checkbox"
85 id="remove_css"
86 value="1"
87 <?php echo checked($wpo_minify_options['remove_css']); ?>
88 >
89 <?php esc_html_e('Dequeue all CSS files', 'wp-optimize'); ?>
90 </label>
91 <span tabindex="0" data-tooltip="<?php esc_attr_e('This is useful if you want to test your critical path CSS', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
92 </div>
93 <?php endif; ?>
94 </fieldset>
95 </div>
96
97 <h3><?php esc_html_e('Exclude the following CSS files from processing', 'wp-optimize'); ?></h3>
98 <div class="wpo-fieldgroup">
99 <fieldset>
100 <label class="wpo-label__bold" for="exclude_css">
101 <?php esc_html_e('Any CSS files that match the paths below will be completely ignored.', 'wp-optimize'); ?>
102 <br><?php esc_html_e('Use this if you are having issues with a specific CSS file', 'wp-optimize'); ?>
103 <span tabindex="0" data-tooltip="<?php esc_attr_e('Any file present here will be loaded normally by WordPress', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
104 </label>
105 <textarea
106 name="exclude_css"
107 rows="7" cols="50"
108 id="exclude_css"
109 class="large-text code"
110 placeholder="<?php esc_attr_e('e.g.: /bootstrap.css', 'wp-optimize'); ?>"
111 ><?php echo esc_textarea($wpo_minify_options['exclude_css']);?></textarea>
112 <br>
113 <?php esc_html_e('Some files known for causing issues when combined / minified are excluded by default.', 'wp-optimize'); ?> <?php esc_html_e('You can see / edit them in the Advanced tab.', 'wp-optimize'); ?>
114 </fieldset>
115 </div>
116
117 <h3><?php esc_html_e('Load the following CSS files asynchronously', 'wp-optimize'); ?></h3>
118 <div class="wpo-fieldgroup">
119 <fieldset>
120 <label class="wpo-label__bold" for="async_css">
121 <?php esc_html_e('Any CSS files that match the paths below will be loaded asynchronously.', 'wp-optimize'); ?><br>
122 <?php esc_html_e('Use this if you have a completely independent stylesheet', 'wp-optimize'); ?>
123 <span tabindex="0" data-tooltip="<?php esc_attr_e("e.g. You may want to exclude 'fontawesome' or other libraries from the initial load", 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
124 </label>
125 <textarea
126 name="async_css"
127 rows="7"
128 cols="50"
129 id="async_css"
130 class="large-text code"
131 placeholder="<?php esc_attr_e('e.g.: /wp-content/themes/my-theme/css/custom-font.css', 'wp-optimize'); ?>"
132 ><?php echo esc_textarea($wpo_minify_options['async_css']); ?></textarea>
133 <div class="wpo-fieldgroup__subgroup">
134 <label for="exclude_css_from_page_speed_tools">
135 <input
136 name="exclude_css_from_page_speed_tools"
137 type="checkbox"
138 id="exclude_css_from_page_speed_tools"
139 value="1"
140 <?php echo checked($wpo_minify_options['exclude_css_from_page_speed_tools']); ?>
141 >
142 <?php esc_html_e('Exclude stylesheets from page speed tests (PageSpeed Insights, GTMetrix...)', 'wp-optimize'); ?>
143 </label>
144 <span tabindex="0" data-tooltip="<?php esc_attr_e('Use this only for testing purpose to find out which stylesheets are slowing down your site.', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span>
145 </div>
146 </fieldset>
147 </div>
148
149 <?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
150 <h3><?php esc_html_e('Enable asynchronous CSS', 'wp-optimize'); ?></h3>
151 <div class="wpo-fieldgroup">
152 <fieldset>
153 <label for="loadcss">
154 <input
155 name="loadcss"
156 type="checkbox"
157 id="loadcss"
158 value="1"
159 <?php echo checked($wpo_minify_options['loadcss']); ?>
160 >
161 <?php esc_html_e('Load all CSS files asynchronously', 'wp-optimize'); ?>
162 <span tabindex="0" data-tooltip="<?php esc_attr_e('Note that inline CSS won\'t work if this is active', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span> </span>
163 </label>
164 <p>
165 <?php esc_html_e('If you have multiple css files per media type, they may load out of order and break your design when loaded asynchronously.', 'wp-optimize'); ?>
166 </p>
167 </fieldset>
168 </div>
169 <?php endif; ?>
170
171 <?php if (WP_OPTIMIZE_SHOW_MINIFY_ADVANCED) : ?>
172 <h3>
173 <?php esc_html_e('Critical path CSS', 'wp-optimize'); ?>
174 </h3>
175 <div class="wpo-fieldgroup">
176 <fieldset>
177 <label class="wpo-label__bold" for="critical_path_css"><?php esc_html_e('Fallback CSS', 'wp-optimize'); ?></label>
178 <textarea
179 name="critical_path_css"
180 rows="7"
181 cols="50"
182 id="critical_path_css" class="large-text code"
183 placeholder=".css-code { display: block; }"
184 ><?php echo esc_textarea($wpo_minify_options['critical_path_css']); ?></textarea>
185 </fieldset>
186
187 <fieldset>
188 <label class="wpo-label__bold" for="critical_path_css_is_front_page"><?php esc_html_e('is_front_page (conditional)', 'wp-optimize'); ?> <span tabindex="0" data-tooltip="<?php esc_attr_e('This will be inlined after the above if your page matches the WP conditional is_front_page()', 'wp-optimize');?>"><span class="dashicons dashicons-editor-help"></span></span></label>
189 <textarea
190 name="critical_path_css_is_front_page"
191 rows="7"
192 cols="50"
193 id="critical_path_css_is_front_page"
194 class="large-text code"
195 placeholder=".css-code { display: block; }"
196 ><?php echo esc_textarea($wpo_minify_options['critical_path_css_is_front_page']); ?></textarea>
197 </fieldset>
198 </div>
199 <?php endif; ?>
200
201 <p class="submit">
202 <input
203 class="wp-optimize-save-minify-settings button button-primary"
204 type="submit"
205 value="<?php esc_attr_e('Save settings', 'wp-optimize'); ?>"
206 >
207 <img class="wpo_spinner" src="<?php echo esc_url(admin_url('images/spinner-2x.gif')); // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage -- N/A ?>" alt="...">
208 <span class="save-done dashicons dashicons-yes display-none"></span>
209 </p>
210 </form>
211 </div>
212