-
Notifications
You must be signed in to change notification settings - Fork 256
/
tab_caching.php
92 lines (67 loc) · 3.48 KB
/
tab_caching.php
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
<div id="caching_settings" style="display:none;">
<section class="wp2static-content wp2static-flex">
<div class="content" style="max-width:30%">
<h2><?php echo __( 'Crawl Caching', 'static-html-output-plugin' ); ?></h2>
</div>
<div class="content">
<p>Don't recrawl files crawled within last n period.</p>
<select name="crawl_caching_time_unit" id="crawl_caching">
<?php
// TODO: shift this into helper function for select
$increments = array( 1, 5, 10, 25, 50, 100, 500, 1000, 999999 );
foreach ( $increments as $increment ) :
if ( $increment == 999999 ) : ?>
<option value="999999"<?php echo $this->options->crawl_caching_time_unit == $increment ? ' selected' : ''; ?>>Maximum</option>
<?php else : ?>
<option value="<?php echo $increment; ?>"<?php echo $this->options->crawl_caching_time_unit == $increment ? ' selected' : ''; ?>><?php echo $increment; ?></option>
<?php endif;
endforeach; ?>
</select>
<select name="crawl_caching_time_period" id="crawl_caching_time_period">
<?php
// TODO: shift this into helper function for select
$increments = [
'Minutes',
'Hours',
'Days',
];
foreach ( $increments as $increment ) :
if ( $increment == 999999 ) : ?>
<option value="999999"<?php echo $this->options->crawl_caching_time_period == $increment ? ' selected' : ''; ?>>Maximum</option>
<?php else : ?>
<option value="<?php echo $increment; ?>"<?php echo $this->options->crawl_caching_time_period == $increment ? ' selected' : ''; ?>><?php echo $increment; ?></option>
<?php endif;
endforeach; ?>
</select>
<?php $tpl->displayCheckbox( $this, 'dontUseCrawlCaching', 'Disregard cache and crawl everything' ); ?>
<button id="deleteCrawlCache" class="wp2static-btn btn-sm mg-top10">Delete Crawl Cache</button>
</div>
</section>
<section class="wp2static-content wp2static-flex">
<div class="content" style="max-width:30%">
<h2><?php echo __( 'Delete Deploy Cache', 'static-html-output-plugin' ); ?></h2>
</div>
<div class="content">
<button id="delete_deploy_cache_button" type="button" class="btn-primary button">Delete deploy cache</button>
<p>When deploying, WP2Static will check each file to see if it's changed since the last deployment. It will skip unchanged files based on this information. If you want to force an uncached deployment, click this button and any caches will be emptied, requiring a full deploy on the next run.</p>
</div>
</section>
<section class="wp2static-content wp2static-flex">
<div class="content" style="max-width:30%">
<h2><?php echo __( 'Generated Static Files', 'static-html-output-plugin' ); ?></h2>
</div>
<div class="content">
<button id="check_generated_static_content" type="button" class="btn-primary button">Check generated static files</button>
<p>Check the size on disk and number of files within your generated static site.</p>
<ul>
<li>Path:</li>
<li>Size on disk:</li>
<li>Number of files:</li>
</ul>
</div>
<div class="content">
<button id="delete_generated_static_content" type="button" class="btn-primary button">Delete generated static files</button>
<p>This will delete the <code>wp2statric-exported-site</code> directory within your uploads directory.</p>
</div>
</section>
</div> <!-- end advanced settings -->