-
Notifications
You must be signed in to change notification settings - Fork 256
/
tab_advanced.php
executable file
·64 lines (47 loc) · 2.81 KB
/
tab_advanced.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
<div id="advanced_settings" style="display:none;">
<section class="wp2static-content wp2static-flex">
<div class="content" style="max-width:30%">
<h2><?php echo __( 'Deployment Batch Size', 'static-html-output-plugin' ); ?></h2>
</div>
<div class="content">
<select name="deployBatchSize" id="deployBatchSize">
<?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->deployBatchSize == $increment ? ' selected' : ''; ?>>Maximum</option>
<?php else : ?>
<option value="<?php echo $increment; ?>"<?php echo $this->options->deployBatchSize == $increment ? ' selected' : ''; ?>><?php echo $increment; ?></option>
<?php endif;
endforeach; ?>
</select>
<p>This is set to 1, by default, in order to avoid execution limit timeouts on restricted environments, such as shared hosting servers. Each increment is the amount of files the server will try to deploy on each request. Incrementing this will speed up your exports, by processing more are a time. If your export is failing, due to execution limits or API rate limits being reached, try setting this to a lower number.</p>
</div>
</section>
<section class="wp2static-content wp2static-flex">
<div class="content" style="max-width:30%">
<h2><?php echo __( 'Show deploy widget on WP dashboard', 'static-html-output-plugin' ); ?></h2>
</div>
<div class="content">
<p>Show a widget on your WordPress dashboard for quickly triggering a manual deploy and showing recent deploy information.</p>
<?php $tpl->displayCheckbox( $this, 'displayDashboardWidget', 'Enable WP2Static dashboard widget' . $to ); ?>
</div>
</section>
<section class="wp2static-content wp2static-flex">
<div class="content" style="max-width:30%">
<h2><?php echo __( 'API Request Delay', 'static-html-output-plugin' ); ?></h2>
</div>
<div class="content">
<select name="delayBetweenAPICalls" id="delayBetweenAPICalls">
<?php
// TODO: shift this into helper function for select
$increments = array( 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 2, 3, 4, 10 );
foreach ( $increments as $increment ) : ?>
<option value="<?php echo $increment; ?>"<?php echo $this->options->delayBetweenAPICalls == $increment ? ' selected' : ''; ?>><?php echo $increment; ?></option>
<?php endforeach; ?>
</select>
<p>This is set to 0, by default, but if your deploy is hitting the remote API too rapidly for their rate limit, you can increase this to add a delay between each API request.</p>
</div>
</section>
</div> <!-- end advanced settings -->