<div class="advanced_settings" style="display:none;">

<table class="form-table">
  <tbody>
    <tr>
      <th scope="row">
        <label for="crawl_increment"><?php echo __('Crawl Increment', 'static-html-output-plugin');?></label>
      </th>
      <td>
        <select name="crawl_increment" id="crawl_increment">
<?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_increment == $increment ? ' selected' : ''; ?>>Maximum</option>
<?php else: ?>
          <option value="<?php echo $increment; ?>"<?php echo $this->options->crawl_increment == $increment ? ' selected' : ''; ?>><?php echo $increment; ?></option>

<?php endif; 
       endforeach; ?>
        </select><br>

        <p>This is set to 1, by default, in order to allow exporting on low-resource environments, such as shared hosting servers. Each increment is the amount of files the server will try to process on each request that the browser sends it. Incrementing this will speed up your exports, by processing more are a time. If your export is failing, due to resource (memory, CPU) limits being reached, try setting this to a lower number.</p>

      </td>
    </tr>
      <tr>
        <th scope="row">
          <label for="deployBatchSize"><?php echo __('Deployment Batch Size', 'static-html-output-plugin');?></label>
        </th>
        <td>
          <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><br>

          <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>

        </td>
      </tr>
      <tr>
        <th scope="row">
          <label for="delayBetweenAPICalls"><?php echo __('API Request Delay', 'static-html-output-plugin');?></label>
        </th>
        <td>
          <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><br>

          <p>This is set to 0, by default, but if your deploy is hitting GitLab's API too rapidly, you can increase this to add a delay between each API request.</p>

        </td>
      </tr>
    <tr>
      <th scope="row">
        <label for="wp_cli"><?php echo __('WP-CLI', 'static-html-output-plugin');?></label>
      </th>
      <td>
          <p>Replacing the former, limited support for scheduled deploys via WP-Cron, WP2Static now integrates with the great <a href="https://wp-cli.org/" target="_blank">WP-CLI</a> for programmatic access to deploying your WordPress site statically. Control settings and trigger deployments to better suit your development workflow.</p>

    <p>More information available on the GitHub project page: <a href="https://github.com/leonstafford/wp2static" target="_blank">https://github.com/leonstafford/wp2static</a></p>
<br>


      </td>
    </tr>
    <tr>
      <th scope="row">
          <label><?php echo __('Redirect this domain to your static site?', 'static-html-output-plugin');?></label>
      </th>
      <td>
          <p>If you're happy with how your site is looking after exporting to a subdirectory, you can choose to start serving this content to your visitors, instead of your current WordPress site. To do this, you will need to adjust your <code>.htaccess</code> file. This <a href="" target="_blank">community guide</a> may be able to help you.
      </td>
    </tr>
    <tr>
      <th scope="row">
        <label for="completionEmail"><?php echo __('Email upon completion', 'static-html-output-plugin');?></label>
      </th>
      <td>
        <?php
         $current_user = wp_get_current_user();
         $to = $current_user->user_email;
         $tpl->displayCheckbox($this, 'completionEmail', 'Will send to: ' . $to); ?>

        <p>
            Be alerted when your deployment process is complete.
        </p>

      </td>
    </tr>
      <tr>
        <th scope="row">
          <label for="delete_deploy_cache_button"><?php echo __('Delete deploy cache', 'static-html-output-plugin');?></label>
        </th>
        <td>
          <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>
        </td>
      </tr>
    <tr>
      <th scope="row">
        <label for="debug_mode"><?php echo __('Enable Debug Mode', 'static-html-output-plugin');?></label>
      </th>
      <td>
        <?php $tpl->displayCheckbox($this, 'debug_mode', ''); ?>

        <p>
            Will slow down operations, but give verbose output to the Export Log in the Logs tab. Use this when you have a failed export to help pinpoint the cause.
        </p>

      </td>
    </tr>
  </tbody>
</table>




</div> <!-- end advanced settings -->

