-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_partials_settings-page.php.html
More file actions
3123 lines (2797 loc) · 163 KB
/
admin_partials_settings-page.php.html
File metadata and controls
3123 lines (2797 loc) · 163 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PoweredCache Hooks: Source: admin/partials/settings-page.php</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Source: admin/partials/settings-page.php</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code><?php
/**
* Settings Page Template
*
* @package PoweredCache
*/
namespace PoweredCache\Admin\Partials\SettingsPage;
use PoweredCache\Async\CachePreloader;
use function PoweredCache\Utils\can_configure_htaccess;
use function PoweredCache\Utils\can_configure_object_cache;
use function PoweredCache\Utils\can_control_all_settings;
use function PoweredCache\Utils\cdn_zones;
use function PoweredCache\Utils\get_available_object_caches;
use function PoweredCache\Utils\get_decrypted_setting;
use function PoweredCache\Utils\get_doc_url;
use function PoweredCache\Utils\get_timeout_with_interval;
use function PoweredCache\Utils\is_local_site;
use function PoweredCache\Utils\is_premium;
use function PoweredCache\Utils\mask_string;
use function PoweredCache\Utils\sanitize_css;
use function PoweredCache\Utils\scheduled_cleanup_frequency_options;
use const PoweredCache\Constants\UNMASK_CHARACTER_LENGTH;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
// phpcs:disable WordPress.WhiteSpace.PrecisionAlignment.Found
// phpcs:disable Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed
// phpcs:disable WordPress.WP.I18n.MissingTranslatorsComment
// phpcs:disable WordPressVIPMinimum.Security.ProperEscapingFunction.htmlAttrNotByEscHTML
// phpcs:disable WordPressVIPMinimum.Security.ProperEscapingFunction.notAttrEscAttr
$settings = \PoweredCache\Utils\get_settings();
$cf_api_key = \PoweredCache\Extensions\Cloudflare\Cloudflare::get_cf_api_key();
$cf_api_token = \PoweredCache\Extensions\Cloudflare\Cloudflare::get_cf_api_token();
?>
<main class="sui-wrap">
<div class="sui-header">
<h1 class="sui-header-title">
<img width="32" alt="<?php esc_html_e( 'Powered Cache Icon', 'powered-cache' ); ?>"
src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkJz48c3ZnIGhlaWdodD0iMzJweCIgaWQ9IkxheWVyXzEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgdmVyc2lvbj0iMS4xIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHdpZHRoPSIzMnB4IiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxNDQgMzM2KSI+PHBhdGggZD0iTS0xMTcuMTc2LTMzNC4wNjNoLTkuMzUzTC0xMzguMTExLTMyMGg5LjMwNGwtMTEuNzQ1LDE0LjA2M2wyNS4xMDUtMTguMzE2aC05LjgwOUwtMTE3LjE3Ni0zMzQuMDYzeiIvPjwvZz48L3N2Zz4=">
<?php esc_html_e( 'Powered Cache', 'powered-cache' ); ?>
</h1>
<!-- Float element to Right -->
<div class="sui-actions-right">
<a href="<?php echo esc_url( get_doc_url( '/' ) ); ?>" target="_blank" class="sui-button sui-hidden-sm sui-button-blue">
<i class="sui-icon-academy" aria-hidden="true"></i>
<?php esc_html_e( 'Documentation', 'powered-cache' ); ?>
</a>
</div>
</div>
<?php \PoweredCache\Utils\settings_errors(); ?>
<form method="post" action="" enctype="multipart/form-data">
<?php wp_nonce_field( 'powered_cache_update_settings', 'powered_cache_settings_nonce' ); ?>
<section class="sui-row-with-sidenav">
<!-- Navigation -->
<div class="sui-sidenav" role="navigation">
<ul class="sui-vertical-tabs">
<li class="sui-vertical-tab current">
<a href="#basic-options" role="button" data-tab="basic-options"><?php esc_html_e( 'Basic Options', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#advanced-options" role="button" data-tab="advanced-options"><?php esc_html_e( 'Advanced Options', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#file-optimization" role="button" data-tab="file-optimization"><?php esc_html_e( 'File Optimization', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#media-optimization" role="button" data-tab="media-optimization"><?php esc_html_e( 'Media Optimization', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#cdn-integration" role="button" data-tab="cdn-integration"><?php esc_html_e( 'CDN Integration', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#preload" role="button" data-tab="preload"><?php esc_html_e( 'Preload', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#db-optimization" role="button" data-tab="db-optimization"><?php esc_html_e( 'Database', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#extensions" role="button" data-tab="extensions"><?php esc_html_e( 'Extensions', 'powered-cache' ); ?></a>
</li>
<li class="sui-vertical-tab">
<a href="#misc-settings" role="button" data-tab="misc-settings"><?php esc_html_e( 'Misc', 'powered-cache' ); ?></a>
</li>
<?php
/**
* Fires after settings nav. Used for injecting new settings tabs..
*
* @hook powered_cache_admin_page_after_settings_nav
*
* @since 2.0
*/
do_action( 'powered_cache_admin_page_after_settings_nav' );
?>
</ul>
<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>
</div>
<!-- TAB: Regular -->
<div class="sui-box" id="basic-options" data-tab="basic-options" style="">
<div class="sui-box-header">
<h2 class="sui-box-title"><?php esc_html_e( 'Basic Options', 'powered-cache' ); ?></h2>
</div>
<div class="sui-box-body">
<!-- Page Cache settings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Page Cache', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="enable_page_cache" class="sui-toggle">
<input
type="checkbox"
id="enable_page_cache"
name="enable_page_cache"
aria-labelledby="enable_page_cache_label"
aria-describedby="enable_page_cache_description"
<?php checked( 1, $settings['enable_page_cache'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="enable_page_cache_label" class="sui-toggle-label"><?php esc_html_e( 'Enable page cache', 'powered-cache' ); ?></span>
</label>
<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' ); ?>
<a href="<?php echo esc_url( get_doc_url( 'page-caching' ) ); ?>" target="_blank"><?php esc_html_e( 'Learn More', 'powered-cache' ); ?></a>
</span>
</div>
</div>
</div>
<?php if ( can_configure_object_cache() ) : ?>
<!-- Object Caching settings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Object Cache', 'powered-cache' ); ?></span>
<span class="sui-description"><?php esc_html_e( 'Speed up dynamic pageviews.', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<select id="object_cache" name="object_cache">
<option value="off" <?php selected( $settings['object_cache'], 'off' ); ?>><?php esc_html_e( 'Off', 'powered-cache' ); ?></option>
<?php foreach ( get_available_object_caches() as $object_cache_backend ) : ?>
<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>
<?php endforeach; ?>
</select>
<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>
<div role="alert" id="object_cache_alloptions_message" class="sui-hidden sui-notice" aria-live="assertive">
<div class="sui-notice-content">
<div class="sui-notice-message">
</div>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<!-- Mobile Cache settings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Mobile Cache', 'powered-cache' ); ?></span>
<span class="sui-description"><?php esc_html_e( 'Cache for mobile devices', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="cache_mobile" class="sui-toggle">
<input type="checkbox"
value="1"
name="cache_mobile"
id="cache_mobile"
aria-controls="cache_mobile_separate_file_controls"
<?php checked( 1, $settings['cache_mobile'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="toggle-6-label" class="sui-toggle-label"><?php esc_html_e( 'Enable caching for mobile devices.', 'powered-cache' ); ?></span>
</label>
<div style=" <?php echo( ! $settings['cache_mobile'] ? 'display:none' : '' ); ?>" tabindex="0" id="cache_mobile_separate_file_controls">
<div class="sui-form-field">
<label for="cache_mobile_separate_file" class="sui-toggle">
<input type="checkbox"
value="1"
name="cache_mobile_separate_file"
id="cache_mobile_separate_file"
<?php checked( 1, $settings['cache_mobile_separate_file'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="cache_mobile_separate_file_label" class="sui-toggle-label"><?php esc_html_e( 'Use separate cache file for mobile.', 'powered-cache' ); ?></span>
</label>
</div>
</div>
</div>
</div>
</div>
<!-- Logged-in cache settings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Logged in user cache', 'powered-cache' ); ?></span>
<span class="sui-description"><?php esc_html_e( 'It creates a separate cache for each users.', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="loggedin_user_cache" class="sui-toggle">
<input type="checkbox"
value="1"
name="loggedin_user_cache"
id="loggedin_user_cache"
<?php checked( 1, $settings['loggedin_user_cache'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="loggedin_user_cache_label" class="sui-toggle-label"><?php esc_html_e( 'Enable caching for logged-in users', 'powered-cache' ); ?></span>
<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>
</label>
</div>
</div>
</div>
<?php if ( function_exists( 'gzencode' ) ) : ?>
<!-- Gzip compression settings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Gzip Compression', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="gzip_compression" class="sui-toggle">
<input type="checkbox"
value="1"
name="gzip_compression"
id="gzip_compression"
aria-labelledby="gzip_compression_label"
<?php checked( 1, $settings['gzip_compression'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="gzip_compression_label" class="sui-toggle-label"><?php esc_html_e( 'Enable gzip compression', 'powered-cache' ); ?></span>
<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>
</label>
</div>
</div>
</div>
<?php endif; ?>
<!-- Cache Timeout -->
<?php list( $cache_timeout, $selected_interval ) = get_timeout_with_interval( $settings['cache_timeout'] ); ?>
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Cache Timeout', 'powered-cache' ); ?></span>
<span class="sui-description"><?php esc_html_e( 'The lifespan of the cached page. Expired cache purges with WP Cron.', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<input
name="cache_timeout"
id="cache_timeout"
class="sui-form-control sui-field-has-suffix"
min="1"
type="number"
value="<?php echo absint( $cache_timeout ); ?>"
/>
<span class="sui-field-suffix" style="margin-left:0;">
<div class="sui-form-field sui-input-md">
<select id="cache_timeout_interval" name="cache_timeout_interval" class="sui-form-control">
<option <?php selected( 'MINUTE', $selected_interval ); ?> value="MINUTE"><?php echo esc_html__( 'Minute', 'powered-cache' ); ?></option>
<option <?php selected( 'HOUR', $selected_interval ); ?> value="HOUR"><?php echo esc_html__( 'Hour', 'powered-cache' ); ?></option>
<option <?php selected( 'DAY', $selected_interval ); ?> value="DAY"><?php echo esc_html__( 'Day', 'powered-cache' ); ?></option>
</select>
</div>
</span>
</div>
</div>
</div>
</div>
<div class="sui-box-footer">
<?php require 'settings-form-action.php'; ?>
</div>
</div>
<!-- TAB: Advanced Options -->
<div class="sui-box" id="advanced-options" data-tab="advanced-options" style="display: none">
<div class="sui-box-header">
<h2 class="sui-box-title"><?php esc_html_e( 'Advanced Options', 'powered-cache' ); ?></h2>
</div>
<div class="sui-box-body">
<?php if ( can_configure_htaccess() ) : ?>
<!-- .htaccess settings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( '.htaccess Configuration', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="auto_configure_htaccess" class="sui-toggle">
<input
type="checkbox"
id="auto_configure_htaccess"
name="auto_configure_htaccess"
aria-labelledby="auto_configure_htaccess_label"
<?php checked( 1, $settings['auto_configure_htaccess'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="auto_configure_htaccess_label" class="sui-toggle-label"><?php esc_html_e( 'Automatically configure .htaccess', 'powered-cache' ); ?></span>
</label>
<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>
</div>
</div>
</div>
<?php endif; ?>
<!-- Rejected user agents -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Rejected User Agents', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="rejected_user_agents" class="sui-label"><i><?php esc_html_e( 'Enter rejected user agents (one per line)', 'powered-cache' ); ?></i></label>
<textarea
placeholder="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
id="rejected_user_agents"
name="rejected_user_agents"
class="sui-form-control"
aria-describedby="rejected_user_agents_description"
rows="5"
><?php echo esc_textarea( $settings['rejected_user_agents'] ); ?></textarea>
<span id="rejected_user_agents_description" class="sui-description">
<?php esc_html_e( 'Never send cached results for these user agents.', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'rejected-user-agents' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Rejected cookies -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label" id="rejected_cookies_label"><?php esc_html_e( 'Rejected Cookies', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="rejected_cookies" class="sui-label"><i><?php esc_html_e( 'Enter rejected cookies (one per line)', 'powered-cache' ); ?></i></label>
<textarea
placeholder="wordpress_"
id="rejected_cookies"
name="rejected_cookies"
class="sui-form-control"
aria-labelledby="rejected_cookies_label"
aria-describedby="rejected_cookies_description"
rows="5"
><?php echo esc_textarea( $settings['rejected_cookies'] ); ?></textarea>
<span id="rejected_cookies_description" class="sui-description"><?php esc_html_e( 'Never cache pages that use the specified cookies.', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'rejected-cookies' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Rejected Referrers -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label" id="rejected_referrers_label">
<?php esc_html_e( 'Rejected Referrers', 'powered-cache' ); ?>
</span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="rejected_referrers" class="sui-label">
<i><?php esc_html_e( 'Enter rejected referrers (one per line)', 'powered-cache' ); ?></i>
</label>
<textarea
placeholder="https://example.com"
id="rejected_referrers"
name="rejected_referrers"
class="sui-form-control"
aria-labelledby="rejected_referrers_label"
aria-describedby="rejected_referrers_description"
rows="5"
><?php echo esc_textarea( $settings['rejected_referrers'] ); ?></textarea>
<span id="rejected_referrers_description" class="sui-description">
<?php esc_html_e( 'Never cache pages that use the specified referrers.', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'rejected-referrers' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Cookie Vary -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label" id="vary_cookies_label"><?php esc_html_e( 'Vary Cookies', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="vary_cookies" class="sui-label"><i><?php esc_html_e( 'Enter vary cookies (one per line)', 'powered-cache' ); ?></i></label>
<textarea
placeholder="(Eg: cookie_notice_accepted)"
id="vary_cookies"
name="vary_cookies"
class="sui-form-control"
aria-labelledby="vary_cookies_label"
aria-describedby="vary_cookies_description"
rows="5"
><?php echo esc_textarea( $settings['vary_cookies'] ); ?></textarea>
<span id="vary_cookies_description" class="sui-description"><?php esc_html_e( 'Separate cache will be generated based on the cookie match.', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'vary-cookies' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Never cache the following pages -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Never cache the following pages', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<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>
<textarea
placeholder="/example-page"
id="rejected_uri"
name="rejected_uri"
class="sui-form-control"
aria-describedby="rejected_uri_description"
rows="5"
><?php echo esc_textarea( $settings['rejected_uri'] ); ?></textarea>
<span id="rejected_uri_description" class="sui-description"><?php esc_html_e( 'Ignore the specified pages / directories. Supports regex.', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'ignored-pages' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Cache query strings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Cache Query Strings', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<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>
<textarea
id="cache_query_strings"
name="cache_query_strings"
class="sui-form-control"
aria-describedby="cache_query_strings_description"
rows="5"
><?php echo esc_textarea( $settings['cache_query_strings'] ); ?></textarea>
<span id="cache_query_strings_description" class="sui-description">
<?php esc_html_e( 'Powered Cache will create separate caching file for the value of these query strings.', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'cache-query-strings' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Ignored query strings -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Ignored Query Strings', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="ignored_query_strings" class="sui-label"><i><?php esc_html_e( 'Enter allowed query parameter (one per line)', 'powered-cache' ); ?></i></label>
<textarea
placeholder="utm_"
id="ignored_query_strings"
name="ignored_query_strings"
class="sui-form-control"
aria-describedby="ignored_query_strings_description"
rows="5"
><?php echo esc_textarea( $settings['ignored_query_strings'] ); ?></textarea>
<span id="ignored_query_strings_description" class="sui-description">
<?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' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'ignored-query-strings' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Purge Additional Pages -->
<div class="sui-box-settings-row">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Purge Additional Pages', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<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>
<textarea
placeholder="/sample-page"
id="purge_additional_pages"
name="purge_additional_pages"
class="sui-form-control"
aria-describedby="purge_additional_pages_description"
rows="5"
><?php echo esc_textarea( $settings['purge_additional_pages'] ); ?></textarea>
<span id="purge_additional_pages_description" class="sui-description">
<?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' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/advanced-options/', 'purge-additional-pages' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sui-box-footer">
<?php require 'settings-form-action.php'; ?>
</div>
</div>
<!-- TAB: File Optimization -->
<div class="sui-box" id="file-optimization" data-tab="file-optimization" style="display: none;">
<div class="sui-box-header">
<h2 class="sui-box-title"><?php esc_html_e( 'File Optimization', 'powered-cache' ); ?></h2>
</div>
<div class="sui-box-body sui-upsell-items">
<?php
/**
* Fires before file optimization section
*
* @hook powered_cache_admin_page_before_file_optimization
*
* @since 2.0
*/
do_action( 'powered_cache_admin_page_before_file_optimization' );
?>
<!-- Basic Settings -->
<div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_basic_settings_classes', 'sui-box-settings-row ' ) ); ?>">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Basic Settings', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="minify_html" class="sui-toggle">
<input
type="checkbox"
id="minify_html"
name="minify_html"
aria-labelledby="minify_html_label"
aria-controls="minify_html_dom_optimization_control"
value="1"
<?php checked( 1, $settings['minify_html'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="minify_html_label" class="sui-toggle-label"><?php esc_html_e( 'Minify HTML', 'powered-cache' ); ?></span>
<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>
</label>
</div>
<div style=" <?php echo( ! $settings['minify_html'] ? 'display:none' : '' ); ?>" tabindex="0" id="minify_html_dom_optimization_control">
<div class="sui-form-field">
<label for="minify_html_dom_optimization" class="sui-toggle">
<input type="checkbox"
value="1"
name="minify_html_dom_optimization"
id="minify_html_dom_optimization"
<?php checked( 1, $settings['minify_html_dom_optimization'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="minify_html_dom_optimization_label" class="sui-toggle-label"><?php esc_html_e( 'Optimize HTML via Dom Parser', 'powered-cache' ); ?></span>
<span id="minify_html_dom_optimization_description" class="sui-description">
<?php esc_html_e( 'Improves HTML minification efficiency.', 'powered-cache' ); ?>
</span>
</label>
<br>
</div>
</div>
<div class="sui-form-field">
<label for="combine_google_fonts" class="sui-toggle">
<input
type="checkbox"
id="combine_google_fonts"
name="combine_google_fonts"
aria-labelledby="combine_google_fonts_label"
aria-controls="swap_google_fonts_display_control"
value="1"
<?php checked( 1, $settings['combine_google_fonts'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="combine_google_fonts_label" class="sui-toggle-label"><?php esc_html_e( 'Combine Google Fonts', 'powered-cache' ); ?></span>
<span id="combine-google-fonts-description" class="sui-description">
<?php esc_html_e( 'Combines all Google Fonts URLs into a single URL and optimizes loading of that URL.', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/combine-google-fonts/' ) ); ?>" target="_blank">(?)</a>
</span>
</label>
</div>
<div style=" <?php echo( ! $settings['combine_google_fonts'] ? 'display:none' : '' ); ?>" tabindex="0" id="swap_google_fonts_display_control">
<div class="sui-form-field">
<label for="swap_google_fonts_display" class="sui-toggle">
<input type="checkbox"
value="1"
name="swap_google_fonts_display"
id="swap_google_fonts_display"
<?php checked( 1, $settings['swap_google_fonts_display'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="swap_google_fonts_display_label" class="sui-toggle-label"><?php esc_html_e( 'Swap Google Fonts Display', 'powered-cache' ); ?></span>
<span id="swap_google_fonts_display_description" class="sui-description">
<?php esc_html_e( 'Ensure text remains visible during webfont load.', 'powered-cache' ); ?>
</span>
</label>
<br>
</div>
</div>
<div class="sui-form-field">
<label for="use_bunny_fonts" class="sui-toggle">
<input type="checkbox"
value="1"
name="use_bunny_fonts"
id="use_bunny_fonts"
<?php checked( 1, $settings['use_bunny_fonts'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="use_bunny_fonts_label" class="sui-toggle-label"><?php esc_html_e( 'Use Bunny Fonts', 'powered-cache' ); ?></span>
<span id="use_bunny_fonts_description" class="sui-description">
<?php esc_html_e( 'Use Bunny Fonts as drop-in replacement for Google Fonts', 'powered-cache' ); ?>
</span>
</label>
</div>
</div>
</div>
<!-- CSS Files -->
<div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_css_classes', 'sui-box-settings-row ' ) ); ?>">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'CSS Optimization', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/css-optimization/' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="minify_css" class="sui-toggle">
<input
type="checkbox"
id="minify_css"
name="minify_css"
aria-labelledby="minify_css_label"
value="1"
<?php checked( 1, $settings['minify_css'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="minify_css_label" class="sui-toggle-label"><?php esc_html_e( 'Minify CSS', 'powered-cache' ); ?></span>
<span id="minify_css_description" class="sui-description"><?php esc_html_e( 'Minify CSS files', 'powered-cache' ); ?></span>
</label>
</div>
<div class="sui-form-field">
<label for="combine_css" class="sui-toggle">
<input
type="checkbox"
id="combine_css"
name="combine_css"
aria-labelledby="combine_css_label"
value="1"
<?php checked( 1, $settings['combine_css'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="combine_css_label" class="sui-toggle-label"><?php esc_html_e( 'Combine CSS files', 'powered-cache' ); ?></span>
<span id="combine_css_description" class="sui-description"><?php esc_html_e( 'Combine CSS files to reduce HTTP requests', 'powered-cache' ); ?></span>
</label>
</div>
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="excluded_css_files" class="sui-label"><i><?php esc_html_e( 'CSS files to exclude (one per line)', 'powered-cache' ); ?></i></label>
<textarea
placeholder="e.g /wp-content/themes/example/style/custom.css"
id="excluded_css_files"
name="excluded_css_files"
class="sui-form-control"
aria-describedby="excluded_css_files_description"
rows="5"
><?php echo esc_textarea( $settings['excluded_css_files'] ); ?></textarea>
<span id="excluded_css_files_description" class="sui-description">
<?php esc_html_e( 'Listed files will not get minified or combined', 'powered-cache' ); ?>
</span>
</div>
</div>
</div>
</div>
</div>
<!-- Critical CSS -->
<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' : '' ); ?>">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Critical CSS', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/critical-css/' ) ); ?>" target="_blank">(?)</a>
<?php if ( ! is_premium() ) : ?>
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
<?php endif; ?>
</span>
<span class="sui-description"><?php esc_html_e( 'Extract & Inline Critical-path CSS from HTML', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="critical_css" class="sui-toggle">
<input
type="checkbox"
id="critical_css"
name="critical_css"
aria-labelledby="critical_css_label"
aria-controls="critical_css_fallback_controls"
value="1"
<?php checked( 1, $settings['critical_css'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="critical_css_label" class="sui-toggle-label"><?php esc_html_e( ' Critical CSS', 'powered-cache' ); ?></span>
<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>
</label>
</div>
<div style=" <?php echo( ! $settings['critical_css'] ? 'display:none' : '' ); ?>" tabindex="0" id="critical_css_fallback_controls">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<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>
<textarea
id="critical_css_additional_files"
name="critical_css_additional_files"
class="sui-form-control"
aria-describedby="critical_css_additional_files_description"
rows="5"
><?php echo esc_textarea( $settings['critical_css_additional_files'] ); // phpcs:ignore ?></textarea>
<span id="critical_css_additional_files_description" class="sui-description">
<?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' ); ?>
</span>
</div>
</div>
</div>
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<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>
<textarea
id="critical_css_excluded_files"
name="critical_css_excluded_files"
class="sui-form-control"
aria-describedby="critical_css_excluded_files_description"
rows="5"
><?php echo esc_textarea( $settings['critical_css_excluded_files'] ); // phpcs:ignore ?></textarea>
<span id="critical_css_excluded_files_description" class="sui-description">
<?php esc_html_e( 'Ignore these files during the Critical CSS generation.', 'powered-cache' ); ?>
</span>
</div>
</div>
</div>
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="critical_css_appended_content" class="sui-label"><i><?php esc_html_e( 'Append to Critical CSS', 'powered-cache' ); ?></i></label>
<textarea
id="critical_css_appended_content"
name="critical_css_appended_content"
class="sui-form-control"
aria-describedby="critical_css_appended_content_description"
rows="5"
><?php echo wp_unslash( sanitize_css( $settings['critical_css_appended_content'] ) ); // phpcs:ignore ?></textarea>
<span id="critical_css_appended_content_description" class="sui-description">
<?php esc_html_e( 'Extend Critical CSS by appending custom CSS here.', 'powered-cache' ); ?>
</span>
</div>
</div>
</div>
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="critical_css_fallback" class="sui-label"><i><?php esc_html_e( 'Fallback Critical CSS ', 'powered-cache' ); ?></i></label>
<textarea
id="critical_css_fallback"
name="critical_css_fallback"
class="sui-form-control"
aria-describedby="critical_css_fallback_description"
rows="5"
><?php echo wp_unslash( sanitize_css( $settings['critical_css_fallback'] ) ); // phpcs:ignore ?></textarea>
<span id="critical_css_fallback_description" class="sui-description">
<?php esc_html_e( 'The fallback CSS if auto-generated CSS is incomplete.', 'powered-cache' ); ?>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Unused CSS -->
<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' : '' ); ?>">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'Unused CSS', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/remove-unused-css/' ) ); ?>" target="_blank">(?)</a>
<?php if ( ! is_premium() ) : ?>
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Premium', 'powered-cache' ); ?></span>
<?php endif; ?>
</span>
<span class="sui-description"><?php esc_html_e( 'Remove Unused CSS', 'powered-cache' ); ?></span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="remove_unused_css" class="sui-toggle">
<input
type="checkbox"
id="remove_unused_css"
name="remove_unused_css"
aria-labelledby="remove_unused_css_label"
aria-controls="remove_unused_css_safelist"
value="1"
<?php checked( 1, $settings['remove_unused_css'] ); ?>
>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="remove_unused_css_label" class="sui-toggle-label"><?php esc_html_e( 'Remove Unused CSS', 'powered-cache' ); ?></span>
<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>
</label>
</div>
<div style=" <?php echo( ! $settings['remove_unused_css'] ? 'display:none' : '' ); ?>" tabindex="0" id="remove_unused_css_safelist">
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="ucss_safelist" class="sui-label"><i><?php esc_html_e( 'Safelist', 'powered-cache' ); ?></i></label>
<textarea
id="ucss_safelist"
name="ucss_safelist"
class="sui-form-control"
aria-describedby="ucss_safelist_description"
rows="5"
><?php echo esc_textarea( $settings['ucss_safelist'] ); // phpcs:ignore ?></textarea>
<span id="ucss_safelist_description" class="sui-description">
<?php esc_html_e( 'Specify CSS selectors that should not be removed. (one per line)', 'powered-cache' ); ?>
</span>
</div>
</div>
</div>
<div class="sui-row">
<div class="sui-col-md-8">
<div class="sui-form-field">
<label for="ucss_excluded_files" class="sui-label"><i><?php esc_html_e( 'Excluded files', 'powered-cache' ); ?></i></label>
<textarea
id="ucss_excluded_files"
name="ucss_excluded_files"
class="sui-form-control"
aria-describedby="ucss_excluded_files_description"
rows="5"
><?php echo esc_textarea( $settings['ucss_excluded_files'] ); // phpcs:ignore ?></textarea>
<span id="ucss_excluded_files_description" class="sui-description">
<?php esc_html_e( 'Specify CSS files that should be ignored during the UCSS generation process. (one per line)', 'powered-cache' ); ?>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- JS Files -->
<div class="<?php echo esc_attr( apply_filters( 'powered_cache_admin_page_fo_js_classes', 'sui-box-settings-row ' ) ); ?>">
<div class="sui-box-settings-col-1">
<span class="sui-settings-label"><?php esc_html_e( 'JavaScript Optimization', 'powered-cache' ); ?>
<a href="<?php echo esc_url( get_doc_url( '/js-optimization/' ) ); ?>" target="_blank">(?)</a>
</span>
</div>
<div class="sui-box-settings-col-2">
<div class="sui-form-field">
<label for="minify_js" class="sui-toggle">
<input
type="checkbox"
id="minify_js"
name="minify_js"
aria-labelledby="minify_js_label"
aria-controls="excluded_js_files_field"
value="1"
<?php checked( 1, $settings['minify_js'] ); ?>