PluginProbe
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript / 4.0.16
BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript v4.0.16
4.1.16 4.1.15 4.1.14 4.1.13 4.1.12 4.1.11 4.1.10 4.0.30 4.0.29 4.0.28 4.0.27 4.0.26 4.0.24 4.0.25 4.0.23 4.0.22 4.0.21 4.0.19 4.0.18 4.0.17 4.0.16 1.9.3 1.9.4 1.9.5 1.9.6 All 170 releases
searchpro / admin / tabs / css-javascript.php

css-javascript.php in BerqWP – All-In-One Optimization for Core Web Vitals, Cache, CDN, Images, CSS & JavaScript 4.0.16, at admin/tabs/css-javascript.php

267 lines 14.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if (!defined('ABSPATH')) exit;
3
4 // cdn exclusions
5 $cdn_exclude = get_option('berq_exclude_cdn', []);
6 $cdn_exclude_keywords = implode("\n", $cdn_exclude);
7
8 $include_critical_css = get_option('berqwp_force_include_critical_css', []);
9 $include_critical_css_lines = implode("\n", $include_critical_css);
10
11 $exclude_css = get_option('berqwp_exclude_css', []);
12 $exclude_css_lines = implode("\n", $exclude_css);
13
14 $exclude_js = get_option('berqwp_exclude_js', []);
15 $exclude_js_lines = implode("\n", $exclude_js);
16
17 $exclude_third_party_js = get_option('berqwp_exclude_third_party_js', []);
18 $exclude_third_party_js_lines = implode("\n", $exclude_third_party_js);
19
20
21 ?>
22 <div id="css-javascript" <?php bwp_is_tab('css-javascript'); ?>>
23 <h2 class="berq-tab-title"><?php esc_html_e('CSS & JavaScript', 'searchpro'); ?></h2>
24 <div class="berq-info-box berq-setting-group">
25 <div class="group-container">
26 <h3 class="berq-box-title <?php echo !$berqwp_can_use_cloud ? 'cloud-exclusive' : ''; ?>">
27 <?php esc_html_e('Generate Critical CSS', 'searchpro'); ?>
28 </h3>
29 <div class="berq-box-content berq-setting-toggle">
30 <div class="berq-option-content">
31 <p>
32 <?php esc_html_e("Extract and inline the CSS needed to render above-the-fold content instantly, then load remaining CSS based on the \"CSS Delivery Method\" setting.", 'searchpro'); ?>
33 </p>
34 </div>
35 <?php berqwp_render_toggle('berqwp_enable_critical_css', get_option('berqwp_enable_critical_css')); ?>
36 </div>
37 </div>
38 <div class="group-container">
39 <h3 class="berq-box-title">
40 <?php esc_html_e('Force Include', 'searchpro'); ?>
41 </h3>
42 <div class="berq-box-content">
43 <p>
44 <?php esc_html_e('Force include selectors to always include in critical CSS. Enter regex, one per line.', 'searchpro'); ?>
45 </p>
46 <textarea name="berqwp_force_include_critical_css" cols="30" rows="10"><?php echo esc_textarea($include_critical_css_lines); ?></textarea>
47 </div>
48 </div>
49
50 </div>
51
52 <div class="berq-info-box berq-setting-group">
53 <div class="group-container">
54 <h3 class="berq-box-title <?php echo !$berqwp_can_use_cloud ? 'cloud-exclusive' : ''; ?>">
55 <?php esc_html_e('CSS Delivery Method', 'searchpro'); ?>
56 </h3>
57 <div class="berq-box-content">
58 <p>
59 <?php esc_html_e("Choose how CSS files should load to improve page performance. Select one of the following options:", 'searchpro'); ?>
60 </p>
61 <select name="berq_css_optimization">
62 <option <?php selected( get_option('berq_css_optimization'), 'auto' ); ?> value="auto"><?php esc_html_e('Auto (According to optimization mode setting)', 'searchpro'); ?></option>
63 <option <?php selected( get_option('berq_css_optimization'), 'delay' ); ?> value="delay"><?php esc_html_e('After user interaction', 'searchpro'); ?></option>
64 <option <?php selected( get_option('berq_css_optimization'), 'asynchronous' ); ?> value="asynchronous"><?php esc_html_e('Asynchronous', 'searchpro'); ?></option>
65 <option <?php selected( get_option('berq_css_optimization'), 'disable' ); ?> value="disable"><?php esc_html_e('Disable', 'searchpro'); ?></option>
66 </select>
67 </div>
68 </div>
69
70 <div class="group-container">
71 <h3 class="berq-box-title">
72 <?php esc_html_e('Exclude CSS', 'searchpro'); ?>
73 </h3>
74 <div class="berq-box-content">
75 <p>
76 <?php esc_html_e('Enter URLs, filenames, or keywords to exclude from the CSS Delivery Method. Enter one per line.', 'searchpro'); ?>
77 </p>
78 <textarea name="berqwp_exclude_css" cols="30" rows="10"><?php echo esc_textarea($exclude_css_lines); ?></textarea>
79 </div>
80 </div>
81
82 <div class="group-container">
83 <h3 class="berq-box-title <?php echo !$berqwp_can_use_cloud ? 'cloud-exclusive' : ''; ?>">
84 <?php esc_html_e('Async Excluded Styles', 'searchpro'); ?>
85 </h3>
86 <div class="berq-box-content berq-setting-toggle">
87 <div class="berq-option-content">
88 <p>
89 <?php esc_html_e("Asynchronously load excluded styles to make them non-blocking and improve page performance.", 'searchpro'); ?>
90 </p>
91 </div>
92 <?php berqwp_render_toggle('berqwp_async_excluded_styles', get_option('berqwp_async_excluded_styles')); ?>
93 </div>
94 </div>
95 </div>
96
97 <div class="berq-info-box berq-setting-group">
98 <div class="group-container">
99 <h3 class="berq-box-title">
100 <?php esc_html_e('JavaScript Delivery Method', 'searchpro'); ?>
101 </h3>
102 <div class="berq-box-content">
103 <p>
104 <?php esc_html_e("Choose how JavaScript files should load to improve page performance. Select one of the following options:", 'searchpro'); ?>
105 </p>
106 <select name="berq_js_optimization">
107 <option <?php selected( get_option('berq_js_optimization'), 'auto' ); ?> value="auto"><?php esc_html_e('Auto (According to optimization mode setting)', 'searchpro'); ?></option>
108 <option <?php selected( get_option('berq_js_optimization'), 'delay' ); ?> value="delay"><?php esc_html_e('After user interaction', 'searchpro'); ?></option>
109 <option <?php selected( get_option('berq_js_optimization'), 'asynchronous' ); ?> value="asynchronous"><?php esc_html_e('Asynchronous', 'searchpro'); ?></option>
110 <option <?php selected( get_option('berq_js_optimization'), 'defer' ); ?> value="defer"><?php esc_html_e('Defer', 'searchpro'); ?></option>
111 <option <?php selected( get_option('berq_js_optimization'), 'disable' ); ?> value="disable"><?php esc_html_e('Disable', 'searchpro'); ?></option>
112 </select>
113 </div>
114 </div>
115
116 <div class="group-container">
117 <h3 class="berq-box-title">
118 <?php esc_html_e('Exclude JavaScript', 'searchpro'); ?>
119 </h3>
120 <div class="berq-box-content">
121 <p>
122 <?php esc_html_e('Enter URLs, filenames, or keywords to exclude from the JavaScript Delivery Method. Enter one per line.', 'searchpro'); ?>
123 </p>
124 <textarea name="berqwp_exclude_js" cols="30" rows="10"><?php echo esc_textarea($exclude_js_lines); ?></textarea>
125 </div>
126 </div>
127
128 <div class="group-container">
129 <h3 class="berq-box-title">
130 <?php esc_html_e('Defer Excluded JavaScript', 'searchpro'); ?>
131 </h3>
132 <div class="berq-box-content berq-setting-toggle">
133 <div class="berq-option-content">
134 <p>
135 <?php esc_html_e("Defer excluded scripts to make them non-blocking and improve page performance.", 'searchpro'); ?>
136 </p>
137 </div>
138 <?php berqwp_render_toggle('berqwp_defer_excluded_js', get_option('berqwp_defer_excluded_js')); ?>
139 </div>
140 </div>
141
142 <div class="group-container">
143 <h3 class="berq-box-title <?php echo !$berqwp_can_use_cloud ? 'cloud-exclusive' : ''; ?>">
144 <?php esc_html_e('JavaScript Execution Mode', 'searchpro'); ?>
145 </h3>
146 <div class="berq-box-content">
147 <p>
148 <?php esc_html_e("$plugin_name offers different JavaScript optimization modes, so every JavaScript-heavy website can unlock its true potential.", 'searchpro'); ?>
149 </p>
150 <label class="berq-check">
151 <input type="radio" name="berqwp_javascript_execution_mode" value="4" <?php echo get_option('berqwp_javascript_execution_mode') == 4 ? 'checked' : ''; ?>>
152 <?php esc_html_e('Flora - High Compatibility (Default)', 'searchpro'); ?>
153 </label>
154 <label class="berq-check">
155 <input type="radio" name="berqwp_javascript_execution_mode" value="1" <?php echo get_option('berqwp_javascript_execution_mode') == 1 ? 'checked' : ''; ?>>
156 <?php esc_html_e('Sequential Blocking Execution - High Compatibility', 'searchpro'); ?>
157 </label>
158 <label class="berq-check">
159 <input type="radio" name="berqwp_javascript_execution_mode" value="3" <?php echo get_option('berqwp_javascript_execution_mode') == 3 ? 'checked' : ''; ?>>
160 <?php esc_html_e('Parallel Execution - High Compatibility', 'searchpro'); ?>
161 </label>
162 <label class="berq-check">
163 <input type="radio" name="berqwp_javascript_execution_mode" value="0" <?php echo get_option('berqwp_javascript_execution_mode') == 0 ? 'checked' : ''; ?>>
164 <?php esc_html_e('Sequential Execution', 'searchpro'); ?>
165 </label>
166 </div>
167 </div>
168
169 </div>
170 <div class="berq-info-box berq-setting-group">
171
172 <div class="group-container">
173 <h3 class="berq-box-title">
174 <?php esc_html_e('Delay Third-Party Scripts', 'searchpro'); ?>
175 </h3>
176 <div class="berq-box-content berq-setting-toggle">
177 <div class="berq-option-content">
178 <p>
179 <?php esc_html_e("Load third-party scripts only after user interaction to reduce initial page load time.", 'searchpro'); ?>
180 </p>
181 </div>
182 <?php berqwp_render_toggle('berqwp_delay_third_party_scripts', get_option('berqwp_delay_third_party_scripts')); ?>
183 </div>
184 </div>
185
186 <div class="group-container">
187 <h3 class="berq-box-title">
188 <?php esc_html_e('Exclude Third-Party Scripts', 'searchpro'); ?>
189 </h3>
190 <div class="berq-box-content">
191 <p>
192 <?php esc_html_e('Enter URLs, filenames, or keywords to exclude from the Delay Third-Party Scripts. Enter one per line.', 'searchpro'); ?>
193 </p>
194 <textarea name="berqwp_exclude_third_party_js" cols="30" rows="10"><?php echo esc_textarea($exclude_third_party_js_lines); ?></textarea>
195 </div>
196 </div>
197
198 </div>
199 <div class="berq-info-box berq-setting-group">
200
201 <div class="group-container">
202 <h3 class="berq-box-title <?php echo !$berqwp_can_use_cloud ? 'cloud-exclusive' : ''; ?>">
203 <?php esc_html_e('Preload Font Faces', 'searchpro'); ?>
204 </h3>
205 <div class="berq-box-content berq-setting-toggle">
206 <div class="berq-option-content">
207 <p>
208 <?php esc_html_e("Preload font faces along with the critical CSS upon the initial page load.", 'searchpro'); ?>
209 </p>
210 </div>
211 <?php berqwp_render_toggle('berqwp_preload_fontfaces', get_option('berqwp_preload_fontfaces')); ?>
212 </div>
213 </div>
214 <div class="group-container">
215 <h3 class="berq-box-title <?php echo !$berqwp_can_use_cloud ? 'cloud-exclusive' : ''; ?>">
216 <?php esc_html_e('Preload Cookie Banner', 'searchpro'); ?>
217 </h3>
218 <div class="berq-box-content berq-setting-toggle">
219 <div class="berq-option-content">
220 <p>
221 <?php esc_html_e("Preload the cookie banner on the initial page load, may sometimes cause a drop in the PageSpeed score. Currently supports Complianz, CookieYes, Real Cookie Banner, CYTRIO, GetTerms and My Agile Privacy. ", 'searchpro'); ?>
222 </p>
223 </div>
224 <?php berqwp_render_toggle('berqwp_preload_cookiebanner', get_option('berqwp_preload_cookiebanner')); ?>
225 </div>
226 </div>
227 <div class="group-container">
228 <h3 class="berq-box-title">
229 <?php esc_html_e('Prerender Page on Link Hover', 'searchpro'); ?>
230 </h3>
231 <div class="berq-box-content berq-setting-toggle">
232 <div class="berq-option-content">
233 <p>
234 <?php esc_html_e("Prerender the page using the browser's Speculation Rules API when a user hovers over a link, so it loads instantly on click.", 'searchpro'); ?>
235 </p>
236 </div>
237 <?php berqwp_render_toggle('berqwp_prerender_on_hover', get_option('berqwp_prerender_on_hover')); ?>
238 </div>
239 </div>
240
241 </div>
242 <div class="berq-info-box berq-setting-group">
243
244 <div class="group-container">
245 <h3 class="berq-box-title <?php echo !$berqwp_can_use_cloud ? 'cloud-exclusive' : ''; ?>">
246 <?php esc_html_e('Lazy Render Below the Fold', 'searchpro'); ?>
247 </h3>
248 <div class="berq-box-content berq-setting-toggle">
249 <div class="berq-option-content">
250 <p>
251 <?php esc_html_e("Defer rendering of below-the-fold content using the CSS content-visibility property for faster initial page load.", 'searchpro'); ?>
252 </p>
253 </div>
254 <?php berqwp_render_toggle('berqwp_lazy_render', get_option('berqwp_lazy_render')); ?>
255 </div>
256 </div>
257
258 </div>
259
260 <button type="submit" class="berqwp-save"><svg width="20" height="20" viewBox="0 0 20 20" fill="none"
261 xmlns="http://www.w3.org/2000/svg">
262 <path d="M4.16663 10.8333L7.49996 14.1667L15.8333 5.83334" stroke="white" stroke-width="2"
263 stroke-linecap="round" stroke-linejoin="round" />
264 </svg>
265 <?php esc_html_e("Save changes", "searchpro"); ?></button>
266 </div>
267