PluginProbe
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score / 3.6
Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score v3.6
trunk 1.0 1.0.1 1.1 1.1.1 1.1.2 1.2 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 2.0 2.0.1 2.0.2 2.0.3 2.0.4 2.1 2.1.1 2.1.2 2.2 2.2.1 All 69 releases
powered-cache / includes / admin / partials / settings-page.php

settings-page.php in Powered Cache – Caching and Optimization for WordPress – Easily Improve PageSpeed & Web Vitals Score 3.6, at includes/admin/partials/settings-page.php

3,038 lines 139.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Settings Page Template
4 *
5 * @package PoweredCache
6 */
7
8 namespace PoweredCache\Admin\Partials\SettingsPage;
9
10 use PoweredCache\Async\CachePreloader;
11 use function PoweredCache\Utils\can_configure_htaccess;
12 use function PoweredCache\Utils\can_configure_object_cache;
13 use function PoweredCache\Utils\can_control_all_settings;
14 use function PoweredCache\Utils\cdn_zones;
15 use function PoweredCache\Utils\get_available_object_caches;
16 use function PoweredCache\Utils\get_decrypted_setting;
17 use function PoweredCache\Utils\get_doc_url;
18 use function PoweredCache\Utils\get_timeout_with_interval;
19 use function PoweredCache\Utils\is_local_site;
20 use function PoweredCache\Utils\is_premium;
21 use function PoweredCache\Utils\mask_string;
22 use function PoweredCache\Utils\sanitize_css;
23 use function PoweredCache\Utils\scheduled_cleanup_frequency_options;
24 use const PoweredCache\Constants\UNMASK_CHARACTER_LENGTH;
25
26 if ( ! defined( 'ABSPATH' ) ) {
27 exit; // Exit if accessed directly.
28 }
29 // phpcs:disable WordPress.WhiteSpace.PrecisionAlignment.Found
30 // phpcs:disable Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
31 // phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
32 // phpcs:disable WordPressVIPMinimum.Security.ProperEscapingFunction.htmlAttrNotByEscHTML
33 // phpcs:disable WordPressVIPMinimum.Security.ProperEscapingFunction.notAttrEscAttr
34
35 $settings = \PoweredCache\Utils\get_settings();
36 $cf_api_key = \PoweredCache\Extensions\Cloudflare\Cloudflare::get_cf_api_key();
37 $cf_api_token = \PoweredCache\Extensions\Cloudflare\Cloudflare::get_cf_api_token();
38
39 ?>
40
41 <main class="sui-wrap">
42 <div class="sui-header">
43 <h1 class="sui-header-title">
44 <img width="32" alt="<?php esc_html_e( 'Powered Cache Icon', 'powered-cache' ); ?>"
45 src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iMzJweCIgaWQ9IkxheWVyXzEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHdpZHRoPSIzMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNDQgMzM2KSI+PHBhdGggZD0iTS0xMTcuMTc2LTMzNC4wNjNoLTkuMzUzTC0xMzguMTExLTMyMGg5LjMwNGwtMTEuNzQ1LDE0LjA2M2wyNS4xMDUtMTguMzE2aC05LjgwOUwtMTE3LjE3Ni0zMzQuMDYzeiIvPjwvZz48L3N2Zz4=">
46 <?php esc_html_e( 'Powered Cache', 'powered-cache' ); ?>
47 </h1>
48
49 <!-- Float element to Right -->
50 <div class="sui-actions-right">
51 <a href="<?php echo esc_url( get_doc_url( '/' ) ); ?>" target="_blank" class="sui-button sui-hidden-sm sui-button-blue">
52 <i class="sui-icon-academy" aria-hidden="true"></i>
53 <?php esc_html_e( 'Documentation', 'powered-cache' ); ?>
54 </a>
55 </div>
56 </div>
57 <?php \PoweredCache\Utils\settings_errors(); ?>
58
59 <form method="post" action="" enctype="multipart/form-data">
60 <?php wp_nonce_field( 'powered_cache_update_settings', 'powered_cache_settings_nonce' ); ?>
61 <section class="sui-row-with-sidenav">
62
63 <!-- Navigation -->
64 <div class="sui-sidenav" role="navigation">
65
66 <ul class="sui-vertical-tabs">
67
68 <li class="sui-vertical-tab current">
69 <a href="#basic-options" role="button" data-tab="basic-options"><?php esc_html_e( 'Basic Options', 'powered-cache' ); ?></a>
70 </li>
71
72 <li class="sui-vertical-tab">
73 <a href="#advanced-options" role="button" data-tab="advanced-options"><?php esc_html_e( 'Advanced Options', 'powered-cache' ); ?></a>
74 </li>
75
76 <li class="sui-vertical-tab">
77 <a href="#file-optimization" role="button" data-tab="file-optimization"><?php esc_html_e( 'File Optimization', 'powered-cache' ); ?></a>
78 </li>
79
80 <li class="sui-vertical-tab">
81 <a href="#media-optimization" role="button" data-tab="media-optimization"><?php esc_html_e( 'Media Optimization', 'powered-cache' ); ?></a>
82 </li>
83
84 <li class="sui-vertical-tab">
85 <a href="#cdn-integration" role="button" data-tab="cdn-integration"><?php esc_html_e( 'CDN Integration', 'powered-cache' ); ?></a>
86 </li>
87
88 <li class="sui-vertical-tab">
89 <a href="#preload" role="button" data-tab="preload"><?php esc_html_e( 'Preload', 'powered-cache' ); ?></a>
90 </li>
91
92 <li class="sui-vertical-tab">
93 <a href="#db-optimization" role="button" data-tab="db-optimization"><?php esc_html_e( 'Database', 'powered-cache' ); ?></a>
94 </li>
95
96 <li class="sui-vertical-tab">
97 <a href="#extensions" role="button" data-tab="extensions"><?php esc_html_e( 'Extensions', 'powered-cache' ); ?></a>
98 </li>
99
100 <li class="sui-vertical-tab">
101 <a href="#misc-settings" role="button" data-tab="misc-settings"><?php esc_html_e( 'Misc', 'powered-cache' ); ?></a>
102 </li>
103
104 <?php
105 /**
106 * Fires after settings nav. Used for injecting new settings tabs..
107 *
108 * @hook powered_cache_admin_page_after_settings_nav
109 *
110 * @since 2.0
111 */
112 do_action( 'powered_cache_admin_page_after_settings_nav' );
113 ?>
114
115 </ul>
116
117 <button type="submit" name="powered_cache_form_action" class="sui-button sui-margin-bottom sui-hidden-sm sui-button-blue" value="save_settings"><?php esc_html_e( 'Save Changes', 'powered-cache' ); ?></button>
118 </div>
119
120 <!-- TAB: Regular -->
121 <div class="sui-box" id="basic-options" data-tab="basic-options" style="">
122
123 <div class="sui-box-header">
124 <h2 class="sui-box-title"><?php esc_html_e( 'Basic Options', 'powered-cache' ); ?></h2>
125 </div>
126
127 <div class="sui-box-body">
128
129 <!-- Page Cache settings -->
130 <div class="sui-box-settings-row">
131 <div class="sui-box-settings-col-1">
132 <span class="sui-settings-label"><?php esc_html_e( 'Page Cache', 'powered-cache' ); ?></span>
133 </div>
134
135 <div class="sui-box-settings-col-2">
136 <div class="sui-form-field">
137 <label for="enable_page_cache" class="sui-toggle">
138 <input
139 type="checkbox"
140 id="enable_page_cache"
141 name="enable_page_cache"
142 aria-labelledby="enable_page_cache_label"
143 aria-describedby="enable_page_cache_description"
144 <?php checked( 1, $settings['enable_page_cache'] ); ?>
145 >
146 <span class="sui-toggle-slider" aria-hidden="true"></span>
147 <span id="enable_page_cache_label" class="sui-toggle-label"><?php esc_html_e( 'Enable page cache', 'powered-cache' ); ?></span>
148 </label>
149 <span id="enable_page_cache_description" class="sui-description"><?php esc_html_e( 'Enable page caching that will reduce the response time of your site.', 'powered-cache' ); ?>
150 <a href="<?php echo esc_url( get_doc_url( 'page-caching' ) ); ?>" target="_blank"><?php esc_html_e( 'Learn More', 'powered-cache' ); ?></a>
151 </span>
152 </div>
153 </div>
154 </div>
155
156 <?php if ( can_configure_object_cache() ) : ?>
157 <!-- Object Caching settings -->
158 <div class="sui-box-settings-row">
159 <div class="sui-box-settings-col-1">
160 <span class="sui-settings-label"><?php esc_html_e( 'Object Cache', 'powered-cache' ); ?></span>
161 <span class="sui-description"><?php esc_html_e( 'Speed up dynamic pageviews.', 'powered-cache' ); ?></span>
162 </div>
163
164 <div class="sui-box-settings-col-2">
165 <div class="sui-form-field">
166 <select id="object_cache" name="object_cache">
167 <option value="off" <?php selected( $settings['object_cache'], 'off' ); ?>><?php esc_html_e( 'Off', 'powered-cache' ); ?></option>
168 <?php foreach ( get_available_object_caches() as $object_cache_backend ) : ?>
169 <option <?php selected( $settings['object_cache'], $object_cache_backend ); ?> value="<?php echo esc_attr( $object_cache_backend ); ?>"><?php echo esc_attr( ucfirst( $object_cache_backend ) ); ?></option>
170 <?php endforeach; ?>
171 </select>
172 <span id="object_cache_description" class="sui-description"><?php esc_html_e( 'You will also need to configure the object cache backend.', 'powered-cache' ); ?><a href="<?php echo esc_url( get_doc_url( 'object-caching' ) ); ?>" target="_blank"><?php esc_html_e( 'Learn More', 'powered-cache' ); ?></a></span>
173
174 <div role="alert" id="object_cache_alloptions_message" class="sui-hidden sui-notice" aria-live="assertive">
175 <div class="sui-notice-content">
176 <div class="sui-notice-message">
177
178 </div>
179 </div>
180 </div>
181 </div>
182
183
184
185 </div>
186 </div>
187 <?php endif; ?>
188
189 <!-- Mobile Cache settings -->
190 <div class="sui-box-settings-row">
191 <div class="sui-box-settings-col-1">
192 <span class="sui-settings-label"><?php esc_html_e( 'Mobile Cache', 'powered-cache' ); ?></span>
193 <span class="sui-description"><?php esc_html_e( 'Cache for mobile devices', 'powered-cache' ); ?></span>
194 </div>
195
196 <div class="sui-box-settings-col-2">
197 <div class="sui-form-field">
198 <label for="cache_mobile" class="sui-toggle">
199 <input type="checkbox"
200 value="1"
201 name="cache_mobile"
202 id="cache_mobile"
203 aria-controls="cache_mobile_separate_file_controls"
204 <?php checked( 1, $settings['cache_mobile'] ); ?>
205 >
206 <span class="sui-toggle-slider" aria-hidden="true"></span>
207 <span id="toggle-6-label" class="sui-toggle-label"><?php esc_html_e( 'Enable caching for mobile devices.', 'powered-cache' ); ?></span>
208 </label>
209
210 <div style=" <?php echo( ! $settings['cache_mobile'] ? 'display:none' : '' ); ?>" tabindex="0" id="cache_mobile_separate_file_controls">
211 <div class="sui-form-field">
212 <label for="cache_mobile_separate_file" class="sui-toggle">
213 <input type="checkbox"
214 value="1"
215 name="cache_mobile_separate_file"
216 id="cache_mobile_separate_file"
217 <?php checked( 1, $settings['cache_mobile_separate_file'] ); ?>
218 >
219 <span class="sui-toggle-slider" aria-hidden="true"></span>
220 <span id="cache_mobile_separate_file_label" class="sui-toggle-label"><?php esc_html_e( 'Use separate cache file for mobile.', 'powered-cache' ); ?></span>
221 </label>
222 </div>
223 </div>
224
225 </div>
226 </div>
227 </div>
228
229 <!-- Logged-in cache settings -->
230 <div class="sui-box-settings-row">
231
232 <div class="sui-box-settings-col-1">
233 <span class="sui-settings-label"><?php esc_html_e( 'Logged in user cache', 'powered-cache' ); ?></span>
234 <span class="sui-description"><?php esc_html_e( 'It creates a separate cache for each users.', 'powered-cache' ); ?></span>
235 </div>
236
237 <div class="sui-box-settings-col-2">
238 <div class="sui-form-field">
239 <label for="loggedin_user_cache" class="sui-toggle">
240 <input type="checkbox"
241 value="1"
242 name="loggedin_user_cache"
243 id="loggedin_user_cache"
244 <?php checked( 1, $settings['loggedin_user_cache'] ); ?>
245 >
246 <span class="sui-toggle-slider" aria-hidden="true"></span>
247 <span id="loggedin_user_cache_label" class="sui-toggle-label"><?php esc_html_e( 'Enable caching for logged-in users', 'powered-cache' ); ?></span>
248 <span class="sui-description"><?php esc_html_e( 'This feature is useful when you have user-specific or restricted content on your website', 'powered-cache' ); ?></span>
249 </label>
250 </div>
251 </div>
252 </div>
253
254 <?php if ( function_exists( 'gzencode' ) ) : ?>
255 <!-- Gzip compression settings -->
256 <div class="sui-box-settings-row">
257
258 <div class="sui-box-settings-col-1">
259 <span class="sui-settings-label"><?php esc_html_e( 'Gzip Compression', 'powered-cache' ); ?></span>
260 </div>
261 <div class="sui-box-settings-col-2">
262 <div class="sui-form-field">
263 <label for="gzip_compression" class="sui-toggle">
264 <input type="checkbox"
265 value="1"
266 name="gzip_compression"
267 id="gzip_compression"
268 aria-labelledby="gzip_compression_label"
269 <?php checked( 1, $settings['gzip_compression'] ); ?>
270 >
271 <span class="sui-toggle-slider" aria-hidden="true"></span>
272 <span id="gzip_compression_label" class="sui-toggle-label"><?php esc_html_e( 'Enable gzip compression', 'powered-cache' ); ?></span>
273 <span class="sui-description"><?php esc_html_e( 'The pages will be gzip-compressed at the PHP level when this option enabled. However, we highly recommended gzip compression on a web server, our pre-defined configurations for .htaccess and Nginx configurations come with gzip compression.', 'powered-cache' ); ?></span>
274 </label>
275 </div>
276 </div>
277
278 </div>
279 <?php endif; ?>
280
281 <!-- Cache Timeout -->
282 <?php list( $cache_timeout, $selected_interval ) = get_timeout_with_interval( $settings['cache_timeout'] ); ?>
283 <div class="sui-box-settings-row">
284 <div class="sui-box-settings-col-1">
285 <span class="sui-settings-label"><?php esc_html_e( 'Cache Timeout', 'powered-cache' ); ?></span>
286 <span class="sui-description"><?php esc_html_e( 'The lifespan of the cached page. Expired cache purges with WP Cron.', 'powered-cache' ); ?></span>
287 </div>
288 <div class="sui-box-settings-col-2">
289 <div class="sui-form-field">
290 <input
291 name="cache_timeout"
292 id="cache_timeout"
293 class="sui-form-control sui-field-has-suffix"
294 min="1"
295 type="number"
296 value="<?php echo absint( $cache_timeout ); ?>"
297 />
298 <span class="sui-field-suffix" style="margin-left:0;">
299 <div class="sui-form-field sui-input-md">
300 <select id="cache_timeout_interval" name="cache_timeout_interval" class="sui-form-control">
301 <option <?php selected( 'MINUTE', $selected_interval ); ?> value="MINUTE"><?php echo esc_html__( 'Minute', 'powered-cache' ); ?></option>
302 <option <?php selected( 'HOUR', $selected_interval ); ?> value="HOUR"><?php echo esc_html__( 'Hour', 'powered-cache' ); ?></option>
303 <option <?php selected( 'DAY', $selected_interval ); ?> value="DAY"><?php echo esc_html__( 'Day', 'powered-cache' ); ?></option>
304 </select>
305 </div>
306 </span>
307 </div>
308 </div>
309 </div>
310
311 </div>
312
313 <div class="sui-box-footer">
314 <?php require 'settings-form-action.php'; ?>
315 </div>
316
317 </div>
318
319 <!-- TAB: Advanced Options -->
320 <div class="sui-box" id="advanced-options" data-tab="advanced-options" style="display: none">
321 <div class="sui-box-header">
322 <h2 class="sui-box-title"><?php esc_html_e( 'Advanced Options', 'powered-cache' ); ?></h2>
323 </div>
324
325 <div class="sui-box-body">
326
327 <?php if ( can_configure_htaccess() ) : ?>
328 <!-- .htaccess settings -->
329 <div class="sui-box-settings-row">
330 <div class="sui-box-settings-col-1">
331 <span class="sui-settings-label"><?php esc_html_e( '.htaccess Configuration', 'powered-cache' ); ?></span>
332 </div>
333
334 <div class="sui-box-settings-col-2">
335 <div class="sui-form-field">
336 <label for="auto_configure_htaccess" class="sui-toggle">
337 <input
338 type="checkbox"
339 id="auto_configure_htaccess"
340 name="auto_configure_htaccess"
341 aria-labelledby="auto_configure_htaccess_label"
342 <?php checked( 1, $settings['auto_configure_htaccess'] ); ?>
343 >
344 <span class="sui-toggle-slider" aria-hidden="true"></span>
345 <span id="auto_configure_htaccess_label" class="sui-toggle-label"><?php esc_html_e( 'Automatically configure .htaccess', 'powered-cache' ); ?></span>
346 </label>
347 <span class="sui-description"><?php esc_html_e( 'You are using a .htaccess compatible server. Powered Cache automatically configures .htaccess to giving the best performance when this option is enabled. Highly recommend keeping this option enabled unless you are keeping .htaccess under a version control system.', 'powered-cache' ); ?></span>
348 </div>
349 </div>
350 </div>
351 <?php endif; ?>
352
353 <!-- Rejected user agents -->
354 <div class="sui-box-settings-row">
355 <div class="sui-box-settings-col-1">
356 <span class="sui-settings-label"><?php esc_html_e( 'Rejected User Agents', 'powered-cache' ); ?></span>
357 </div>
358
359 <div class="sui-box-settings-col-2">
360 <div class="sui-row">
361
362 <div class="sui-col-md-8">
363 <div class="sui-form-field">
364 <label for="rejected_user_agents" class="sui-label"><i><?php esc_html_e( 'Enter rejected user agents (one per line)', 'powered-cache' ); ?></i></label>
365 <textarea
366 placeholder="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
367 id="rejected_user_agents"
368 name="rejected_user_agents"
369 class="sui-form-control"
370 aria-describedby="rejected_user_agents_description"
371 rows="5"
372 ><?php echo esc_textarea( $settings['rejected_user_agents'] ); ?></textarea>
373 <span id="rejected_user_agents_description" class="sui-description">
374 <?php esc_html_e( 'Never send cached results for these user agents.', 'powered-cache' ); ?>
375 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'rejected-user-agents' ) ); ?>" target="_blank">(?)</a>
376 </span>
377 </div>
378 </div>
379 </div>
380 </div>
381 </div>
382
383 <!-- Rejected cookies -->
384 <div class="sui-box-settings-row">
385 <div class="sui-box-settings-col-1">
386 <span class="sui-settings-label" id="rejected_cookies_label"><?php esc_html_e( 'Rejected Cookies', 'powered-cache' ); ?></span>
387 </div>
388
389 <div class="sui-box-settings-col-2">
390 <div class="sui-row">
391 <div class="sui-col-md-8">
392 <div class="sui-form-field">
393 <label for="rejected_cookies" class="sui-label"><i><?php esc_html_e( 'Enter rejected cookies (one per line)', 'powered-cache' ); ?></i></label>
394 <textarea
395 placeholder="wordpress_"
396 id="rejected_cookies"
397 name="rejected_cookies"
398 class="sui-form-control"
399 aria-labelledby="rejected_cookies_label"
400 aria-describedby="rejected_cookies_description"
401 rows="5"
402 ><?php echo esc_textarea( $settings['rejected_cookies'] ); ?></textarea>
403 <span id="rejected_cookies_description" class="sui-description"><?php esc_html_e( 'Never cache pages that use the specified cookies.', 'powered-cache' ); ?>
404 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'rejected-cookies' ) ); ?>" target="_blank">(?)</a>
405 </span>
406 </div>
407 </div>
408 </div>
409 </div>
410 </div>
411
412 <!-- Rejected Referrers -->
413 <div class="sui-box-settings-row">
414 <div class="sui-box-settings-col-1">
415 <span class="sui-settings-label" id="rejected_referrers_label">
416 <?php esc_html_e( 'Rejected Referrers', 'powered-cache' ); ?>
417 </span>
418 </div>
419
420 <div class="sui-box-settings-col-2">
421 <div class="sui-row">
422 <div class="sui-col-md-8">
423 <div class="sui-form-field">
424 <label for="rejected_referrers" class="sui-label">
425 <i><?php esc_html_e( 'Enter rejected referrers (one per line)', 'powered-cache' ); ?></i>
426 </label>
427 <textarea
428 placeholder="https://example.com"
429 id="rejected_referrers"
430 name="rejected_referrers"
431 class="sui-form-control"
432 aria-labelledby="rejected_referrers_label"
433 aria-describedby="rejected_referrers_description"
434 rows="5"
435 ><?php echo esc_textarea( $settings['rejected_referrers'] ); ?></textarea>
436 <span id="rejected_referrers_description" class="sui-description">
437 <?php esc_html_e( 'Never cache pages that use the specified referrers.', 'powered-cache' ); ?>
438 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'rejected-referrers' ) ); ?>" target="_blank">(?)</a>
439 </span>
440 </div>
441 </div>
442 </div>
443 </div>
444 </div>
445
446 <!-- Cookie Vary -->
447 <div class="sui-box-settings-row">
448 <div class="sui-box-settings-col-1">
449 <span class="sui-settings-label" id="vary_cookies_label"><?php esc_html_e( 'Vary Cookies', 'powered-cache' ); ?></span>
450 </div>
451
452 <div class="sui-box-settings-col-2">
453 <div class="sui-row">
454 <div class="sui-col-md-8">
455 <div class="sui-form-field">
456 <label for="vary_cookies" class="sui-label"><i><?php esc_html_e( 'Enter vary cookies (one per line)', 'powered-cache' ); ?></i></label>
457 <textarea
458 placeholder="(Eg: cookie_notice_accepted)"
459 id="vary_cookies"
460 name="vary_cookies"
461 class="sui-form-control"
462 aria-labelledby="vary_cookies_label"
463 aria-describedby="vary_cookies_description"
464 rows="5"
465 ><?php echo esc_textarea( $settings['vary_cookies'] ); ?></textarea>
466 <span id="vary_cookies_description" class="sui-description"><?php esc_html_e( 'Separate cache will be generated based on the cookie match.', 'powered-cache' ); ?>
467 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'vary-cookies' ) ); ?>" target="_blank">(?)</a>
468 </span>
469 </div>
470 </div>
471 </div>
472 </div>
473 </div>
474
475 <!-- Never cache the following pages -->
476 <div class="sui-box-settings-row">
477 <div class="sui-box-settings-col-1">
478 <span class="sui-settings-label"><?php esc_html_e( 'Never cache the following pages', 'powered-cache' ); ?></span>
479 </div>
480
481 <div class="sui-box-settings-col-2">
482 <div class="sui-row">
483
484 <div class="sui-col-md-8">
485 <div class="sui-form-field">
486 <label for="rejected_uri" class="sui-label"><i><?php esc_html_e( 'Enter pages that will never get cached (one per line)', 'powered-cache' ); ?></i></label>
487 <textarea
488 placeholder="/example-page"
489 id="rejected_uri"
490 name="rejected_uri"
491 class="sui-form-control"
492 aria-describedby="rejected_uri_description"
493 rows="5"
494 ><?php echo esc_textarea( $settings['rejected_uri'] ); ?></textarea>
495 <span id="rejected_uri_description" class="sui-description"><?php esc_html_e( 'Ignore the specified pages / directories. Supports regex.', 'powered-cache' ); ?>
496 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'ignored-pages' ) ); ?>" target="_blank">(?)</a>
497 </span>
498 </div>
499 </div>
500 </div>
501 </div>
502 </div>
503
504 <!-- Cache query strings -->
505 <div class="sui-box-settings-row">
506 <div class="sui-box-settings-col-1">
507 <span class="sui-settings-label"><?php esc_html_e( 'Cache Query Strings', 'powered-cache' ); ?></span>
508 </div>
509 <div class="sui-box-settings-col-2">
510 <div class="sui-row">
511 <div class="sui-col-md-8">
512 <div class="sui-form-field">
513 <label for="cache_query_strings" class="sui-label"><i><?php esc_html_e( 'Enter query strings for cache (one per line)', 'powered-cache' ); ?></i></label>
514 <textarea
515 id="cache_query_strings"
516 name="cache_query_strings"
517 class="sui-form-control"
518 aria-describedby="cache_query_strings_description"
519 rows="5"
520 ><?php echo esc_textarea( $settings['cache_query_strings'] ); ?></textarea>
521 <span id="cache_query_strings_description" class="sui-description">
522 <?php esc_html_e( 'Powered Cache will create separate caching file for the value of these query strings.', 'powered-cache' ); ?>
523 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'cache-query-strings' ) ); ?>" target="_blank">(?)</a>
524 </span>
525 </div>
526 </div>
527 </div>
528 </div>
529 </div>
530
531 <!-- Ignored query strings -->
532 <div class="sui-box-settings-row">
533 <div class="sui-box-settings-col-1">
534 <span class="sui-settings-label"><?php esc_html_e( 'Ignored Query Strings', 'powered-cache' ); ?></span>
535 </div>
536 <div class="sui-box-settings-col-2">
537 <div class="sui-row">
538 <div class="sui-col-md-8">
539 <div class="sui-form-field">
540 <label for="ignored_query_strings" class="sui-label"><i><?php esc_html_e( 'Enter allowed query parameter (one per line)', 'powered-cache' ); ?></i></label>
541 <textarea
542 placeholder="utm_"
543 id="ignored_query_strings"
544 name="ignored_query_strings"
545 class="sui-form-control"
546 aria-describedby="ignored_query_strings_description"
547 rows="5"
548 ><?php echo esc_textarea( $settings['ignored_query_strings'] ); ?></textarea>
549 <span id="ignored_query_strings_description" class="sui-description">
550 <?php esc_html_e( 'Powered Cache will ignore these query string and serve the standard cache file. Tracking parameters such as utm_* ignored by default.', 'powered-cache' ); ?>
551 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'ignored-query-strings' ) ); ?>" target="_blank">(?)</a>
552 </span>
553 </div>
554 </div>
555 </div>
556 </div>
557 </div>
558
559 <!-- Purge Additional Pages -->
560 <div class="sui-box-settings-row">
561 <div class="sui-box-settings-col-1">
562 <span class="sui-settings-label"><?php esc_html_e( 'Purge Additional Pages', 'powered-cache' ); ?></span>
563 </div>
564
565 <div class="sui-box-settings-col-2">
566 <div class="sui-row">
567 <div class="sui-col-md-8">
568 <div class="sui-form-field">
569 <label for="purge_additional_pages" class="sui-label"><i><?php esc_html_e( 'Enter additional pages will purged (one per line)', 'powered-cache' ); ?></i></label>
570 <textarea
571 placeholder="/sample-page"
572 id="purge_additional_pages"
573 name="purge_additional_pages"
574 class="sui-form-control"
575 aria-describedby="purge_additional_pages_description"
576 rows="5"
577 ><?php echo esc_textarea( $settings['purge_additional_pages'] ); ?></textarea>
578 <span id="purge_additional_pages_description" class="sui-description">
579 <?php esc_html_e( 'Powered Cache is smart enough to purge only necessary pages during the post changes, however sometimes particular pages need to purge. (eg. the pages that use custom shortcode)', 'powered-cache' ); ?>
580 <a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'purge-additional-pages' ) ); ?>" target="_blank">(?)</a>
581 </span>
582 </div>
583 </div>
584 </div>
585 </div>
586 </div>
587
588 </div>
589 <div class="sui-box-footer">
590 <?php require 'settings-form-action.php'; ?>
591 </div>
592 </div>
593
594 <!-- TAB: File Optimization -->
595 <div class="sui-box" id="file-optimization" data-tab="file-optimization" style="display: none;">
596
597 <div class="sui-box-header">
598 <h2 class="sui-box-title"><?php esc_html_e( 'File Optimization', 'powered-cache' ); ?></h2>
599 </div>
600
601 <div class="sui-box-body sui-upsell-items">
602 <?php
603 /**
604 * Fires before file optimization section
605 *
606 * @hook powered_cache_admin_page_before_file_optimization
607 *
608 * @since 2.0
609 */
610 do_action( 'powered_cache_admin_page_before_file_optimization' );
611 ?>
612 <!-- Basic Settings -->
613 <div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_basic_settings_classes', 'sui-box-settings-row ' ) ); ?>">
614 <div class="sui-box-settings-col-1">
615 <span class="sui-settings-label"><?php esc_html_e( 'Basic Settings', 'powered-cache' ); ?></span>
616 </div>
617
618 <div class="sui-box-settings-col-2">
619 <div class="sui-form-field">
620 <label for="minify_html" class="sui-toggle">
621 <input
622 type="checkbox"
623 id="minify_html"
624 name="minify_html"
625 aria-labelledby="minify_html_label"
626 aria-controls="minify_html_dom_optimization_control"
627 value="1"
628 <?php checked( 1, $settings['minify_html'] ); ?>
629 >
630 <span class="sui-toggle-slider" aria-hidden="true"></span>
631 <span id="minify_html_label" class="sui-toggle-label"><?php esc_html_e( 'Minify HTML', 'powered-cache' ); ?></span>
632 <span id="minify_html_label_description" class="sui-description"><?php esc_html_e( 'Removes all whitespace characters from the HTML output, minimizing the HTML size.', 'powered-cache' ); ?></span>
633 </label>
634 </div>
635
636 <div style=" <?php echo( ! $settings['minify_html'] ? 'display:none' : '' ); ?>" tabindex="0" id="minify_html_dom_optimization_control">
637 <div class="sui-form-field">
638 <label for="minify_html_dom_optimization" class="sui-toggle">
639 <input type="checkbox"
640 value="1"
641 name="minify_html_dom_optimization"
642 id="minify_html_dom_optimization"
643 <?php checked( 1, $settings['minify_html_dom_optimization'] ); ?>
644 >
645 <span class="sui-toggle-slider" aria-hidden="true"></span>
646 <span id="minify_html_dom_optimization_label" class="sui-toggle-label"><?php esc_html_e( 'Optimize HTML via Dom Parser', 'powered-cache' ); ?></span>
647 <span id="minify_html_dom_optimization_description" class="sui-description">
648 <?php esc_html_e( 'Improves HTML minification efficiency.', 'powered-cache' ); ?>
649 </span>
650 </label>
651 <br>
652 </div>
653 </div>
654
655 <div class="sui-form-field">
656 <label for="combine_google_fonts" class="sui-toggle">
657 <input
658 type="checkbox"
659 id="combine_google_fonts"
660 name="combine_google_fonts"
661 aria-labelledby="combine_google_fonts_label"
662 aria-controls="swap_google_fonts_display_control"
663 value="1"
664 <?php checked( 1, $settings['combine_google_fonts'] ); ?>
665 >
666 <span class="sui-toggle-slider" aria-hidden="true"></span>
667 <span id="combine_google_fonts_label" class="sui-toggle-label"><?php esc_html_e( 'Combine Google Fonts', 'powered-cache' ); ?></span>
668 <span id="combine-google-fonts-description" class="sui-description">
669 <?php esc_html_e( 'Combines all Google Fonts URLs into a single URL and optimizes loading of that URL.', 'powered-cache' ); ?>
670 <a href="<?php echo esc_url( get_doc_url( '/combine-google-fonts/' ) ); ?>" target="_blank">(?)</a>
671 </span>
672 </label>
673 </div>
674
675 <div style=" <?php echo( ! $settings['combine_google_fonts'] ? 'display:none' : '' ); ?>" tabindex="0" id="swap_google_fonts_display_control">
676 <div class="sui-form-field">
677 <label for="swap_google_fonts_display" class="sui-toggle">
678 <input type="checkbox"
679 value="1"
680 name="swap_google_fonts_display"
681 id="swap_google_fonts_display"
682 <?php checked( 1, $settings['swap_google_fonts_display'] ); ?>
683 >
684 <span class="sui-toggle-slider" aria-hidden="true"></span>
685 <span id="swap_google_fonts_display_label" class="sui-toggle-label"><?php esc_html_e( 'Swap Google Fonts Display', 'powered-cache' ); ?></span>
686 <span id="swap_google_fonts_display_description" class="sui-description">
687 <?php esc_html_e( 'Ensure text remains visible during webfont load.', 'powered-cache' ); ?>
688 </span>
689 </label>
690 <br>
691 </div>
692 </div>
693 <div class="sui-form-field">
694 <label for="use_bunny_fonts" class="sui-toggle">
695 <input type="checkbox"
696 value="1"
697 name="use_bunny_fonts"
698 id="use_bunny_fonts"
699 <?php checked( 1, $settings['use_bunny_fonts'] ); ?>
700 >
701 <span class="sui-toggle-slider" aria-hidden="true"></span>
702 <span id="use_bunny_fonts_label" class="sui-toggle-label"><?php esc_html_e( 'Use Bunny Fonts', 'powered-cache' ); ?></span>
703 <span id="use_bunny_fonts_description" class="sui-description">
704 <?php esc_html_e( 'Use Bunny Fonts as drop-in replacement for Google Fonts', 'powered-cache' ); ?>
705 </span>
706 </label>
707 </div>
708
709
710 </div>
711 </div>
712
713 <!-- CSS Files -->
714 <div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_css_classes', 'sui-box-settings-row ' ) ); ?>">
715 <div class="sui-box-settings-col-1">
716 <span class="sui-settings-label"><?php esc_html_e( 'CSS Optimization', 'powered-cache' ); ?>
717 <a href="<?php echo esc_url( get_doc_url( '/css-optimization/' ) ); ?>" target="_blank">(?)</a>
718 </span>
719 </div>
720
721 <div class="sui-box-settings-col-2">
722
723 <div class="sui-form-field">
724 <label for="minify_css" class="sui-toggle">
725 <input
726 type="checkbox"
727 id="minify_css"
728 name="minify_css"
729 aria-labelledby="minify_css_label"
730 value="1"
731 <?php checked( 1, $settings['minify_css'] ); ?>
732 >
733 <span class="sui-toggle-slider" aria-hidden="true"></span>
734 <span id="minify_css_label" class="sui-toggle-label"><?php esc_html_e( 'Minify CSS' ); ?></span>
735 <span id="minify_css_description" class="sui-description"><?php esc_html_e( 'Minify CSS files', 'powered-cache' ); ?></span>
736 </label>
737 </div>
738
739 <div class="sui-form-field">
740 <label for="combine_css" class="sui-toggle">
741 <input
742 type="checkbox"
743 id="combine_css"
744 name="combine_css"
745 aria-labelledby="combine_css_label"
746 value="1"
747 <?php checked( 1, $settings['combine_css'] ); ?>
748 >
749 <span class="sui-toggle-slider" aria-hidden="true"></span>
750 <span id="combine_css_label" class="sui-toggle-label"><?php esc_html_e( 'Combine CSS files' ); ?></span>
751 <span id="combine_css_description" class="sui-description"><?php esc_html_e( 'Combine CSS files to reduce HTTP requests', 'powered-cache' ); ?></span>
752 </label>
753 </div>
754
755 <div class="sui-row">
756 <div class="sui-col-md-8">
757 <div class="sui-form-field">
758 <label for="excluded_css_files" class="sui-label"><i><?php esc_html_e( 'CSS files to exclude (one per line)', 'powered-cache' ); ?></i></label>
759 <textarea
760 placeholder="e.g /wp-content/themes/example/style/custom.css"
761 id="excluded_css_files"
762 name="excluded_css_files"
763 class="sui-form-control"
764 aria-describedby="excluded_css_files_description"
765 rows="5"
766 ><?php echo esc_textarea( $settings['excluded_css_files'] ); ?></textarea>
767 <span id="excluded_css_files_description" class="sui-description">
768 <?php esc_html_e( 'Listed files will not get minified or combined', 'powered-cache' ); ?>
769 </span>
770 </div>
771 </div>
772 </div>
773 </div>
774 </div>
775
776 <!-- Critical CSS -->
777 <div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_critical_css_classes', 'sui-box-settings-row ' ) ); ?> <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
778 <div class="sui-box-settings-col-1">
779 <span class="sui-settings-label"><?php esc_html_e( 'Critical CSS', 'powered-cache' ); ?>
780 <a href="<?php echo esc_url( get_doc_url( '/critical-css/' ) ); ?>" target="_blank">(?)</a>
781 <?php if ( ! is_premium() ) : ?>
782 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
783 <?php endif; ?>
784 </span>
785 <span class="sui-description"><?php esc_html_e( 'Extract & Inline Critical-path CSS from HTML', 'powered-cache' ); ?></span>
786 </div>
787
788 <div class="sui-box-settings-col-2">
789
790 <div class="sui-form-field">
791 <label for="critical_css" class="sui-toggle">
792 <input
793 type="checkbox"
794 id="critical_css"
795 name="critical_css"
796 aria-labelledby="critical_css_label"
797 aria-controls="critical_css_fallback_controls"
798 value="1"
799 <?php checked( 1, $settings['critical_css'] ); ?>
800 >
801 <span class="sui-toggle-slider" aria-hidden="true"></span>
802 <span id="critical_css_label" class="sui-toggle-label"><?php esc_html_e( ' Critical CSS' ); ?></span>
803 <span id="critical_css_description" class="sui-description"><?php esc_html_e( 'Critical CSS is a technique that extracts the CSS above the fold to display the page as quickly as possible.', 'powered-cache' ); ?></span>
804 </label>
805 </div>
806
807 <div style=" <?php echo( ! $settings['critical_css'] ? 'display:none' : '' ); ?>" tabindex="0" id="critical_css_fallback_controls">
808 <div class="sui-row">
809 <div class="sui-col-md-8">
810 <div class="sui-form-field">
811 <label for="critical_css_additional_files" class="sui-label"><i><?php esc_html_e( 'Additional files to critical (one per line)', 'powered-cache' ); ?></i></label>
812 <textarea
813 id="critical_css_additional_files"
814 name="critical_css_additional_files"
815 class="sui-form-control"
816 aria-describedby="critical_css_additional_files_description"
817 rows="5"
818 ><?php echo esc_textarea( $settings['critical_css_additional_files'] ); // phpcs:ignore ?></textarea>
819 <span id="critical_css_additional_files_description" class="sui-description">
820 <?php esc_html_e( 'Critical CSS uses resources found in the head section of the page. If you need to include additional resources, add them here.', 'powered-cache' ); ?>
821 </span>
822 </div>
823 </div>
824 </div>
825 <div class="sui-row">
826 <div class="sui-col-md-8">
827 <div class="sui-form-field">
828 <label for="critical_css_excluded_files" class="sui-label"><i><?php esc_html_e( 'Excluded files from critical (one per line)', 'powered-cache' ); ?></i></label>
829 <textarea
830 id="critical_css_excluded_files"
831 name="critical_css_excluded_files"
832 class="sui-form-control"
833 aria-describedby="critical_css_excluded_files_description"
834 rows="5"
835 ><?php echo esc_textarea( $settings['critical_css_excluded_files'] ); // phpcs:ignore ?></textarea>
836 <span id="critical_css_excluded_files_description" class="sui-description">
837 <?php esc_html_e( 'Ignore these files during the Critical CSS generation.', 'powered-cache' ); ?>
838 </span>
839 </div>
840 </div>
841 </div>
842 <div class="sui-row">
843 <div class="sui-col-md-8">
844 <div class="sui-form-field">
845 <label for="critical_css_appended_content" class="sui-label"><i><?php esc_html_e( 'Append to Critical CSS', 'powered-cache' ); ?></i></label>
846 <textarea
847 id="critical_css_appended_content"
848 name="critical_css_appended_content"
849 class="sui-form-control"
850 aria-describedby="critical_css_appended_content_description"
851 rows="5"
852 ><?php echo wp_unslash( sanitize_css( $settings['critical_css_appended_content'] ) ); // phpcs:ignore ?></textarea>
853 <span id="critical_css_appended_content_description" class="sui-description">
854 <?php esc_html_e( 'Extend Critical CSS by appending custom CSS here.', 'powered-cache' ); ?>
855 </span>
856 </div>
857 </div>
858 </div>
859 <div class="sui-row">
860 <div class="sui-col-md-8">
861 <div class="sui-form-field">
862 <label for="critical_css_fallback" class="sui-label"><i><?php esc_html_e( 'Fallback Critical CSS ', 'powered-cache' ); ?></i></label>
863 <textarea
864 id="critical_css_fallback"
865 name="critical_css_fallback"
866 class="sui-form-control"
867 aria-describedby="critical_css_fallback_description"
868 rows="5"
869 ><?php echo wp_unslash( sanitize_css( $settings['critical_css_fallback'] ) ); // phpcs:ignore ?></textarea>
870 <span id="critical_css_fallback_description" class="sui-description">
871 <?php esc_html_e( 'The fallback CSS if auto-generated CSS is incomplete.', 'powered-cache' ); ?>
872 </span>
873 </div>
874 </div>
875 </div>
876
877 </div>
878 </div>
879 </div>
880
881
882 <!-- Unused CSS -->
883 <div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_ucss_classes', 'sui-box-settings-row ' ) ); ?> <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
884 <div class="sui-box-settings-col-1">
885 <span class="sui-settings-label"><?php esc_html_e( 'Unused CSS', 'powered-cache' ); ?>
886 <a href="<?php echo esc_url( get_doc_url( '/remove-unused-css/' ) ); ?>" target="_blank">(?)</a>
887 <?php if ( ! is_premium() ) : ?>
888 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
889 <?php endif; ?>
890 </span>
891 <span class="sui-description"><?php esc_html_e( 'Remove Unused CSS', 'powered-cache' ); ?></span>
892 </div>
893
894 <div class="sui-box-settings-col-2">
895 <div class="sui-form-field">
896 <label for="remove_unused_css" class="sui-toggle">
897 <input
898 type="checkbox"
899 id="remove_unused_css"
900 name="remove_unused_css"
901 aria-labelledby="remove_unused_css_label"
902 aria-controls="remove_unused_css_safelist"
903 value="1"
904 <?php checked( 1, $settings['remove_unused_css'] ); ?>
905 >
906 <span class="sui-toggle-slider" aria-hidden="true"></span>
907 <span id="remove_unused_css_label" class="sui-toggle-label"><?php esc_html_e( 'Remove Unused CSS' ); ?></span>
908 <span id="remove_unused_css_description" class="sui-description"><?php esc_html_e( 'It reduces page size by removing all CSS and stylesheets that are not used while keeping only the used CSS.', 'powered-cache' ); ?></span>
909 </label>
910 </div>
911
912 <div style=" <?php echo( ! $settings['remove_unused_css'] ? 'display:none' : '' ); ?>" tabindex="0" id="remove_unused_css_safelist">
913 <div class="sui-row">
914 <div class="sui-col-md-8">
915 <div class="sui-form-field">
916 <label for="ucss_safelist" class="sui-label"><i><?php esc_html_e( 'Safelist', 'powered-cache' ); ?></i></label>
917 <textarea
918 id="ucss_safelist"
919 name="ucss_safelist"
920 class="sui-form-control"
921 aria-describedby="ucss_safelist_description"
922 rows="5"
923 ><?php echo esc_textarea( $settings['ucss_safelist'] ); // phpcs:ignore ?></textarea>
924 <span id="ucss_safelist_description" class="sui-description">
925 <?php esc_html_e( 'Specify CSS selectors that should not be removed. (one per line)', 'powered-cache' ); ?>
926 </span>
927 </div>
928 </div>
929 </div>
930 <div class="sui-row">
931 <div class="sui-col-md-8">
932 <div class="sui-form-field">
933 <label for="ucss_excluded_files" class="sui-label"><i><?php esc_html_e( 'Excluded files', 'powered-cache' ); ?></i></label>
934 <textarea
935 id="ucss_excluded_files"
936 name="ucss_excluded_files"
937 class="sui-form-control"
938 aria-describedby="ucss_excluded_files_description"
939 rows="5"
940 ><?php echo esc_textarea( $settings['ucss_excluded_files'] ); // phpcs:ignore ?></textarea>
941 <span id="ucss_excluded_files_description" class="sui-description">
942 <?php esc_html_e( 'Specify CSS files that should be ignored during the UCSS generation process. (one per line)', 'powered-cache' ); ?>
943 </span>
944 </div>
945 </div>
946 </div>
947 </div>
948
949 </div>
950 </div>
951
952
953 <!-- JS Files -->
954 <div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_js_classes', 'sui-box-settings-row ' ) ); ?>">
955 <div class="sui-box-settings-col-1">
956 <span class="sui-settings-label"><?php esc_html_e( 'JavaScript Optimization', 'powered-cache' ); ?>
957 <a href="<?php echo esc_url( get_doc_url( '/js-optimization/' ) ); ?>" target="_blank">(?)</a>
958 </span>
959 </div>
960
961 <div class="sui-box-settings-col-2">
962
963 <div class="sui-form-field">
964 <label for="minify_js" class="sui-toggle">
965 <input
966 type="checkbox"
967 id="minify_js"
968 name="minify_js"
969 aria-labelledby="minify_js_label"
970 aria-controls="excluded_js_files_field"
971 value="1"
972 <?php checked( 1, $settings['minify_js'] ); ?>
973 >
974 <span class="sui-toggle-slider" aria-hidden="true"></span>
975 <span id="minify_js_label" class="sui-toggle-label"><?php esc_html_e( 'Minify JavaScript Files', 'powered-cache' ); ?></span>
976 <span id="minify_js_description" class="sui-description"><?php esc_html_e( 'Removes whitespace and comments to reduce file size', 'powered-cache' ); ?></span>
977 </label>
978 </div>
979
980 <div class="sui-form-field">
981 <label for="combine_js" class="sui-toggle">
982 <input
983 type="checkbox"
984 id="combine_js"
985 name="combine_js"
986 aria-labelledby="combine_js_label"
987 value="1"
988 <?php checked( 1, $settings['combine_js'] ); ?>
989 <?php disabled( false, ( $settings['minify_js'] && ! $settings['js_delay'] ) ); ?>
990 >
991 <span class="sui-toggle-slider" aria-hidden="true"></span>
992 <span id="combine_js_label" class="sui-toggle-label"><?php esc_html_e( 'Combine JavaScript Files', 'powered-cache' ); ?></span>
993 <span id="combine_js_description" class="sui-description"><?php esc_html_e( 'Combines JS files into fewer files to reduce HTTP requests. If your site is using HTTP/2, it is not recommended to proceed with this option.', 'powered-cache' ); ?></span>
994 <div role="alert" class="sui-notice sui-notice-blue sui-active" aria-live="assertive" style="display: block;">
995 <div class="sui-notice-content">
996 <div class="sui-notice-message">
997 <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
998 <p>
999 <?php esc_html_e( 'For compatibility reasons, this option will only work when delayed JavaScript execution is not activated and it requires minification to be enabled.', 'powered-cache' ); ?>
1000 </p>
1001 </div>
1002 </div>
1003 </div>
1004 </label>
1005 </div>
1006
1007 <div style=" <?php echo( ! $settings['minify_js'] ? 'display:none' : '' ); ?>" class="sui-form-field" tabindex="0" id="excluded_js_files_field">
1008 <div class="sui-row">
1009 <div class="sui-col-md-8">
1010 <label for="excluded_js_files" class="sui-label"><i><?php esc_html_e( 'Exclusions', 'powered-cache' ); ?></i></label>
1011 <textarea
1012 placeholder="e.g /wp-content/themes/example/js/custom.js"
1013 id="excluded_js_files"
1014 name="excluded_js_files"
1015 class="sui-form-control"
1016 aria-describedby="excluded_js_files_description"
1017 rows="5"
1018 ><?php echo esc_textarea( $settings['excluded_js_files'] ); ?></textarea>
1019 <span id="excluded_js_files_description" class="sui-description">
1020 <?php esc_html_e( 'JavaScript files to exclude. Listed files will not get minified or combined (one per line).', 'powered-cache' ); ?>
1021 <?php echo wp_kses_post( __( 'You can use <i>(.*)</i> for matching all files for a path.', 'powered-cache' ) ); ?>
1022 <a href="<?php echo esc_url( get_doc_url( '/js-optimization/' ) ); ?>" target="_blank">(?)</a>
1023 </span>
1024 </div>
1025 </div>
1026 </div>
1027
1028 <div class="sui-form-field">
1029 <label for="js_defer" class="sui-toggle">
1030 <input
1031 type="checkbox"
1032 id="js_defer"
1033 name="js_defer"
1034 aria-labelledby="js_defer_label"
1035 aria-controls="js_defer_exclusions_field"
1036 value="1"
1037 <?php checked( 1, $settings['js_defer'] ); ?>
1038 >
1039 <span class="sui-toggle-slider" aria-hidden="true"></span>
1040 <span id="js_defer_label" class="sui-toggle-label"><?php esc_html_e( 'Load JavaScript deferred', 'powered-cache' ); ?></span>
1041 <span id="js_defer_description" class="sui-description"><?php esc_html_e( 'Avoid render-blocking scripts by deferring them.', 'powered-cache' ); ?></span>
1042 </label>
1043 </div>
1044
1045 <div style=" <?php echo( ! $settings['js_defer'] ? 'display:none' : '' ); ?>" class="sui-form-field" tabindex="0" id="js_defer_exclusions_field">
1046 <div class="sui-row">
1047 <div class="sui-col-md-8">
1048 <label for="js_defer_exclusions" class="sui-label"><i><?php esc_html_e( 'Exclusions', 'powered-cache' ); ?></i></label>
1049 <textarea
1050 placeholder="e.g /wp-content/plugins/example/js/(.*)"
1051 id="js_defer_exclusions"
1052 name="js_defer_exclusions"
1053 class="sui-form-control"
1054 aria-describedby="js_defer_exclusions_description"
1055 rows="5"
1056 ><?php echo esc_textarea( $settings['js_defer_exclusions'] ); // phpcs:ignore ?></textarea>
1057 <span id="js_defer_exclusions_description" class="sui-description">
1058 <?php esc_html_e( 'Listed files will not get deferred (one per line).', 'powered-cache' ); ?>
1059 <?php echo wp_kses_post( __( 'You can use <i>(.*)</i> for matching all files for a path.', 'powered-cache' ) ); ?>
1060 </span>
1061 </div>
1062
1063 </div>
1064 </div>
1065
1066
1067 <div class="sui-form-field">
1068 <label for="js_delay" class="sui-toggle">
1069 <input
1070 type="checkbox"
1071 id="js_delay"
1072 name="js_delay"
1073 aria-labelledby="js_delay_label"
1074 aria-controls="js_delay_exclusions_field"
1075 value="1"
1076 <?php
1077 checked( 1, $settings['js_delay'] );
1078 ?>
1079 >
1080 <span class="sui-toggle-slider" aria-hidden="true"></span>
1081 <span id="js_delay_label" class="sui-toggle-label"><?php esc_html_e( 'Delay JavaScript execution', 'powered-cache' ); ?></span>
1082 <span id="js_delay_description" class="sui-description"><?php esc_html_e( 'Execute scripts following user interactions such as mouse movements, keyboard inputs, or scrolling. This technique enhances the page\'s loading time and boosts overall performance.', 'powered-cache' ); ?></span>
1083 </label>
1084 </div>
1085
1086 <div class="sui-form-field" style=" <?php echo( ! $settings['js_delay'] ? 'display:none' : '' ); ?>" tabindex="0" id="js_delay_exclusions_field">
1087 <div class="sui-row">
1088 <div class="sui-col-md-8">
1089 <label for="js_delay_exclusions" class="sui-label"><i><?php esc_html_e( 'Exclusions', 'powered-cache' ); ?></i></label>
1090 <textarea
1091 placeholder="e.g /wp-content/themes/example/js/(.*)"
1092 id="js_delay_exclusions"
1093 name="js_delay_exclusions"
1094 class="sui-form-control"
1095 aria-describedby="js_delay_exclusions_description"
1096 rows="5"
1097 ><?php echo esc_textarea( $settings['js_delay_exclusions'] ); // phpcs:ignore ?></textarea>
1098 <span id="js_delay_exclusions_description" class="sui-description">
1099 <?php esc_html_e( 'Listed files will not get delayed (one per line).', 'powered-cache' ); ?>
1100 <?php echo wp_kses_post( __( 'You can use <i>(.*)</i> for matching all files for a path.', 'powered-cache' ) ); ?>
1101 </span>
1102 </div>
1103 </div>
1104 <div class="sui-row">
1105 <div class="sui-col-md-8">
1106 <span for="js-delay-default-exclusions" class="sui-label"><i><?php esc_html_e( 'If you have problems after enabling delay JavaScript execution, you can copy-paste following exceptions and see if the problem resolved.', 'powered-cache' ); ?></i></span>
1107 <pre class="sui-code-snippet" id="js-delay-default-exclusions">
1108 /wp-content(.*)
1109 /wp-includes(.*)
1110 js-(before|after|extra)</pre>
1111 </div>
1112 <span id="js_delay_exclusions_description" class="sui-description">
1113 <?php esc_html_e( 'These rules will skip delays for JavaScript files loaded through WordPress core, themes, and plugins.', 'powered-cache' ); ?>
1114 <a href="<?php echo esc_url( get_doc_url( '/js-execution/' ) ); ?>" target="_blank">(?)</a>
1115 </span>
1116 </div>
1117
1118 <div class="sui-row sui-border-frame">
1119 <div class="sui-form-field">
1120 <label for="js_delay_timeout" id="js_delay_timeout-label" class="sui-label"><?php esc_html_e( 'Delay Timeout', 'powered-cache' ); ?></label>
1121 <input
1122 name="js_delay_timeout"
1123 value="<?php echo esc_attr( $settings['js_delay_timeout'] ); ?>"
1124 id="js_delay_timeout"
1125 class="sui-form-control sui-field-has-suffix"
1126 type="number"
1127 min="0"
1128 max="100000"
1129 />
1130 <span class="sui-field-suffix">
1131 <span class="sui-description"><?php esc_html_e( 'Milliseconds', 'powered-cache' ); ?></span>
1132 </span>
1133 <span class="sui-description"><?php esc_html_e( 'Enter a delay in milliseconds for auto-loading JavaScript if no user interaction occurs. With a delay above 0, the script loads after the set time or upon any user action, whichever comes first. Enter 0 to disable. (1000ms = 1s)', 'powered-cache' ); ?></span>
1134 </div>
1135 </div>
1136 </div>
1137
1138 </div>
1139 </div>
1140
1141
1142 <?php if ( can_control_all_settings() ) : ?>
1143 <div class="sui-box-settings-row">
1144 <div class="sui-box-settings-col-1">
1145 <span class="sui-settings-label"><?php esc_html_e( 'Rewrite File Optimizer', 'powered-cache' ); ?></span>
1146 <span class="sui-description"></span>
1147 </div>
1148
1149 <div class="sui-box-settings-col-2">
1150 <div class="sui-form-field">
1151 <label for="rewrite_file_optimizer" id="rewrite_file_optimizer_label" class="sui-toggle">
1152 <input
1153 type="checkbox"
1154 id="rewrite_file_optimizer"
1155 name="rewrite_file_optimizer"
1156 aria-labelledby="rewrite_file_optimizer_label"
1157 aria-describedby="enable_rewrite_file_optimizer_description"
1158 value="1"
1159 <?php checked( 1, $settings['rewrite_file_optimizer'] ); ?>
1160 >
1161 <span class="sui-toggle-slider" aria-hidden="true"></span>
1162 <span id="enable_rewrite_file_optimizer_label" class="sui-toggle-label"><?php esc_html_e( 'Enable rewrite for file optimizer.', 'powered-cache' ); ?></span>
1163 <span id="enable_rewrite_file_optimizer_description" class="sui-description">
1164 <?php echo wp_kses_post( __( 'This feature uses <code>/_static/??</code> instead <code>file-optimizer.php??</code> for file optimization requests. If automatic .htaccess configuration is enabled, the necessary settings will be applied automatically. If not, you will need to manually add the appropriate rewrite rules.</a>', 'powered-cache' ) ); ?>
1165 <a href="<?php echo esc_url( get_doc_url( 'rewrite-file-optimizer' ) ); ?>" target="_blank"><?php esc_html_e( '(?)', 'powered-cache' ); ?></a>
1166 </span>
1167 </label>
1168 </div>
1169 <?php if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) : ?>
1170 <div role="alert" class="sui-notice sui-notice-yellow sui-active" aria-live="assertive" style="display: block;">
1171 <div class="sui-notice-content">
1172 <div class="sui-notice-message">
1173 <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
1174 <p>
1175 <?php esc_html_e( 'This feature may not work on Windows servers without manual .htaccess configuration.', 'powered-cache' ); ?>
1176 </p>
1177 </div>
1178 </div>
1179 </div>
1180 <?php endif; ?>
1181 </div>
1182 </div>
1183 <?php endif; ?>
1184
1185
1186 </div>
1187
1188 <div class="sui-box-footer">
1189 <?php require 'settings-form-action.php'; ?>
1190 </div>
1191 </div>
1192
1193 <!-- TAB: Media -->
1194 <div class="sui-box" id="media-optimization" data-tab="media-optimization" style="display: none;">
1195
1196 <div class="sui-box-header">
1197 <h2 class="sui-box-title"><?php esc_html_e( 'Media Optimization', 'powered-cache' ); ?></h2>
1198 </div>
1199
1200 <div class="sui-box-body">
1201 <?php do_action( 'powered_cache_admin_page_before_media_optimization' ); ?>
1202 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
1203
1204 <div class="sui-box-settings-col-1">
1205 <span class="sui-settings-label"><?php esc_html_e( 'Image Optimization', 'powered-cache' ); ?>
1206 <?php if ( ! is_premium() ) : ?>
1207 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
1208 <?php endif; ?>
1209 </span>
1210 <span class="sui-description"></span>
1211 </div>
1212
1213 <div class="sui-box-settings-col-2">
1214 <div class="sui-form-field">
1215 <label for="enable_image_optimization" class="sui-toggle">
1216 <input
1217 type="checkbox"
1218 id="enable_image_optimization"
1219 name="enable_image_optimization"
1220 aria-labelledby="enable_image_optimization_label"
1221 aria-describedby="enable_image_optimization_description"
1222 aria-controls="image-optimizer-details"
1223 value="1"
1224 <?php checked( 1, $settings['enable_image_optimization'] ); ?>
1225 >
1226 <span class="sui-toggle-slider" aria-hidden="true"></span>
1227 <span id="enable_image_optimization_label" class="sui-toggle-label"><?php esc_html_e( 'Enable Image Optimization Service', 'powered-cache' ); ?></span>
1228 <span id="enable_image_optimization_description" class="sui-description"><?php esc_html_e( "Our image optimization service instantly optimizes images from our global network of servers. Images will be served in the AVIF format when supported by the user's browser. If AVIF is not supported, the WebP format will be used as a fallback, ensuring efficient loading and high-quality visuals.", 'powered-cache' ); ?>
1229 <a href="<?php echo esc_url( get_doc_url( '/image-optimization/' ) ); ?>" target="_blank">(?)</a>
1230 </span>
1231 </label>
1232 </div>
1233
1234 <div style="<?php echo( ! $settings['enable_image_optimization'] ? 'display:none' : '' ); ?>" tabindex="0" id="image-optimizer-details">
1235 <div class="sui-form-field">
1236 <label for="image_optimizer_preferred_format" class="sui-toggle">
1237 <input
1238 type="checkbox"
1239 id="image_optimizer_preferred_format"
1240 name="image_optimizer_preferred_format"
1241 aria-labelledby="image_optimizer_preferred_format_label"
1242 aria-describedby="image_optimizer_preferred_format_description"
1243 value="webp"
1244 <?php checked( 'webp', $settings['image_optimizer_preferred_format'] ); ?>
1245 >
1246 <span class="sui-toggle-slider" aria-hidden="true"></span>
1247 <span id="image_optimizer_preferred_format_label" class="sui-toggle-label"><?php esc_html_e( 'Use WebP over AVIF', 'powered-cache' ); ?></span>
1248 <span id="image_optimizer_preferred_format_description" class="sui-description">
1249 <?php esc_html_e( 'Activate this option to prioritize the WebP format over AVIF for image optimization.', 'powered-cache' ); ?>
1250 </span>
1251 </label>
1252 </div>
1253 <?php if ( ! is_multisite() && ! is_local_site() && is_premium() ) : ?>
1254 <div class="sui-form-field">
1255 <a
1256 href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=powered_cache_purge_image_optimizer' ), 'powered_cache_purge_image_optimizer' ) ); ?>"
1257 class="sui-button sui-button-ghost" id="clear_image_optimizer_cache">
1258 <?php esc_html_e( 'Clear Image Optimizer Cache', 'powered-cache' ); ?>
1259 </a>
1260 </div>
1261 <?php endif; ?>
1262 </div>
1263
1264 </div>
1265 </div>
1266
1267 <!-- Lazy Load settings -->
1268
1269 <div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_lazy_load_settings_classes', 'sui-box-settings-row' ) ); ?>">
1270
1271 <div class="sui-box-settings-col-1">
1272 <span class="sui-settings-label"><?php esc_html_e( 'Lazy Load', 'powered-cache' ); ?></span>
1273 <span class="sui-description">
1274 <?php esc_html_e( 'Loads images and iframes only when visible to the user.', 'powered-cache' ); ?>
1275 <a href="<?php echo esc_url( get_doc_url( '/enable-lazy-load/' ) ); ?>" target="_blank">(?)</a>
1276 </span>
1277 </div>
1278
1279 <div class="sui-box-settings-col-2">
1280
1281 <div class="sui-form-field">
1282 <div class="sui-row ">
1283 <label for="enable_lazy_load" class="sui-toggle">
1284 <input
1285 type="checkbox"
1286 id="enable_lazy_load"
1287 name="enable_lazy_load"
1288 aria-labelledby="enable_lazy_load_label"
1289 aria-controls="lazy-load-details"
1290 value="1"
1291 <?php checked( 1, $settings['enable_lazy_load'] ); ?>
1292 >
1293 <span class="sui-toggle-slider" aria-hidden="true"></span>
1294 <span id="enable_lazy_load_label" class="sui-toggle-label"><?php esc_html_e( 'Enable Lazy Load', 'powered-cache' ); ?></span>
1295 </label>
1296 </div>
1297
1298 <div style="<?php echo( ! $settings['enable_lazy_load'] ? 'display:none' : '' ); ?>" tabindex="0" id="lazy-load-details">
1299 <div class="sui-border-frame">
1300 <div class="sui-form-field">
1301 <div class="sui-row">
1302 <label for="lazy_load_post_content" class="sui-checkbox">
1303
1304 <input
1305 type="checkbox"
1306 id="lazy_load_post_content"
1307 name="lazy_load_post_content"
1308 value="1"
1309 <?php checked( 1, $settings['lazy_load_post_content'] ); ?>
1310 >
1311
1312 <span aria-hidden="true"></span>
1313 <span id="lazy_load_post_content_label"><?php esc_html_e( 'Enable for post content.', 'powered-cache' ); ?></span>
1314 </label>
1315 </div>
1316
1317 <div class="sui-row">
1318 <label for="lazy_load_images" class="sui-checkbox">
1319
1320 <input
1321 type="checkbox"
1322 id="lazy_load_images"
1323 name="lazy_load_images"
1324 value="1"
1325 <?php checked( 1, $settings['lazy_load_images'] ); ?>
1326 >
1327
1328 <span aria-hidden="true"></span>
1329 <span id="lazy_load_images_label"><?php esc_html_e( 'Enable for images.', 'powered-cache' ); ?></span>
1330 </label>
1331 </div>
1332
1333 <div class="sui-row">
1334 <label for="lazy_load_iframes" class="sui-checkbox">
1335
1336 <input
1337 type="checkbox"
1338 id="lazy_load_iframes"
1339 name="lazy_load_iframes"
1340 value="1"
1341 <?php checked( 1, $settings['lazy_load_iframes'] ); ?>
1342 >
1343
1344 <span aria-hidden="true"></span>
1345 <span id="lazy_load_iframes_label"><?php esc_html_e( 'Enable for iframes.', 'powered-cache' ); ?></span>
1346 </label>
1347 </div>
1348 <div class="sui-row">
1349 <label for="lazy_load_widgets" class="sui-checkbox">
1350
1351 <input
1352 type="checkbox"
1353 id="lazy_load_widgets"
1354 name="lazy_load_widgets"
1355 value="1"
1356 <?php checked( 1, $settings['lazy_load_widgets'] ); ?>
1357 >
1358
1359 <span aria-hidden="true"></span>
1360 <span id="lazy_load_widgets_label"><?php esc_html_e( 'Enable for widgets.', 'powered-cache' ); ?></span>
1361 </label>
1362 </div>
1363 <div class="sui-row">
1364 <label for="lazy_load_post_thumbnail" class="sui-checkbox">
1365
1366 <input
1367 type="checkbox"
1368 id="lazy_load_post_thumbnail"
1369 name="lazy_load_post_thumbnail"
1370 value="1"
1371 <?php checked( 1, $settings['lazy_load_post_thumbnail'] ); ?>
1372 >
1373
1374 <span aria-hidden="true"></span>
1375 <span id="lazy_load_post_thumbnail_label"><?php esc_html_e( 'Enable for post thumbnails.', 'powered-cache' ); ?></span>
1376 </label>
1377 </div>
1378 <div class="sui-row">
1379 <label for="lazy_load_avatars" class="sui-checkbox">
1380
1381 <input
1382 type="checkbox"
1383 id="lazy_load_avatars"
1384 name="lazy_load_avatars"
1385 value="1"
1386 <?php checked( 1, $settings['lazy_load_avatars'] ); ?>
1387 >
1388
1389 <span aria-hidden="true"></span>
1390 <span id="lazy_load_avatars_label"><?php esc_html_e( 'Enable for avatars.', 'powered-cache' ); ?></span>
1391 </label>
1392 </div>
1393 <div class="sui-row">
1394 <label for="lazy_load_youtube" class="sui-checkbox">
1395
1396 <input
1397 type="checkbox"
1398 id="lazy_load_youtube"
1399 name="lazy_load_youtube"
1400 value="1"
1401 <?php checked( 1, $settings['lazy_load_youtube'] ); ?>
1402 >
1403
1404 <span aria-hidden="true"></span>
1405 <span id="lazy_load_youtube_label"><?php esc_html_e( 'Replace Youtube videos by thumbnail.', 'powered-cache' ); ?></span>
1406 </label>
1407 </div>
1408 </div>
1409 </div>
1410 <div class="sui-form-field">
1411 <span id="cdn_rejected_files_label" class="sui-settings-label"><?php esc_html_e( 'Excluded images or iframes', 'powered-cache' ); ?></span>
1412
1413 <textarea
1414 placeholder="/wp-content/themes/example/images/logo.png"
1415 id="lazy_load_exclusions"
1416 name="lazy_load_exclusions"
1417 class="sui-form-control"
1418 aria-labelledby="lazy_load_exclusions_label"
1419 aria-describedby="lazy_load_exclusions_description"
1420 rows="5"
1421 ><?php echo esc_textarea( $settings['lazy_load_exclusions'] ); ?></textarea>
1422 <span id="lazy_load_exclusions_description" class="sui-description">
1423 <?php esc_html_e( 'Specify keywords to exclude images or iframes from being lazy loaded. You can use full or partial strings, including the filename, CSS class, or domain. (one per line)', 'powered-cache' ); ?>
1424 <a href="<?php echo esc_url( get_doc_url( '/enable-lazy-load/' ) ); ?>" target="_blank">(?)</a>
1425 </span>
1426 </div>
1427
1428 <div class="sui-border-frame">
1429 <div class="sui-form-field">
1430 <label for="lazy_load_skip_first_nth_img" id="lazy_load_skip_first_nth_img-label">
1431 <?php esc_html_e( 'Lazy Load from nth image', 'powered-cache' ); ?>
1432 </label>
1433 <input
1434 name="lazy_load_skip_first_nth_img"
1435 value="<?php echo absint( $settings['lazy_load_skip_first_nth_img'] ); ?>"
1436 id="lazy_load_skip_first_nth_img"
1437 class="sui-form-control sui-field-has-suffix"
1438 type="number"
1439 min="0"
1440 max="30"
1441 />
1442 <div class="sui-description">
1443 <?php esc_html_e( 'Do not lazy load the first X images. This value can be modified to prevent the lazy loading of above-the-fold images, which otherwise could negatively affect the Largest Contentful Paint (LCP).', 'powered-cache' ); ?>
1444 </div>
1445 </div>
1446 </div>
1447 </div>
1448
1449 <div class="sui-row">
1450 <label for="disable_wp_lazy_load" class="sui-toggle">
1451 <input
1452 type="checkbox"
1453 id="disable_wp_lazy_load"
1454 name="disable_wp_lazy_load"
1455 aria-labelledby="disable_wp_lazy_load_label"
1456 value="1"
1457 <?php checked( 1, $settings['disable_wp_lazy_load'] ); ?>
1458 >
1459 <span class="sui-toggle-slider" aria-hidden="true"></span>
1460 <span id="disable_wp_lazy_load_label" class="sui-toggle-label"><?php esc_html_e( 'Disable WordPress Native Lazy Load', 'powered-cache' ); ?></span>
1461 </label>
1462 </div>
1463 </div>
1464 </div>
1465
1466 </div>
1467
1468 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
1469 <div class="sui-box-settings-col-1">
1470 <span class="sui-settings-label"><?php esc_html_e( 'Image Dimensions', 'powered-cache' ); ?>
1471 <?php if ( ! is_premium() ) : ?>
1472 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
1473 <?php endif; ?>
1474 </span>
1475 <span class="sui-description"></span>
1476 </div>
1477
1478 <div class="sui-box-settings-col-2">
1479 <div class="sui-form-field">
1480 <label for="add_missing_image_dimensions" class="sui-toggle">
1481 <input
1482 type="checkbox"
1483 id="add_missing_image_dimensions"
1484 name="add_missing_image_dimensions"
1485 aria-labelledby="add_missing_image_dimensions_label"
1486 aria-describedby="add_missing_image_dimensions_description"
1487 value="1"
1488 <?php checked( 1, $settings['add_missing_image_dimensions'] ); ?>
1489 <?php echo( ! is_premium() ? 'disabled="disabled"' : '' ); ?>
1490 >
1491 <span class="sui-toggle-slider" aria-hidden="true"></span>
1492 <span id="add_missing_image_dimensions_label" class="sui-toggle-label"><?php esc_html_e( 'Add missing image dimensions.', 'powered-cache' ); ?></span>
1493 <span id="add_missing_image_dimensions_description" class="sui-description"><?php esc_html_e( 'Adds missing width and height attributes into images, potentially preventing layout shifts and enhancing the experience for your visitors.', 'powered-cache' ); ?>
1494 <a href="<?php echo esc_url( get_doc_url( '/image-dimensions/' ) ); ?>" target="_blank">(?)</a>
1495 </span>
1496 </label>
1497 </div>
1498 </div>
1499 </div>
1500
1501 <div class="sui-box-settings-row">
1502
1503 <div class="sui-box-settings-col-1">
1504 <span class="sui-settings-label"><?php esc_html_e( 'Embeds', 'powered-cache' ); ?></span>
1505 <span class="sui-description"></span>
1506 </div>
1507
1508 <div class="sui-box-settings-col-2">
1509 <div class="sui-form-field">
1510 <label for="disable_wp_embeds" class="sui-toggle">
1511 <input
1512 type="checkbox"
1513 id="disable_wp_embeds"
1514 name="disable_wp_embeds"
1515 aria-labelledby="disable_wp_embeds_label"
1516 aria-describedby="disable_wp_embeds_description"
1517 value="1"
1518 <?php checked( 1, $settings['disable_wp_embeds'] ); ?>
1519 >
1520 <span class="sui-toggle-slider" aria-hidden="true"></span>
1521 <span id="disable_wp_embeds_label" class="sui-toggle-label"><?php esc_html_e( 'Disable WordPress Embeds', 'powered-cache' ); ?></span>
1522 <span id="disable_wp_embeds_description" class="sui-description"><?php esc_html_e( 'Disables embedding posts from WordPress-based websites (including your own) which converts URLs into heavy iframes.', 'powered-cache' ); ?>
1523 <a href="<?php echo esc_url( get_doc_url( '/disable-wordpress-embeds/' ) ); ?>" target="_blank">(?)</a>
1524 </span>
1525 </label>
1526 </div>
1527 </div>
1528 </div>
1529
1530 <div class="sui-box-settings-row">
1531
1532 <div class="sui-box-settings-col-1">
1533 <span class="sui-settings-label"><?php esc_html_e( 'Emoji', 'powered-cache' ); ?></span>
1534 <span class="sui-description"></span>
1535 </div>
1536
1537 <div class="sui-box-settings-col-2">
1538 <div class="sui-form-field">
1539 <label for="disable_emoji_scripts" class="sui-toggle">
1540 <input
1541 type="checkbox"
1542 id="disable_emoji_scripts"
1543 name="disable_emoji_scripts"
1544 aria-labelledby="disable_emoji_scripts_label"
1545 aria-describedby="disable_emoji_scripts_description"
1546 value="1"
1547 <?php checked( 1, $settings['disable_emoji_scripts'] ); ?>
1548 >
1549 <span class="sui-toggle-slider" aria-hidden="true"></span>
1550 <span id="disable_emoji_scripts_label" class="sui-toggle-label"><?php esc_html_e( 'Remove Emoji Scripts', 'powered-cache' ); ?></span>
1551 <span id="disable_emoji_scripts_description" class="sui-description">
1552 <?php esc_html_e( 'Removes the unnecessary emoji scripts from your website front-end. Doesn\'t remove emojis, don\'t worry.', 'powered-cache' ); ?>
1553 <a href="<?php echo esc_url( get_doc_url( '/remove-emoji-scripts/' ) ); ?>" target="_blank">(?)</a>
1554 </span>
1555 </label>
1556 </div>
1557 </div>
1558 </div>
1559
1560 </div>
1561 <div class="sui-box-footer">
1562 <?php require 'settings-form-action.php'; ?>
1563 </div>
1564 </div>
1565
1566 <!-- TAB: CDN -->
1567 <div class="sui-box" id="cdn-integration" data-tab="cdn-integration" style="display: none;">
1568
1569 <div class="sui-box-header">
1570 <h2 class="sui-box-title"><?php esc_html_e( 'CDN Integration', 'powered-cache' ); ?></h2>
1571 </div>
1572
1573 <div class="sui-box-body">
1574 <div class="sui-box-settings-row">
1575 <div class="sui-box-settings-col-1">
1576 <span class="sui-settings-label"><?php esc_html_e( 'CDN', 'powered-cache' ); ?></span>
1577 <span class="sui-description"></span>
1578 </div>
1579
1580 <div class="sui-box-settings-col-2">
1581 <div class="sui-form-field">
1582 <label for="enable_cdn" class="sui-toggle">
1583 <input
1584 type="checkbox"
1585 id="enable_cdn"
1586 name="enable_cdn"
1587 aria-labelledby="enable_cdn_label"
1588 aria-describedby="enable_cdn_description"
1589 value="1"
1590 <?php checked( 1, $settings['enable_cdn'] ); ?>
1591 >
1592 <span class="sui-toggle-slider" aria-hidden="true"></span>
1593 <span id="enable_cdn_label" class="sui-toggle-label"><?php esc_html_e( 'Enable CDN Integration', 'powered-cache' ); ?></span>
1594 <span id="enable_cdn_description" class="sui-description"><?php esc_html_e( 'Please make sure that your CDN is properly setup before enabling this feature ', 'powered-cache' ); ?>
1595 <a href="<?php echo esc_url( get_doc_url( '/cdn-integration/' ) ); ?>" target="_blank">(?)</a>
1596 </span>
1597 </label>
1598 </div>
1599 </div>
1600
1601 </div>
1602
1603 <div class="sui-box-settings-row">
1604 <div class="sui-box-settings-col-1">
1605 <span class="sui-settings-label"><?php esc_html_e( 'CDN Hostnames', 'powered-cache' ); ?></span>
1606 <span class="sui-description"><?php esc_html_e( 'Enter your CNAME(s)', 'powered-cache' ); ?></span>
1607 </div>
1608
1609 <div class="sui-box-settings-col-2">
1610 <div id="cdn-zones" class="sui-form-field">
1611 <?php
1612 if ( empty( $settings['cdn_hostname'] ) ) {
1613 $settings['cdn_hostname'] = [ '' ];
1614 }
1615
1616 if ( empty( $settings['cdn_zone'] ) ) {
1617 $settings['cdn_zone'] = [ '' ];
1618 }
1619 ?>
1620
1621 <?php foreach ( $settings['cdn_hostname'] as $key => $cdn ) : ?>
1622 <div id="cdn-zone-<?php echo absint( $key ); ?>" class="cdn-zone sui-form-field">
1623 <input id="cdn_hostname_<?php echo absint( $key ); ?>" value="<?php echo esc_attr( $cdn ); ?>" name="cdn_hostname[]" style="width: 300px" placeholder="cdn.example.org" class="cdn_hostname sui-form-control sui-input-md sui-field-has-suffix">
1624 <span><?php esc_html_e( 'for', 'powered-cache' ); ?></span>
1625 <span class="sui-field-suffix" style="min-width: 120px;">
1626 <div class="sui-form-field sui-input-md">
1627 <select id="cdn_zone_<?php echo absint( $key ); ?>" name="cdn_zone[]" class="sui-form-control cdn_zone">
1628 <?php foreach ( cdn_zones() as $zone => $zone_name ) : ?>
1629 <option <?php selected( $settings['cdn_zone'][ $key ], $zone ); ?> value="<?php echo esc_attr( $zone ); ?>"><?php echo esc_attr( $zone_name ); ?></option>
1630 <?php endforeach; ?>
1631 </select>
1632 </div>
1633 </span>
1634 <button role="button" type="button" class="remove_cdn_hostname sui-button-icon <?php echo( 0 === $key ? 'sui-hidden-important' : '' ); ?>">
1635 <span class="sui-icon-close" aria-hidden="true"></span>
1636 </button>
1637 </div>
1638 <?php endforeach; ?>
1639 </div>
1640
1641 <button role="button" type="button" class="add_cdn_hostname sui-button sui-button-blue sui-button-icon-right">
1642 <?php esc_html_e( 'Add Hostname', 'powered-cache' ); ?><i class="sui-icon-plus" aria-hidden="true"></i>
1643 </button>
1644
1645 </div>
1646 </div>
1647
1648 <div class="sui-box-settings-row">
1649 <div class="sui-box-settings-col-1">
1650 <span id="cdn_rejected_files_label" class="sui-settings-label"><?php esc_html_e( 'Rejected Files', 'powered-cache' ); ?></span>
1651 </div>
1652
1653 <div class="sui-box-settings-col-2">
1654 <div class="sui-row">
1655
1656 <div class="sui-col-md-8">
1657
1658 <div class="sui-form-field">
1659 <textarea
1660 placeholder="e.g /wp-content/themes/example/js/custom.js"
1661 id="cdn_rejected_files"
1662 name="cdn_rejected_files"
1663 class="sui-form-control"
1664 aria-labelledby="cdn_rejected_files_label"
1665 aria-describedby="cdn_rejected_files_description"
1666 rows="5"
1667 ><?php echo esc_textarea( $settings['cdn_rejected_files'] ); ?></textarea>
1668 <span id="cdn_rejected_files_description" class="sui-description">
1669 <?php esc_html_e( 'One URL per line. It can be full URL or absolute path.', 'powered-cache' ); ?>
1670 </span>
1671 </div>
1672 </div>
1673 </div>
1674 </div>
1675 </div>
1676
1677 </div>
1678 <div class="sui-box-footer">
1679 <?php require 'settings-form-action.php'; ?>
1680 </div>
1681 </div>
1682
1683 <!-- TAB: Preload -->
1684 <div class="sui-box" id="preload" data-tab="preload" style="display: none;">
1685
1686 <div class="sui-box-header">
1687 <h2 class="sui-box-title"><?php esc_html_e( 'Preload', 'powered-cache' ); ?></h2>
1688 </div>
1689
1690 <div class="sui-box-body sui-upsell-items">
1691 <div id="preload_page_cache_warning_message" class="sui-notice sui-notice-warning" style="<?php echo( $settings['enable_page_cache'] ? 'display:none;' : '' ); ?> padding:10px 20px;margin-bottom:0;">
1692
1693 <div class="sui-notice-content">
1694 <div class="sui-notice-message">
1695 <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
1696 <p><?php esc_html_e( 'It seems page caching is not activated yet. Page caching needs to be enabled in order to get the advantage of preloading features!', 'powered-cache' ); ?></p>
1697 </div>
1698 </div>
1699
1700 </div>
1701 <?php if ( $settings['enable_cache_preload'] ) : ?>
1702 <?php
1703 $batch = CachePreloader::factory()->get_batches( 1 );
1704 $remaining_item = ! empty( $batch[0] ) && $batch[0]->data ? count( $batch[0]->data ) : 0;
1705 ?>
1706 <?php if ( ! empty( $remaining_item ) ) : ?>
1707 <div class="sui-notice sui-notice-warning" style="padding:10px 20px;margin-bottom:0;">
1708 <div class="sui-notice-content">
1709 <div class="sui-notice-message">
1710 <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
1711 <p>
1712 <?php echo esc_html( sprintf( __( 'Preloader is currently running. Remaining items: %d (Refresh to see progress)', 'powered-cache' ), $remaining_item ) ); ?>
1713 </p>
1714 </div>
1715 </div>
1716 </div>
1717 <?php endif; ?>
1718 <?php endif; ?>
1719
1720 <div class="sui-box-settings-row">
1721
1722 <div class="sui-box-settings-col-1">
1723 <span class="sui-settings-label"><?php esc_html_e( 'Cache Preload', 'powered-cache' ); ?></span>
1724 <span class="sui-description">
1725 <?php esc_html_e( 'Preloading will visit pages based on the settings and generate cache, just like any other visitor to the site.', 'powered-cache' ); ?>
1726 <a href="<?php echo esc_url( get_doc_url( '/enable-preloading/' ) ); ?>" target="_blank">(?)</a>
1727 </span>
1728 </div>
1729
1730 <div class="sui-box-settings-col-2">
1731
1732 <div class="sui-form-field">
1733 <div class="sui-row">
1734 <label for="enable_cache_preload" class="sui-toggle">
1735 <input
1736 type="checkbox"
1737 id="enable_cache_preload"
1738 name="enable_cache_preload"
1739 aria-labelledby="enable_cache_preload_label"
1740 aria-describedby="enable_cache_preload_description"
1741 aria-controls="enable_cache_preload_description_details"
1742 value="1"
1743 <?php checked( 1, $settings['enable_cache_preload'] ); ?>
1744 >
1745
1746 <span class="sui-toggle-slider" aria-hidden="true"></span>
1747 <span id="enable_cache_preload_label" class="sui-toggle-label"><?php esc_html_e( 'Enable Preloading', 'powered-cache' ); ?></span>
1748 <span id="enable_cache_preload_description" class="sui-description"><?php esc_html_e( 'Activate preloading.', 'powered-cache' ); ?></span>
1749 </label>
1750 </div>
1751
1752 <div style=" <?php echo( ! $settings['enable_cache_preload'] ? 'display:none' : '' ); ?>" tabindex="0" id="enable_cache_preload_description_details">
1753
1754 <div class="sui-form-field">
1755
1756 <div class="sui-row">
1757 <label for="preload_homepage" class="sui-toggle">
1758 <input
1759 type="checkbox"
1760 id="preload_homepage"
1761 name="preload_homepage"
1762 aria-labelledby="preload_homepage_label"
1763 aria-describedby="preload_homepage_description"
1764 value="1"
1765 <?php checked( 1, $settings['preload_homepage'] ); ?>
1766 >
1767 <span class="sui-toggle-slider" aria-hidden="true"></span>
1768 <span id="preload_homepage_label" class="sui-toggle-label"><?php esc_html_e( 'Enable for homepage', 'powered-cache' ); ?></span>
1769 <span id="preload_homepage_description" class="sui-description"><?php esc_html_e( 'Preloads homepage.', 'powered-cache' ); ?></span>
1770 </label>
1771 </div>
1772
1773 <div class="sui-row">
1774 <label for="preload_public_posts" class="sui-toggle">
1775 <input
1776 type="checkbox"
1777 id="preload_public_posts"
1778 name="preload_public_posts"
1779 aria-labelledby="preload_public_posts_label"
1780 aria-describedby="preload_public_posts_description"
1781 value="1"
1782 <?php checked( 1, $settings['preload_public_posts'] ); ?>
1783 >
1784 <span class="sui-toggle-slider" aria-hidden="true"></span>
1785 <span id="preload_public_posts_label" class="sui-toggle-label"><?php esc_html_e( 'Enable for posts', 'powered-cache' ); ?></span>
1786 <span id="preload_public_posts_description" class="sui-description"><?php esc_html_e( 'Individual post pages will be preloaded. The public post types are supported.', 'powered-cache' ); ?></span>
1787 </label>
1788 </div>
1789
1790 <div class="sui-row">
1791 <label for="preload_public_tax" class="sui-toggle">
1792 <input
1793 type="checkbox"
1794 id="preload_public_tax"
1795 name="preload_public_tax"
1796 aria-labelledby="preload_public_tax_label"
1797 aria-describedby="preload_public_tax_description"
1798 value="1"
1799 <?php checked( 1, $settings['preload_public_tax'] ); ?>
1800 >
1801 <span class="sui-toggle-slider" aria-hidden="true"></span>
1802 <span id="preload_public_tax_label" class="sui-toggle-label"><?php esc_html_e( 'Enable for public taxonomies', 'powered-cache' ); ?></span>
1803 <span id="preload_public_tax_description" class="sui-description"><?php esc_html_e( 'Preload archive pages of taxonomies. (tags, category etc..)', 'powered-cache' ); ?></span>
1804 </label>
1805 </div>
1806 <div class="sui-row sui-border-frame">
1807
1808 <div class="sui-form-field">
1809 <label for="preload_request_interval" id="preload_request_interval-label" class="sui-label"><?php esc_html_e( 'Preloader request interval', 'powered-cache' ); ?></label>
1810 <input
1811 name="preload_request_interval"
1812 value="<?php echo esc_attr( $settings['preload_request_interval'] ); ?>"
1813 id="preload_request_interval"
1814 class="sui-form-control sui-field-has-suffix"
1815 type="number"
1816 min="1"
1817 max="10"
1818 />
1819 <span class="sui-field-suffix">
1820 <span class="sui-description"><?php esc_html_e( 'Seconds', 'powered-cache' ); ?></span>
1821 </span>
1822 <span class="sui-description"><?php esc_html_e( 'Adjust the delay between preload requests. If your website is hosted on a slow server, consider increasing the interval between requests.', 'powered-cache' ); ?></span>
1823
1824 </div>
1825 </div>
1826 </div>
1827
1828 </div>
1829 </div>
1830 </div>
1831 </div>
1832
1833 <!-- Sitemap preloading settings sui-disabled add to box -->
1834 <div id="enable_sitemap_preload_wrapper" style=" <?php echo( ! $settings['enable_cache_preload'] ? 'display:none' : '' ); ?>" tabindex="0">
1835 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
1836 <div class="sui-box-settings-col-1">
1837 <span class="sui-settings-label"><?php esc_html_e( 'Sitemap Preloading', 'powered-cache' ); ?>
1838 <?php if ( ! is_premium() ) : ?>
1839 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
1840 <?php endif; ?>
1841 </span>
1842 <span class="sui-description"><?php esc_html_e( 'Preloads sitemaps and the URLs placed in sitemaps.', 'powered-cache' ); ?></span>
1843
1844 </div>
1845
1846 <div class="sui-box-settings-col-2">
1847 <div class="sui-row">
1848 <label for="enable_sitemap_preload" class="sui-toggle">
1849 <input
1850 type="checkbox"
1851 id="enable_sitemap_preload"
1852 name="enable_sitemap_preload"
1853 aria-labelledby="enable_sitemap_preload_label"
1854 aria-describedby="enable_sitemap_preload_description"
1855 aria-controls="sitemap-preload-details"
1856 value="1"
1857 <?php checked( 1, $settings['enable_sitemap_preload'] ); ?>
1858 >
1859 <span class="sui-toggle-slider" aria-hidden="true"></span>
1860 <span id="enable_sitemap_preload_label" class="sui-toggle-label"><?php esc_html_e( 'Enable Sitemap Preloading', 'powered-cache' ); ?></span>
1861 <span id="enable_sitemap_preload_description" class="sui-description"><?php esc_html_e( 'We automatically detect sitemaps generated by Yoast SEO, All-in-one-SEO, Rank Math SEO, SEOPress.', 'powered-cache' ); ?></span>
1862 </label>
1863 </div>
1864
1865 <div class="sui-row">
1866 <div class="sui-col-md-8">
1867 <div class="sui-form-field">
1868 <label for="preload_sitemap" class="sui-label"><i><?php esc_html_e( 'Enter sitemap URLs (one per line)', 'powered-cache' ); ?></i></label>
1869 <textarea
1870 placeholder="http://example.com/sitemap.xml"
1871 id="preload_sitemap"
1872 name="preload_sitemap"
1873 class="sui-form-control"
1874 aria-describedby="preload_sitemap_description"
1875 rows="7"
1876 ><?php echo esc_textarea( $settings['preload_sitemap'] ); ?></textarea>
1877 <span id="preload_sitemap_description" class="sui-description">
1878 <?php esc_html_e( 'Preload the urls in listed sitemaps.', 'powered-cache' ); ?>
1879 <a href="<?php echo esc_url( get_doc_url( '/sitemap-preloading/' ) ); ?>" target="_blank">(?)</a>
1880 </span>
1881 </div>
1882
1883 </div>
1884 </div>
1885 </div>
1886 </div>
1887 </div>
1888
1889 <!-- DNS Prefetch settings -->
1890 <div class="sui-box-settings-row">
1891 <div class="sui-box-settings-col-1">
1892 <span class="sui-settings-label"><?php esc_html_e( 'Prefetch DNS', 'powered-cache' ); ?></span>
1893 <span class="sui-description"><?php esc_html_e( 'DNS-prefetch is an attempt to resolve domain names before resources get requested.', 'powered-cache' ); ?></span>
1894 </div>
1895
1896 <div class="sui-box-settings-col-2">
1897 <div class="sui-row">
1898 <div class="sui-col-md-8">
1899 <div class="sui-form-field">
1900 <label for="prefetch_dns" class="sui-label"><i><?php esc_html_e( 'Enter external hosts to be prefetched (one per line)', 'powered-cache' ); ?></i></label>
1901 <textarea
1902 placeholder="//fonts.googleapis.com"
1903 id="prefetch_dns"
1904 name="prefetch_dns"
1905 class="sui-form-control"
1906 aria-describedby="prefetch_dns_description"
1907 rows="7"
1908 ><?php echo esc_textarea( $settings['prefetch_dns'] ); ?></textarea>
1909 <span id="prefetch_dns_description" class="sui-description">
1910 <?php esc_html_e( 'DNS-prefetch would reduce DNS lookup time.', 'powered-cache' ); ?>
1911 <a href="<?php echo esc_url( get_doc_url( '/prefetch-dns/' ) ); ?>" target="_blank">(?)</a>
1912 </span>
1913 </div>
1914 </div>
1915 </div>
1916 </div>
1917
1918 </div>
1919 <div class="sui-box-settings-row">
1920 <div class="sui-box-settings-col-1">
1921 <span class="sui-settings-label"><?php esc_html_e( 'Preconnect', 'powered-cache' ); ?></span>
1922 <span class="sui-description"><?php esc_html_e( 'Preconnect is used to indicate an origin that will be used to fetch required resources. It initializes an early connection, which includes the DNS lookup, TCP handshake, and optional TLS negotiation.', 'powered-cache' ); ?></span>
1923 </div>
1924
1925 <div class="sui-box-settings-col-2">
1926 <div class="sui-row">
1927 <div class="sui-col-md-8">
1928 <div class="sui-form-field">
1929 <label for="preconnect_resource" class="sui-label"><i><?php esc_html_e( 'Enter external hosts to be preconnected (one per line)', 'powered-cache' ); ?></i></label>
1930 <textarea
1931 placeholder="https://fonts.googleapis.com"
1932 id="preconnect_resource"
1933 name="preconnect_resource"
1934 class="sui-form-control"
1935 aria-describedby="preconnect_resource_description"
1936 rows="7"
1937 ><?php echo esc_textarea( $settings['preconnect_resource'] ); ?></textarea>
1938 <span id="preconnect_resource_description" class="sui-description">
1939 <?php esc_html_e( 'The preconnect hint is best used for only the most critical connections.', 'powered-cache' ); ?>
1940 <a href="<?php echo esc_url( get_doc_url( '/preconnect-resources/' ) ); ?>" target="_blank">(?)</a>
1941 </span>
1942 </div>
1943 </div>
1944 </div>
1945 </div>
1946
1947
1948 </div>
1949
1950 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
1951 <div class="sui-box-settings-col-1">
1952 <span class="sui-settings-label"><?php esc_html_e( 'Prefetch links', 'powered-cache' ); ?>
1953 <?php if ( ! is_premium() ) : ?>
1954 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
1955 <?php endif; ?>
1956 </span>
1957 <span class="sui-description"></span>
1958 </div>
1959
1960 <div class="sui-box-settings-col-2">
1961 <div class="sui-form-field">
1962 <label for="prefetch_links" class="sui-toggle">
1963 <input
1964 type="checkbox"
1965 id="prefetch_links"
1966 name="prefetch_links"
1967 aria-labelledby="prefetch_links_label"
1968 aria-describedby="prefetch_links_description"
1969 value="1"
1970 <?php checked( 1, $settings['prefetch_links'] ); ?>
1971 >
1972 <span class="sui-toggle-slider" aria-hidden="true"></span>
1973 <span id="prefetch_links_label" class="sui-toggle-label"><?php esc_html_e( 'Enable link prefetching', 'powered-cache' ); ?></span>
1974 <span id="prefetch_links_description" class="sui-description"><?php esc_html_e( 'Faster subsequent page-loads by prefetching or prerendering in-viewport links during idle time.', 'powered-cache' ); ?>
1975 <a href="<?php echo esc_url( get_doc_url( '/prefetch-links/' ) ); ?>" target="_blank">(?)</a>
1976 </span>
1977 </label>
1978 </div>
1979 </div>
1980 </div>
1981
1982
1983
1984
1985 </div>
1986 <div class="sui-box-footer">
1987 <?php require 'settings-form-action.php'; ?>
1988 </div>
1989 </div>
1990
1991 <!-- TAB: Dashed -->
1992 <div id="db-optimization" data-tab="db-optimization" style="display: none;">
1993 <div class="box-advanced-db sui-box">
1994 <?php $db_info = \PoweredCache\Async\DatabaseOptimizer::get_db_cleanup_counts(); ?>
1995 <div class="sui-box-header">
1996 <h2 class="sui-box-title"><?php esc_html_e( 'Database Optimization', 'powered-cache' ); ?></h2>
1997 </div>
1998
1999 <div class="sui-box-body">
2000
2001 <?php if ( POWERED_CACHE_IS_NETWORK && wp_is_large_network() ) : ?>
2002 <div class="sui-notice sui-notice-red">
2003 <div class="sui-notice-content">
2004 <div class="sui-notice-message">
2005 <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
2006 <p><?php esc_html_e( 'It seems Powered Cache has been enabled on a large multisite network. Cleanup counts might be slightly different from than actual value due to the volume of the sites in the network.', 'powered-cache' ); ?></p>
2007 </div>
2008 </div>
2009 </div>
2010 <?php endif; ?>
2011
2012 <div class="sui-box-settings-row">
2013 <div class="sui-box-settings-col-1">
2014 <span class="sui-settings-label"><?php esc_html_e( 'Post Cleanup', 'powered-cache' ); ?></span>
2015 </div>
2016
2017 <div class="sui-box-settings-col-2">
2018 <div class="sui-row">
2019 <div class="sui-form-field">
2020 <label for="db_cleanup_post_revisions" class="sui-toggle">
2021 <input
2022 type="checkbox"
2023 id="db_cleanup_post_revisions"
2024 name="db_cleanup_post_revisions"
2025 aria-labelledby="db_cleanup_post_revisions_label"
2026 aria-describedby="db_cleanup_post_revisions_description"
2027 value="1"
2028 <?php checked( 1, $settings['db_cleanup_post_revisions'] ); ?>
2029 >
2030 <span class="sui-toggle-slider" aria-hidden="true"></span>
2031 <span id="db_cleanup_post_revisions_label" class="sui-toggle-label"><?php esc_html_e( 'Post Revisions', 'powered-cache' ); ?>
2032 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Delete post revisions.', 'powered-cache' ); ?>">
2033 <i class="sui-icon-info" aria-hidden="true"></i>
2034 </span>
2035 </span>
2036 <span id="db_cleanup_post_revisions_description" class="sui-description"><?php printf( esc_html__( '%s revisions in database', 'powered-cache' ), absint( $db_info['db_cleanup_post_revisions'] ) ); ?></span>
2037 </label>
2038 </div>
2039 </div>
2040
2041 <div class="sui-row">
2042 <div class="sui-form-field">
2043 <label for="db_cleanup_auto_drafts" class="sui-toggle">
2044 <input
2045 type="checkbox"
2046 id="db_cleanup_auto_drafts"
2047 name="db_cleanup_auto_drafts"
2048 aria-labelledby="db_cleanup_auto_drafts_label"
2049 aria-describedby="db_cleanup_auto_drafts_description"
2050 value="1"
2051 <?php checked( 1, $settings['db_cleanup_auto_drafts'] ); ?>
2052 >
2053 <span class="sui-toggle-slider" aria-hidden="true"></span>
2054 <span id="db_cleanup_auto_drafts_label" class="sui-toggle-label"><?php esc_html_e( 'Auto Drafts', 'powered-cache' ); ?>
2055 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Delete auto-draft posts.', 'powered-cache' ); ?>">
2056 <i class="sui-icon-info" aria-hidden="true"></i>
2057 </span>
2058 </span>
2059 <span id="db_cleanup_auto_drafts_description" class="sui-description"><?php printf( esc_html__( '%s auto-draft in database', 'powered-cache' ), absint( $db_info['db_cleanup_auto_drafts'] ) ); ?></span>
2060 </label>
2061 </div>
2062 </div>
2063
2064 <div class="sui-row">
2065 <div class="sui-form-field">
2066 <label for="db_cleanup_trashed_posts" class="sui-toggle">
2067 <input
2068 type="checkbox"
2069 id="db_cleanup_trashed_posts"
2070 name="db_cleanup_trashed_posts"
2071 aria-labelledby="db_cleanup_trashed_posts_label"
2072 aria-describedby="db_cleanup_trashed_posts_description"
2073 value="1"
2074 <?php checked( 1, $settings['db_cleanup_trashed_posts'] ); ?>
2075 >
2076 <span class="sui-toggle-slider" aria-hidden="true"></span>
2077 <span id="db_cleanup_trashed_posts_label" class="sui-toggle-label"><?php esc_html_e( 'Trashed Posts', 'powered-cache' ); ?>
2078 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Permanently delete trashed posts.', 'powered-cache' ); ?>">
2079 <i class="sui-icon-info" aria-hidden="true"></i>
2080 </span>
2081 </span>
2082 <span id="db_cleanup_trashed_posts_description" class="sui-description"><?php printf( esc_html__( '%s trashed post in database', 'powered-cache' ), absint( $db_info['db_cleanup_trashed_posts'] ) ); ?></span>
2083 </label>
2084 </div>
2085 </div>
2086
2087 </div>
2088 </div>
2089 <div class="sui-box-settings-row">
2090 <div class="sui-box-settings-col-1">
2091 <span class="sui-settings-label"><?php esc_html_e( 'Comments Cleanup', 'powered-cache' ); ?></span>
2092 </div>
2093
2094 <div class="sui-box-settings-col-2">
2095 <div class="sui-row">
2096 <div class="sui-form-field">
2097 <label for="db_cleanup_spam_comments" class="sui-toggle">
2098 <input
2099 type="checkbox"
2100 id="db_cleanup_spam_comments"
2101 name="db_cleanup_spam_comments"
2102 aria-labelledby="db_cleanup_spam_comments_label"
2103 aria-describedby="db_cleanup_spam_comments_description"
2104 value="1"
2105 <?php checked( 1, $settings['db_cleanup_spam_comments'] ); ?>
2106 >
2107 <span class="sui-toggle-slider" aria-hidden="true"></span>
2108 <span id="db_cleanup_spam_comments_label" class="sui-toggle-label"><?php esc_html_e( 'Spam Comments', 'powered-cache' ); ?>
2109 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Comments marked as spam that haven\'t been deleted yet.', 'powered-cache' ); ?>">
2110 <i class="sui-icon-info" aria-hidden="true"></i>
2111 </span>
2112 </span>
2113 <span id="db_cleanup_spam_comments_description" class="sui-description"><?php printf( esc_html__( '%s spam comment in database', 'powered-cache' ), absint( $db_info['db_cleanup_spam_comments'] ) ); ?></span>
2114 </label>
2115 </div>
2116 </div>
2117 <div class="sui-row">
2118 <div class="sui-form-field">
2119 <label for="db_cleanup_trashed_comments" class="sui-toggle">
2120 <input
2121 type="checkbox"
2122 id="db_cleanup_trashed_comments"
2123 name="db_cleanup_trashed_comments"
2124 aria-labelledby="db_cleanup_trashed_comments_label"
2125 aria-describedby="db_cleanup_trashed_comments_description"
2126 value="1"
2127 <?php checked( 1, $settings['db_cleanup_trashed_comments'] ); ?>
2128 >
2129 <span class="sui-toggle-slider" aria-hidden="true"></span>
2130 <span id="db_cleanup_trashed_comments_label" class="sui-toggle-label"><?php esc_html_e( 'Trashed Comments', 'powered-cache' ); ?>
2131 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Permanently delete trashed comments.', 'powered-cache' ); ?>">
2132 <i class="sui-icon-info" aria-hidden="true"></i>
2133 </span>
2134 </span>
2135 <span id="db_cleanup_trashed_comments_description" class="sui-description"><?php printf( esc_html__( '%s trashed comment in database', 'powered-cache' ), absint( $db_info['db_cleanup_trashed_comments'] ) ); ?></span>
2136 </label>
2137 </div>
2138 </div>
2139 </div>
2140 </div>
2141 <div class="sui-box-settings-row">
2142 <div class="sui-box-settings-col-1">
2143 <span class="sui-settings-label"><?php esc_html_e( 'Transients Cleanup', 'powered-cache' ); ?></span>
2144 </div>
2145
2146 <div class="sui-box-settings-col-2">
2147 <div class="sui-row">
2148 <div class="sui-form-field">
2149 <label for="db_cleanup_expired_transients" class="sui-toggle">
2150 <input
2151 type="checkbox"
2152 id="db_cleanup_expired_transients"
2153 name="db_cleanup_expired_transients"
2154 aria-labelledby="db_cleanup_expired_transients_label"
2155 aria-describedby="db_cleanup_expired_transients_description"
2156 value="1"
2157 <?php checked( 1, $settings['db_cleanup_expired_transients'] ); ?>
2158 >
2159 <span class="sui-toggle-slider" aria-hidden="true"></span>
2160 <span id="db_cleanup_expired_transients_label" class="sui-toggle-label"><?php esc_html_e( 'Expired Transients', 'powered-cache' ); ?>
2161 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Permanently delete expired transients.', 'powered-cache' ); ?>">
2162 <i class="sui-icon-info" aria-hidden="true"></i>
2163 </span>
2164 </span>
2165 <span id="db_cleanup_expired_transients_description" class="sui-description"><?php printf( esc_html__( '%s expired transient in database', 'powered-cache' ), absint( $db_info['db_cleanup_expired_transients'] ) ); ?></span>
2166 </label>
2167 </div>
2168
2169 </div>
2170 <div class="sui-row">
2171 <div class="sui-form-field">
2172 <label for="db_cleanup_all_transients" class="sui-toggle">
2173 <input
2174 type="checkbox"
2175 id="db_cleanup_all_transients"
2176 name="db_cleanup_all_transients"
2177 aria-labelledby="db_cleanup_all_transients_label"
2178 aria-describedby="db_cleanup_all_transients_description"
2179 value="1"
2180 <?php checked( 1, $settings['db_cleanup_all_transients'] ); ?>
2181 >
2182 <span class="sui-toggle-slider" aria-hidden="true"></span>
2183 <span id="db_cleanup_all_transients_label" class="sui-toggle-label"><?php esc_html_e( 'All Transients', 'powered-cache' ); ?>
2184 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Permanently delete all transients.', 'powered-cache' ); ?>">
2185 <i class="sui-icon-info" aria-hidden="true"></i>
2186 </span>
2187 </span>
2188 <span id="db_cleanup_all_transients_description" class="sui-description"><?php printf( esc_html__( '%s transient in database', 'powered-cache' ), absint( $db_info['db_cleanup_all_transients'] ) ); ?></span>
2189 </label>
2190 </div>
2191 </div>
2192
2193 </div>
2194 </div>
2195 <div class="sui-box-settings-row">
2196 <div class="sui-box-settings-col-1">
2197 <span class="sui-settings-label"><?php esc_html_e( 'Database Optimize', 'powered-cache' ); ?></span>
2198 </div>
2199
2200 <div class="sui-box-settings-col-2">
2201 <div class="sui-row">
2202 <div class="sui-form-field">
2203 <label for="db_cleanup_optimize_tables" class="sui-toggle">
2204 <input
2205 type="checkbox"
2206 id="db_cleanup_optimize_tables"
2207 name="db_cleanup_optimize_tables"
2208 aria-labelledby="db_cleanup_optimize_tables_label"
2209 aria-describedby="db_cleanup_optimize_tables_description"
2210 value="1"
2211 <?php checked( 1, $settings['db_cleanup_optimize_tables'] ); ?>
2212 >
2213 <span class="sui-toggle-slider" aria-hidden="true"></span>
2214 <span id="db_cleanup_optimize_tables_label" class="sui-toggle-label"><?php esc_html_e( 'Optimize Tables', 'powered-cache' ); ?>
2215 <span class="sui-tooltip sui-tooltip-constrained" data-tooltip="<?php esc_html_e( 'Reduces overhead of database tables.', 'powered-cache' ); ?>">
2216 <i class="sui-icon-info" aria-hidden="true"></i>
2217 </span>
2218 </span>
2219 <span id="db_cleanup_optimize_tables_description" class="sui-description"><?php printf( esc_html__( '%s tables to optimize', 'powered-cache' ), absint( $db_info['db_cleanup_optimize_tables'] ) ); ?></span>
2220 </label>
2221 </div>
2222 </div>
2223
2224 </div>
2225 </div>
2226 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
2227 <div class="sui-box-settings-col-1">
2228 <span class="sui-settings-label"><?php esc_html_e( 'Schedule Cleanups', 'powered-cache' ); ?>
2229 <?php if ( ! is_premium() ) : ?>
2230 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
2231 <?php endif; ?>
2232 </span>
2233 <span class="sui-description">
2234 <?php esc_html_e( 'Schedule Powered Cache to automatically clean your database daily, weekly or monthly.', 'powered-cache' ); ?>
2235 </span>
2236 </div><!-- end col-third -->
2237
2238 <div class="sui-box-settings-col-2">
2239 <div class="sui-form-field">
2240 <label for="enable_scheduled_db_cleanup" id="enable_scheduled_db_cleanup_label" class="sui-toggle">
2241 <input
2242 type="checkbox"
2243 id="enable_scheduled_db_cleanup"
2244 name="enable_scheduled_db_cleanup"
2245 aria-labelledby="enable_scheduled_db_cleanup_label"
2246 value="1"
2247 aria-controls="scheduled_db_cleanup_details"
2248 <?php checked( 1, $settings['enable_scheduled_db_cleanup'] ); ?>
2249 >
2250 <span class="sui-toggle-slider" aria-hidden="true"></span>
2251 <span id="scheduled_cleanup-label" class="sui-toggle-label"><?php esc_html_e( 'Enabled scheduled cleanups', 'powered-cache' ); ?></span>
2252 </label>
2253
2254 <div id="scheduled_db_cleanup_details" class="sui-border-frame with-padding schedule-box" style="<?php echo( ! $settings['enable_scheduled_db_cleanup'] ? 'display:none' : '' ); ?>">
2255 <div class="sui-form-field">
2256
2257 <label class="sui-label" for="scheduled_db_cleanup_frequency"><?php esc_html_e( 'Frequency', 'powered-cache' ); ?></label>
2258
2259 <select id="scheduled_db_cleanup_frequency" name="scheduled_db_cleanup_frequency" class="sui-select">
2260 <?php foreach ( scheduled_cleanup_frequency_options() as $frequency => $frequency_name ) : ?>
2261 <option <?php selected( $settings['scheduled_db_cleanup_frequency'], $frequency ); ?> value="<?php echo esc_attr( $frequency ); ?>"><?php echo esc_html( $frequency_name ); ?></option>
2262 <?php endforeach; ?>
2263 </select>
2264 </div>
2265 </div>
2266 </div>
2267 </div>
2268 </div>
2269 <?php if ( ! is_premium() ) : ?>
2270 <div class="sui-box-settings-row sui-upsell-row">
2271 <div class="sui-upsell-notice">
2272 <p>
2273 <?php esc_html_e( 'Regular cleanups of your database ensures you’re regularly removing extra bloat which can slow down your host server. Upgrade to Premium to unlock this feature today!', 'powered-cache' ); ?>
2274 <br>
2275 <a href="https://poweredcache.com/?utm_source=poweredcache&amp;utm_medium=plugin&amp;utm_campaign=dbcleanup_schedule_upgrade_button" target="_blank">
2276 <?php esc_html_e( 'Learn More', 'powered-cache' ); ?>
2277 </a>
2278 </p>
2279 </div>
2280 </div>
2281 <?php endif; ?>
2282 </div>
2283 <div class="sui-box-footer">
2284
2285 <div class="sui-actions-left">
2286 <button type="submit" name="powered_cache_form_action" value="save_settings_and_optimize" class="sui-button sui-button-blue" id="powered-cache-save-settings-db-optimize">
2287 <i class="sui-icon-save" aria-hidden="true"></i>
2288 <?php esc_html_e( 'Save settings and Optimize', 'powered-cache' ); ?>
2289 </button>
2290 <span class="sui-tag sui-tag-yellow"><?php esc_html_e( 'Tip: Make sure you have a current backup before running a cleanup.', 'powered-cache' ); ?></span>
2291
2292 </div>
2293
2294 </div>
2295 </div>
2296 </div>
2297
2298 <!-- TAB: Dashed -->
2299 <div id="extensions" data-tab="extensions" style="display: none;">
2300 <div class="sui-row">
2301 <div class="sui-col-lg-6">
2302 <div id="extension-cloudflare" class="powered-cache-extension-box sui-box">
2303 <div class="sui-box-header">
2304 <h3 class="sui-box-title"><?php esc_html_e( 'Cloudflare', 'powered-cache' ); ?></h3>
2305 <div class="sui-actions-right">
2306 <div class="sui-form-field">
2307 <label for="enable_cloudflare" class="sui-toggle">
2308 <input
2309 type="checkbox"
2310 id="enable_cloudflare"
2311 name="enable_cloudflare"
2312 aria-labelledby="enable_cloudflare_label"
2313 value="1"
2314 aria-controls="cloudflare-details"
2315 <?php checked( 1, $settings['enable_cloudflare'] ); ?>
2316 >
2317 <span class="sui-toggle-slider" aria-hidden="true"></span>
2318 <span id="enable_cloudflare_label" class="sui-toggle-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2319 </label>
2320 </div>
2321 </div>
2322 </div><!-- end sui-box-title -->
2323
2324 <div class="sui-box-body">
2325 <p><?php esc_html_e( 'Cloudflare extension for PoweredCache. It allows to purge Cloudflare cache within WordPress.', 'powered-cache' ); ?></p>
2326 <div id="cloudflare-details" style="<?php echo( ! $settings['enable_cloudflare'] ? 'display:none' : '' ); ?>">
2327 <div class="sui-form-field">
2328 <label for="cloudflare-api-token" id="cloudflare-api-token-label" class="sui-label"><?php esc_html_e( 'API Token', 'powered-cache' ); ?></label>
2329 <input
2330 name="cloudflare_api_token"
2331 value="<?php echo esc_attr( $cf_api_token ? mask_string( $cf_api_token, UNMASK_CHARACTER_LENGTH ) : '' ); ?>"
2332 id="cloudflare-api-token"
2333 class="sui-form-control"
2334 />
2335 <span id="cloudflare_api_token_description" class="sui-description">
2336 <?php esc_html_e( 'Recommended authentication method.', 'powered-cache' ); ?>
2337 <a href="<?php echo esc_url( 'https://dash.cloudflare.com/profile/api-tokens' ); ?>" rel="noopener" target="_blank">
2338 <?php esc_html_e( 'Create a new token', 'powered-cache' ); ?>
2339 </a>
2340 <?php esc_html_e( 'Or you can enter Cloudflare email and API Key.', 'powered-cache' ); ?>
2341 </span>
2342 </div>
2343
2344
2345 <div id="cloudflare-api-details" class="sui-row" style="<?php echo( ! empty( $cf_api_token ) ? 'display:none' : '' ); ?>">
2346 <div class="sui-col">
2347 <div class="sui-form-field">
2348 <label for="cloudflare-email" id="cloudflare-email-label" class="sui-label"><?php esc_html_e( 'Cloudflare Email', 'powered-cache' ); ?></label>
2349 <input
2350 placeholder="john@example.com"
2351 name="cloudflare_email"
2352 value="<?php echo esc_attr( $settings['cloudflare_email'] ); ?>"
2353 id="cloudflare-email"
2354 class="sui-form-control"
2355 />
2356 </div>
2357 </div>
2358
2359 <div class="sui-col">
2360 <div class="sui-form-field">
2361 <label for="cloudflare-api-key" id="cloudflare-api-key-label" class="sui-label"><?php esc_html_e( 'API Key', 'powered-cache' ); ?></label>
2362 <input
2363 name="cloudflare_api_key"
2364 value="<?php echo esc_attr( $cf_api_key ? mask_string( $cf_api_key, UNMASK_CHARACTER_LENGTH ) : '' ); ?>"
2365 id="cloudflare-api-key"
2366 class="sui-form-control"
2367 />
2368 </div>
2369 </div>
2370 </div>
2371
2372
2373 <div class="sui-form-field">
2374 <label for="cloudflare-zone" id="cloudflare-zone-label" class="sui-label"><?php esc_html_e( 'Zone ID', 'powered-cache' ); ?></label>
2375
2376 <input
2377 name="cloudflare_zone"
2378 value="<?php echo esc_attr( $settings['cloudflare_zone'] ); ?>"
2379 id="cloudflare-zone"
2380 class="sui-form-control"
2381 />
2382 </div>
2383 </div>
2384 </div><!-- end box_content_class -->
2385 </div>
2386 </div>
2387 <div class="sui-col-lg-6">
2388 <div id="extension-heartbeat" class="powered-cache-extension-box sui-box">
2389 <div class="sui-box-header">
2390 <h3 class="sui-box-title"><?php esc_html_e( 'Heartbeat', 'powered-cache' ); ?></h3>
2391 <div class="sui-actions-right">
2392 <div class="sui-form-field">
2393 <label for="enable_heartbeat" class="sui-toggle">
2394 <input
2395 type="checkbox"
2396 id="enable_heartbeat"
2397 name="enable_heartbeat"
2398 aria-labelledby="enable_heartbeat_label"
2399 value="1"
2400 aria-controls="heartbeat-details"
2401 <?php checked( 1, $settings['enable_heartbeat'] ); ?>
2402 >
2403 <span class="sui-toggle-slider" aria-hidden="true"></span>
2404 <span id="enable_heartbeat_label" class="sui-toggle-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2405 </label>
2406 </div>
2407 </div>
2408 </div><!-- end sui-box-title -->
2409
2410 <div class="sui-box-body">
2411 <p><?php esc_html_e( 'Heartbeat extension allows you to manage the frequency of the WordPress Heartbeat API.', 'powered-cache' ); ?></p>
2412 <div id="heartbeat-details" style="<?php echo( ! $settings['enable_heartbeat'] ? 'display:none' : '' ); ?>">
2413 <h4><?php esc_html_e( 'Dashboard', 'powered-cache' ); ?></h4>
2414
2415 <!-- start dashboard heartbeat -->
2416 <div class="sui-form-field" role="radiogroup">
2417 <label for="heartbeat-dashboard-enable" class="sui-radio">
2418 <input
2419 type="radio"
2420 name="heartbeat_dashboard_status"
2421 id="heartbeat-dashboard-enable"
2422 value="enable"
2423 class="heartbeat_radio"
2424 aria-controls="heartbeat-dashboard-interval-control"
2425 <?php checked( 'enable', $settings['heartbeat_dashboard_status'] ); ?>
2426 />
2427 <span aria-hidden="true"></span>
2428 <span id="heartbeat-dashboard-enable-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2429 </label>
2430
2431 <label for="heartbeat-dashboard-disable" class="sui-radio">
2432 <input
2433 type="radio"
2434 name="heartbeat_dashboard_status"
2435 id="heartbeat-dashboard-disable"
2436 value="disable"
2437 class="heartbeat_radio"
2438 aria-controls="heartbeat-dashboard-interval-control"
2439 <?php checked( 'disable', $settings['heartbeat_dashboard_status'] ); ?>
2440 />
2441 <span aria-hidden="true"></span>
2442 <span id="heartbeat-dashboard-disable-label"><?php esc_html_e( 'Disable', 'powered-cache' ); ?></span>
2443 </label>
2444
2445 <label for="heartbeat-dashboard-modify" class="sui-radio">
2446 <input
2447 type="radio"
2448 name="heartbeat_dashboard_status"
2449 id="heartbeat-dashboard-modify"
2450 value="modify"
2451 aria-controls="heartbeat-dashboard-interval-control"
2452 class="heartbeat_radio"
2453 <?php checked( 'modify', $settings['heartbeat_dashboard_status'] ); ?>
2454 />
2455 <span aria-hidden="true"></span>
2456 <span id="heartbeat-dashboard-modify-label"><?php esc_html_e( 'Modify', 'powered-cache' ); ?></span>
2457 </label>
2458 </div>
2459 <div id="heartbeat-dashboard-interval-control" style="<?php echo( ! ( 'modify' === $settings['heartbeat_dashboard_status'] ) ? 'display:none' : '' ); ?>">
2460 <label for="heartbeat_dashboard_interval" id="heartbeat-dashboard-label" class="sui-label"><?php esc_html_e( 'Heartbeat Interval for Dashboard', 'powered-cache' ); ?></label>
2461 <div class="sui-form-field">
2462 <input
2463 name="heartbeat_dashboard_interval"
2464 value="<?php echo esc_attr( $settings['heartbeat_dashboard_interval'] ); ?>"
2465 id="heartbeat_dashboard_interval"
2466 class="sui-form-control"
2467 type="number"
2468 min="15"
2469 max="120"
2470 />
2471 </div>
2472 </div>
2473 <!-- end dashboard heartbeat -->
2474
2475 <h4><?php esc_html_e( 'Post Editor', 'powered-cache' ); ?></h4>
2476
2477 <!-- start post editor heartbeat -->
2478 <div class="sui-form-field" role="radiogroup">
2479 <label for="heartbeat-editor-enable" class="sui-radio">
2480 <input
2481 type="radio"
2482 name="heartbeat_editor_status"
2483 id="heartbeat-editor-enable"
2484 value="enable"
2485 class="heartbeat_radio"
2486 aria-controls="heartbeat-editor-interval-control"
2487 <?php checked( 'enable', $settings['heartbeat_editor_status'] ); ?>
2488
2489 />
2490 <span aria-hidden="true"></span>
2491 <span id="heartbeat-editor-enable-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2492 </label>
2493
2494 <label for="heartbeat-editor-disable" class="sui-radio">
2495 <input
2496 type="radio"
2497 name="heartbeat_editor_status"
2498 id="heartbeat-editor-disable"
2499 value="disable"
2500 class="heartbeat_radio"
2501 aria-controls="heartbeat-editor-interval-control"
2502 <?php checked( 'disable', $settings['heartbeat_editor_status'] ); ?>
2503
2504 />
2505 <span aria-hidden="true"></span>
2506 <span id="heartbeat-editor-disable-label"><?php esc_html_e( 'Disable', 'powered-cache' ); ?></span>
2507 </label>
2508
2509 <label for="heartbeat-editor-modify" class="sui-radio">
2510 <input
2511 type="radio"
2512 name="heartbeat_editor_status"
2513 id="heartbeat-editor-modify"
2514 value="modify"
2515 aria-controls="heartbeat-editor-interval-control"
2516 class="heartbeat_radio"
2517 <?php checked( 'modify', $settings['heartbeat_editor_status'] ); ?>
2518
2519 />
2520 <span aria-hidden="true"></span>
2521 <span id="heartbeat-editor-modify-label"><?php esc_html_e( 'Modify', 'powered-cache' ); ?></span>
2522 </label>
2523 </div>
2524 <div id="heartbeat-editor-interval-control" style="<?php echo( ! ( 'modify' === $settings['heartbeat_editor_status'] ) ? 'display:none' : '' ); ?>">
2525 <label for="heartbeat_editor_interval" id="heartbeat-editor-label" class="sui-label"><?php esc_html_e( 'Heartbeat Interval for Post Editor', 'powered-cache' ); ?></label>
2526 <div class="sui-form-field">
2527 <input
2528 name="heartbeat_editor_interval"
2529 value="<?php echo esc_attr( $settings['heartbeat_editor_interval'] ); ?>"
2530 id="heartbeat_editor_interval"
2531 class="sui-form-control"
2532 type="number"
2533 min="15"
2534 max="120"
2535 />
2536 </div>
2537 </div>
2538 <!-- end post editor heartbeat -->
2539
2540 <h4><?php esc_html_e( 'Frontend', 'powered-cache' ); ?></h4>
2541
2542 <!-- start frontend heartbeat -->
2543 <div class="sui-form-field" role="radiogroup">
2544 <label for="heartbeat-frontend-enable" class="sui-radio">
2545 <input
2546 type="radio"
2547 name="heartbeat_frontend_status"
2548 id="heartbeat-frontend-enable"
2549 value="enable"
2550 class="heartbeat_radio"
2551 aria-controls="heartbeat-frontend-interval-control"
2552 <?php checked( 'enable', $settings['heartbeat_frontend_status'] ); ?>
2553 />
2554 <span aria-hidden="true"></span>
2555 <span id="heartbeat-frontend-enable-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2556 </label>
2557
2558 <label for="heartbeat-frontend-disable" class="sui-radio">
2559 <input
2560 type="radio"
2561 name="heartbeat_frontend_status"
2562 id="heartbeat-frontend-disable"
2563 value="disable"
2564 class="heartbeat_radio"
2565 aria-controls="heartbeat-frontend-interval-control"
2566 <?php checked( 'disable', $settings['heartbeat_frontend_status'] ); ?>
2567 />
2568 <span aria-hidden="true"></span>
2569 <span id="heartbeat-frontend-disable-label"><?php esc_html_e( 'Disable', 'powered-cache' ); ?></span>
2570 </label>
2571
2572 <label for="heartbeat-frontend-modify" class="sui-radio">
2573 <input
2574 type="radio"
2575 name="heartbeat_frontend_status"
2576 id="heartbeat-frontend-modify"
2577 value="modify"
2578 aria-controls="heartbeat-frontend-interval-control"
2579 class="heartbeat_radio"
2580 <?php checked( 'modify', $settings['heartbeat_frontend_status'] ); ?>
2581 />
2582 <span aria-hidden="true"></span>
2583 <span id="heartbeat-frontend-modify-label"><?php esc_html_e( 'Modify', 'powered-cache' ); ?></span>
2584 </label>
2585 </div>
2586
2587 <div id="heartbeat-frontend-interval-control" style="<?php echo( ! ( 'modify' === $settings['heartbeat_frontend_status'] ) ? 'display:none' : '' ); ?>">
2588 <label for="heartbeat_frontend_interval" id="heartbeat-frontend-label" class="sui-label"><?php esc_html_e( 'Heartbeat Interval for Dashboard', 'powered-cache' ); ?></label>
2589 <div class="sui-form-field">
2590 <input
2591 name="heartbeat_frontend_interval"
2592 value="<?php echo esc_attr( $settings['heartbeat_frontend_interval'] ); ?>"
2593 id="heartbeat_frontend_interval"
2594 class="sui-form-control"
2595 type="number"
2596 min="15"
2597 max="120"
2598 />
2599 </div>
2600 </div>
2601 <!-- end frontend heartbeat -->
2602
2603 </div>
2604 </div><!-- end box_content_class -->
2605 </div>
2606 </div>
2607 </div>
2608 <div class="sui-row">
2609 <div class="sui-col-lg-6">
2610 <div id="extension-varnish" class="powered-cache-extension-box sui-box">
2611
2612 <div class="sui-box-header">
2613 <h3 class="sui-box-title"><?php esc_html_e( 'Varnish', 'powered-cache' ); ?></h3>
2614 <?php if ( ! is_premium() ) : ?>
2615 <div class="sui-actions-left">
2616 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
2617 </div>
2618 <?php endif; ?>
2619 <div class="sui-actions-right">
2620 <div class="sui-form-field">
2621 <label for="enable_varnish" class="sui-toggle">
2622 <input
2623 <?php echo( ! is_premium() ? 'disabled="disabled"' : '' ); ?>
2624 type="checkbox"
2625 id="enable_varnish"
2626 name="enable_varnish"
2627 aria-labelledby="enable_varnish_label"
2628 value="1"
2629 aria-controls="varnish_details"
2630 <?php checked( 1, $settings['enable_varnish'] ); ?>
2631 >
2632
2633 <span class="sui-toggle-slider" aria-hidden="true"></span>
2634 <span id="enable_varnish_label" class="sui-toggle-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2635 </label>
2636 </div>
2637 </div>
2638 </div><!-- end sui-box-title -->
2639
2640 <div class="sui-box-body sui-upsell-items">
2641 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
2642 <div class="sui-box-settings-col">
2643 <p><?php esc_html_e( 'Purge Varnish cache.It\'s recommended when you are using the Varnish server.', 'powered-cache' ); ?></p>
2644
2645 <div id="varnish_details" style="<?php echo( ! $settings['enable_varnish'] ? 'display:none' : '' ); ?>">
2646 <div class="sui-form-field">
2647
2648 <label for="varnish_ip" id="varnish-ip-label" class="sui-label"><?php esc_html_e( 'Varnish IP', 'powered-cache' ); ?></label>
2649
2650 <input
2651 placeholder="127.0.0.1"
2652 id="varnish_ip"
2653 name="varnish_ip"
2654 value="<?php echo esc_attr( $settings['varnish_ip'] ); ?>"
2655 class="sui-form-control"
2656 />
2657 </div>
2658 </div>
2659 </div>
2660
2661 </div>
2662 <?php if ( ! is_premium() ) : ?>
2663 <div class="sui-box-settings-row sui-upsell-row">
2664 <div class="sui-upsell-notice" style="padding-left: 0;">
2665 <p><?php esc_html_e( 'With our premium version of Powered Cache you can use Varnish extension and unlock some other speedbooster features.', 'powered-cache' ); ?><br>
2666 <a href="https://poweredcache.com/" rel="noopener" target="_blank" class="sui-button sui-button-purple" style="margin-top: 10px;color:#fff;"><?php esc_html_e( 'Try Premium today', 'powered-cache' ); ?></a>
2667 </p>
2668 </div>
2669 </div>
2670 <?php endif; ?>
2671 </div><!-- end box_content_class -->
2672
2673 </div><!-- end box-dashboard-performance-disabled -->
2674 </div>
2675
2676 <div class="sui-col-lg-6">
2677 <div id="extension-ga" class="powered-cache-extension-box sui-box">
2678 <div class="sui-box-header">
2679 <h3 class="sui-box-title"><?php esc_html_e( 'Google Tracking', 'powered-cache' ); ?></h3>
2680 <?php if ( ! is_premium() ) : ?>
2681 <div class="sui-actions-left">
2682 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
2683 </div>
2684 <?php endif; ?>
2685 <div class="sui-actions-right">
2686 <div class="sui-form-field">
2687 <label for="enable_google_tracking" id="enable_google_tracking_label" class="sui-toggle">
2688 <input
2689 <?php echo( ! is_premium() ? 'disabled="disabled"' : '' ); ?>
2690 type="checkbox"
2691 id="enable_google_tracking"
2692 name="enable_google_tracking"
2693 aria-labelledby="enable_google_tracking_label"
2694 value="1"
2695 <?php checked( 1, $settings['enable_google_tracking'] ); ?>
2696 >
2697 <span class="sui-toggle-slider" aria-hidden="true"></span>
2698 <span id="enable_cloudflare_label" class="sui-toggle-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2699 </label>
2700 </div>
2701 </div>
2702 </div><!-- end sui-box-title -->
2703
2704 <div class="sui-box-body sui-upsell-items">
2705 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
2706 <div class="sui-box-settings-col">
2707 <p><?php esc_html_e( 'Powered Cache will host Google scripts on your server to help satisfy the PageSpeed recommendation for leverage browser caching.', 'powered-cache' ); ?></p>
2708 </div>
2709
2710 </div>
2711 <?php if ( ! is_premium() ) : ?>
2712 <div class="sui-box-settings-row sui-upsell-row">
2713 <div class="sui-upsell-notice" style="padding-left: 0;">
2714 <p><?php esc_html_e( 'With our premium version of Powered Cache you can use this extension and unlock some other speedbooster features.', 'powered-cache' ); ?><br>
2715 <a href="https://poweredcache.com/" rel="noopener" target="_blank" class="sui-button sui-button-purple" style="margin-top: 10px;color:#fff;"><?php esc_html_e( 'Try Premium today', 'powered-cache' ); ?></a>
2716 </p>
2717 </div>
2718 </div>
2719 <?php endif; ?>
2720 </div><!-- end box_content_class -->
2721
2722 </div>
2723 </div>
2724
2725 </div>
2726 <div class="sui-row">
2727 <div class="sui-col-lg-6">
2728 <div id="extension-fb-pixel" class="powered-cache-extension-box sui-box">
2729
2730 <div class="sui-box-header">
2731 <h3 class="sui-box-title"><?php esc_html_e( 'Facebook Tracking', 'powered-cache' ); ?></h3>
2732 <?php if ( ! is_premium() ) : ?>
2733 <div class="sui-actions-left">
2734 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
2735 </div>
2736 <?php endif; ?>
2737 <div class="sui-actions-right">
2738 <div class="sui-form-field">
2739 <label for="enable_fb_tracking" class="sui-toggle">
2740 <input
2741 <?php echo( ! is_premium() ? 'disabled="disabled"' : '' ); ?>
2742 type="checkbox"
2743 id="enable_fb_tracking"
2744 name="enable_fb_tracking"
2745 aria-labelledby="enable_fb_tracking_label"
2746 value="1"
2747 <?php checked( 1, $settings['enable_fb_tracking'] ); ?>
2748 >
2749
2750 <span class="sui-toggle-slider" aria-hidden="true"></span>
2751 <span id="enable_fb_tracking_label" class="sui-toggle-label"><?php esc_html_e( 'Enable', 'powered-cache' ); ?></span>
2752 </label>
2753 </div>
2754 </div>
2755 </div><!-- end sui-box-title -->
2756
2757 <div class="sui-box-body sui-upsell-items">
2758 <div class="sui-box-settings-row <?php echo( ! is_premium() ? 'sui-disabled' : '' ); ?>">
2759 <div class="sui-box-settings-col">
2760 <p><?php esc_html_e( 'Powered Cache will host FB js on your server to help satisfy the PageSpeed recommendation for leverage browser caching.', 'powered-cache' ); ?></p>
2761 </div>
2762
2763 </div>
2764 <?php if ( ! is_premium() ) : ?>
2765 <div class="sui-box-settings-row sui-upsell-row">
2766 <div class="sui-upsell-notice" style="padding-left: 0;">
2767 <p><?php esc_html_e( 'With our premium version of Powered Cache you can use this extension and unlock some other speedbooster features.', 'powered-cache' ); ?><br>
2768 <a href="https://poweredcache.com/" rel="noopener" target="_blank" class="sui-button sui-button-purple" style="margin-top: 10px;color:#fff;"><?php esc_html_e( 'Try Premium today', 'powered-cache' ); ?></a>
2769 </p>
2770 </div>
2771 </div>
2772 <?php endif; ?>
2773 </div><!-- end box_content_class -->
2774
2775 </div><!-- end box-dashboard-performance-disabled -->
2776 </div>
2777 </div>
2778
2779 </div>
2780
2781 <!-- TAB: Dashed -->
2782 <div class="sui-box" id="misc-settings" data-tab="misc-settings" style="display: none;">
2783
2784 <div class="sui-box-header">
2785 <h2 class="sui-box-title"><?php esc_html_e( 'Misc Settings', 'powered-cache' ); ?></h2>
2786 </div>
2787
2788 <div class="sui-box-body">
2789 <div class="sui-box-settings-row">
2790 <div class="sui-box-settings-col-1">
2791 <span class="sui-settings-label"><?php esc_html_e( 'Cache Footprint', 'powered-cache' ); ?></span>
2792 <span class="sui-description"></span>
2793 </div>
2794
2795 <div class="sui-box-settings-col-2">
2796 <div class="sui-form-field">
2797 <label for="cache_footprint" id="cache_footprint_label" class="sui-toggle">
2798 <input
2799 type="checkbox"
2800 id="cache_footprint"
2801 name="cache_footprint"
2802 aria-labelledby="cache_footprint_label"
2803 aria-describedby="enable_cache_footprint_description"
2804 value="1"
2805 <?php checked( 1, $settings['cache_footprint'] ); ?>
2806 >
2807 <span class="sui-toggle-slider" aria-hidden="true"></span>
2808 <span id="enable_cache_footprint_label" class="sui-toggle-label"><?php esc_html_e( 'Show caching footprints in the HTML output.', 'powered-cache' ); ?></span>
2809 <span id="enable_cache_footprint_description" class="sui-description"><?php esc_html_e( 'Adds helpful information to cached output.', 'powered-cache' ); ?></span>
2810 </label>
2811 </div>
2812 </div>
2813 </div>
2814
2815 <!-- Developer Mode Toggle -->
2816 <div class="sui-box-settings-row">
2817 <div class="sui-box-settings-col-1">
2818 <span class="sui-settings-label"><?php esc_html_e( 'Development Mode', 'powered-cache' ); ?></span>
2819 <span class="sui-description"><?php esc_html_e( 'Temporarily disables caching and optimizations. Useful while making changes to your site.', 'powered-cache' ); ?></span>
2820 </div>
2821
2822 <div class="sui-box-settings-col-2">
2823 <div class="sui-form-field">
2824 <?php if ( \PoweredCache\Utils\is_dev_mode_active() ) : ?>
2825 <button
2826 type="submit"
2827 name="powered_cache_form_action"
2828 value="disable_dev_mode"
2829 class="sui-button sui-button-ghost sui-button-green"
2830 >
2831 <?php esc_html_e( 'Disable Dev Mode', 'powered-cache' ); ?>
2832 </button>
2833 <p class="sui-description">
2834 <?php esc_html_e( 'Development mode is currently active. Caching and optimizations are disabled until turned off.', 'powered-cache' ); ?>
2835 </p>
2836 <?php else : ?>
2837 <button
2838 type="submit"
2839 name="powered_cache_form_action"
2840 value="enable_dev_mode"
2841 class="sui-button sui-button-ghost sui-button-red"
2842 >
2843 <?php esc_html_e( 'Enable Dev Mode', 'powered-cache' ); ?>
2844 </button>
2845 <p class="sui-description">
2846 <?php esc_html_e( 'Temporarily disables caching and optimizations. Useful while making changes to your site.', 'powered-cache' ); ?>
2847 </p>
2848 <?php endif; ?>
2849
2850 </div>
2851 </div>
2852 </div>
2853
2854
2855 <div class="sui-box-settings-row">
2856 <div class="sui-box-settings-col-1">
2857 <span class="sui-settings-label"><?php esc_html_e( 'Async Cache Cleaning', 'powered-cache' ); ?>
2858 <span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Experimental', 'powered-cache' ); ?></span>
2859 </span>
2860
2861 <span class="sui-description"></span>
2862 </div>
2863
2864 <div class="sui-box-settings-col-2">
2865 <div class="sui-form-field">
2866 <label for="async_cache_cleaning" id="async_cache_cleaning_label" class="sui-toggle">
2867 <input
2868 type="checkbox"
2869 id="async_cache_cleaning"
2870 name="async_cache_cleaning"
2871 aria-labelledby="async_cache_cleaning_label"
2872 aria-describedby="enable_async_cache_cleaning_description"
2873 value="1"
2874 <?php checked( 1, $settings['async_cache_cleaning'] ); ?>
2875 >
2876 <span class="sui-toggle-slider" aria-hidden="true"></span>
2877 <span id="enable_async_cache_cleaning_label" class="sui-toggle-label"><?php esc_html_e( 'Enable async cache clean-up.', 'powered-cache' ); ?></span>
2878 <span id="enable_async_cache_cleaning_description" class="sui-description"><?php esc_html_e( 'On large sites, it might take a longer time to perform cache purging actions. This option allows performing clean-up tasks in async background processes.', 'powered-cache' ); ?>
2879 <i>(<?php esc_html_e( 'This is an experimental feature, use it wisely. It might conflict with preloading functionality since both features work in the background.', 'powered-cache' ); ?>)</i>
2880 </span>
2881 </label>
2882 </div>
2883 </div>
2884 </div>
2885
2886
2887 <?php if ( can_control_all_settings() ) : ?>
2888 <div class="sui-box-settings-row">
2889 <div class="sui-box-settings-col-1">
2890 <span class="sui-settings-label"><?php esc_html_e( 'Download Configuration', 'powered-cache' ); ?></span>
2891 <span class="sui-description"></span>
2892 </div>
2893
2894 <div class="sui-box-settings-col-2">
2895 <div class="sui-form-field">
2896 <a href="<?php echo esc_url_raw( wp_nonce_url( admin_url( 'admin-post.php?action=powered_cache_download_rewrite_settings&server=apache' ), 'powered_cache_download_rewrite' ) ); ?>" value="download_htaccess_configuration" class="sui-button sui-button-ghost sui-button-blue"><?php esc_html_e( '.htaccess configuration', 'powered-cache' ); ?></a>
2897 <a href="<?php echo esc_url_raw( wp_nonce_url( admin_url( 'admin-post.php?action=powered_cache_download_rewrite_settings&server=nginx' ), 'powered_cache_download_rewrite' ) ); ?>" value="download_nginx_configuration" class="sui-button sui-button-ghost sui-button-blue"><?php esc_html_e( 'nginx configuration', 'powered-cache' ); ?></a>
2898 </div>
2899 </div>
2900 </div>
2901 <?php endif; ?>
2902
2903 <div class="sui-box-settings-row">
2904 <div class="sui-box-settings-col-1">
2905 <span class="sui-settings-label"><?php esc_html_e( 'Reset All Settings', 'powered-cache' ); ?></span>
2906 <span class="sui-description"><?php esc_html_e( 'Fabric reset to plugin configuration', 'powered-cache' ); ?></span>
2907 </div>
2908
2909 <div class="sui-box-settings-col-2">
2910 <div class="sui-form-field">
2911 <button role="submit" name="powered_cache_form_action" value="reset_settings" class="sui-button sui-button-ghost sui-button-blue">
2912 <?php esc_html_e( 'Reset Settings', 'powered-cache' ); ?>
2913 </button>
2914
2915 </div>
2916 </div>
2917 </div>
2918 <?php if ( can_control_all_settings() ) : ?>
2919 <div class="sui-box-settings-row">
2920 <div class="sui-box-settings-col-1">
2921 <span class="sui-settings-label"><?php esc_html_e( 'Diagnostic', 'powered-cache' ); ?></span>
2922 <span class="sui-description"><?php esc_html_e( 'Configuration checker for caching', 'powered-cache' ); ?></span>
2923 </div>
2924
2925 <div class="sui-box-settings-col-2">
2926 <div class="sui-form-field">
2927 <button role="button" value="run_diognastic" data-modal-open="pcmodal--powered-cache-diagnostic" class="sui-button sui-button-ghost sui-button-blue" data-esc-close="true" data-modal-mask="true"><?php esc_html_e( 'Run Diagnostic', 'powered-cache' ); ?></button>
2928 </div>
2929 </div>
2930 </div>
2931 <?php endif; ?>
2932
2933
2934 <div class="sui-box-settings-row">
2935 <div class="sui-box-settings-col-1">
2936 <span class="sui-settings-label"><?php esc_html_e( 'Export', 'powered-cache' ); ?></span>
2937 <span class="sui-description"></span>
2938 </div>
2939
2940 <div class="sui-box-settings-col-2">
2941 <div class="sui-form-field">
2942 <button type="submit" role="button" name="powered_cache_form_action" value="export_settings" class="sui-button sui-button-ghost sui-button-blue"><?php esc_html_e( 'Download Settings', 'powered-cache' ); ?></button>
2943 <?php if ( $settings['enable_cloudflare'] ) : ?>
2944 <div role="alert" class="sui-notice sui-notice-yellow sui-active sui-padding-top" aria-live="assertive" style="display: block;">
2945 <div class="sui-notice-content">
2946 <div class="sui-notice-message">
2947 <span class="sui-notice-icon sui-icon-info sui-md" aria-hidden="true"></span>
2948 <p>
2949 <strong><?php esc_html_e( 'Please note:', 'powered-cache' ); ?></strong>
2950 <?php esc_html_e( 'Due to the sensitive nature of Cloudflare API credentials, they will not be included in the exported settings file.', 'powered-cache' ); ?>
2951 <a href="<?php echo esc_url( get_doc_url( 'cloudflare' ) ); ?>" target="_blank"><?php esc_html_e( 'Learn More', 'powered-cache' ); ?></a>
2952 </p>
2953 </div>
2954 </div>
2955 </div>
2956 <?php endif; ?>
2957 </div>
2958 </div>
2959 </div>
2960
2961 <div class="sui-box-settings-row">
2962 <div class="sui-box-settings-col-1">
2963 <span class="sui-settings-label"><?php esc_html_e( 'Import', 'powered-cache' ); ?></span>
2964 <span class="sui-description"></span>
2965 </div>
2966
2967 <div class="sui-box-settings-col-2">
2968 <div class="sui-form-field">
2969 <div class="sui-upload" id="powered-cache-import-upload-wrap">
2970 <input id="powered-cache-import-file-input" class="powered-cache-file-input" name="import_file" type="file" value="" readonly="readonly" accept=".json">
2971 <label class="sui-upload-button" type="button" for="powered-cache-import-file-input">
2972 <span class="sui-icon-upload-cloud" aria-hidden="true"></span>
2973 <?php esc_html_e( 'Upload file', 'powered-cache' ); ?>
2974 </label>
2975 <div class="sui-upload-file">
2976 <span id="powered-cache-import-file-name"></span>
2977 <button type="button" id="powered-cache-import-remove-file" aria-label="Remove file">
2978 <span class="sui-icon-close" aria-hidden="true"></span>
2979 </button>
2980 </div>
2981
2982 <button role="button" id="powered-cache-import-btn" name="powered_cache_form_action" value="import_settings" style="margin-left: 10px;" class="sui-button sui-button-ghost sui-button-blue" disabled>
2983 <?php esc_html_e( 'Upload and Import', 'powered-cache' ); ?>
2984 </button>
2985
2986 </div>
2987 <span class="sui-description" style="margin-top: 10px;"><?php esc_html_e( 'Choose a JSON(.json) file to import the configuration.', 'powered-cache' ); ?></span>
2988 </div>
2989
2990 </div>
2991
2992 </div>
2993 </div>
2994
2995 </div>
2996
2997 <?php do_action( 'powered_cache_admin_page_after_settings_section' ); ?>
2998
2999 </section>
3000 </form>
3001
3002 <!-- ELEMENT: The Brand -->
3003 <div class="sui-footer">
3004 <?php
3005 echo wp_kses_post(
3006 sprintf(
3007 __( 'Made with <i class="sui-icon-heart"></i> by <a href="%s" rel="noopener" target="_blank">PoweredCache</a>', 'powered-cache' ),
3008 'https://poweredcache.com/'
3009 )
3010 );
3011 ?>
3012 </div>
3013
3014 <footer>
3015 <!-- ELEMENT: Navigation -->
3016 <ul class="sui-footer-nav">
3017 <li><a href="https://poweredcache.com/faq/" target="_blank"><?php esc_html_e( 'FAQ', 'powered-cache' ); ?></a></li>
3018 <li><a href="https://poweredcache.com/blog/" target="_blank"><?php esc_html_e( 'Blog', 'powered-cache' ); ?></a></li>
3019 <li><a href="https://poweredcache.com/changelog/" target="_blank"><?php esc_html_e( 'Changelog', 'powered-cache' ); ?></a></li>
3020 <li><a href="https://poweredcache.com/support/" target="_blank"><?php esc_html_e( 'Support', 'powered-cache' ); ?></a></li>
3021 </ul>
3022
3023 <!-- ELEMENT: Social Media -->
3024 <ul class="sui-footer-social">
3025 <li><a href="https://www.facebook.com/poweredcache" target="_blank">
3026 <i class="sui-icon-social-facebook" aria-hidden="true"></i>
3027 <span class="sui-screen-reader-text"><?php esc_html_e( 'Facebook', 'powered-cache' ); ?></span>
3028 </a></li>
3029 <li><a href="https://twitter.com/poweredcache" target="_blank">
3030 <i class="sui-icon-social-twitter" aria-hidden="true"></i></a>
3031 <span class="sui-screen-reader-text"><?php esc_html_e( 'Twitter', 'powered-cache' ); ?></span>
3032 </li>
3033 </ul>
3034 </footer>
3035
3036 <?php require 'modals.php'; ?>
3037 </main>
3038