Files
2026-11-02 11:04:39 +00:00

201 lines
10 KiB
PHTML

<?php
/**
* @package Simply_Static
*/
?>
<div class='wrap'>
<h2><?php _e( 'Simply Static S3', $this->slug ); ?></h2>
<form id='options' method='post' action=''>
<?php wp_nonce_field( $this->slug ) ?>
<h2 id='sistTabs' class='nav-tab-wrapper'>
<a class='nav-tab' id='general-tab' href='#tab-general'><?php _e( 'General', $this->slug ); ?></a>
<a class='nav-tab' id='advanced-tab' href='#tab-advanced'><?php _e( 'Advanced', $this->slug ); ?></a>
</h2>
<div id='general' class='tab-pane'>
<table class='form-table'>
<tbody>
<tr>
<th>
<label for='originHost'><?php _e( "Origin URL", $this->slug );?></label>
</th>
<td>
<select id='originScheme' name='origin_scheme' disabled>
<option value='<?php echo $this->origin_scheme; ?>'><?php echo $this->origin_scheme; ?>://</option>
</select>
<input aria-describedby='originHostHelpBlock' type='text' id='originHost' name='origin_host' value='<?php echo esc_attr( $this->origin_host ) ?>' size='50' disabled />
<p id='originHostHelpBlock' class='help-block'><?php echo sprintf( __( "This is the URL of your WordPress installation. You can edit the URL on <a href='%s'>the General Settings page</a>.", $this->slug ), admin_url( '/options-general.php' ) ); ?></p>
</td>
</tr>
<tr>
<th>
<label for='destinationHost'><?php _e( "Destination URL", $this->slug );?></label>
</th>
<td>
<select id='destinationScheme' name='destination_scheme'>
<option value='http' <?php sist_selected_if( $this->destination_scheme == 'http' ) ?>>http://</option>
<option value='https' <?php sist_selected_if( $this->destination_scheme == 'https' ) ?>>https://</option>
</select>
<input aria-describedby='destinationHostHelpBlock' type='text' id='destinationHost' name='destination_host' value='<?php echo esc_attr( $this->destination_host ) ?>' size='50' />
<p id='destinationHostHelpBlock' class='help-block'><?php _e( "This is the URL where your static site will live. When generating your static site, all links to the Origin URL will be replaced with the Destination URL.", $this->slug ); ?></p>
</td>
</tr>
<tr>
<th>
<label for='deliveryMethod'><?php _e( "Delivery Method", $this->slug ); ?></label></th>
<td>
<select name='delivery_method' id='deliveryMethod'>
<option value='s3' <?php sist_selected_if( $this->delivery_method == 's3' ) ?>><?php _e( "Amazon S3", $this->slug ); ?></option>
<option value='zip' <?php sist_selected_if( $this->delivery_method == 'zip' ) ?>><?php _e( "ZIP Archive", $this->slug ); ?></option>
<option value='local' <?php sist_selected_if( $this->delivery_method == 'local' ) ?>><?php _e( "Local Directory", $this->slug ); ?></option>
</select>
</td>
</tr>
<tr class='delivery-method zip'>
<th></th>
<td>
<p><?php _e( "Saving your static files to a ZIP archive is Simply Static's default delivery method. After generating your static files you will be prompted to download the ZIP archive.", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method local'>
<th></th>
<td>
<p><?php _e( "Saving your static files to a local directory is useful if you want to serve your static files from the same server as your WordPress installation. WordPress can live on a subdomain (e.g. wordpress.example.com) while your static files are served from your primary domain (e.g. www.example.com).", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method local'>
<th>
<label for='local_dir'><?php _e( "Local Directory", $this->slug );?></label>
</th>
<td>
<?php $example_local_dir = plugin_dir_path( dirname( __FILE__ ) ); ?>
<input aria-describedby='localDirHelpBlock' type='text' id='localDir' name='local_dir' value='<?php echo esc_attr( $this->local_dir ) ?>' placeholder='<?php echo $example_local_dir; ?>' class='widefat' />
<p id='localDirHelpBlock' class='help-block'><?php _e( "This is the directory where your static files will be saved. The directory must exist and be writeable by the webserver.", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method s3'>
<th></th>
<td>
<p><?php _e( "A static copy of your site will be published to Amazon S3 in the bucket you specify.", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method s3'>
<th>
<label for='aws_s3_bucket'><?php _e( "AWS S3 Bucket", $this->slug );?></label>
</th>
<td>
<input aria-describedby='awsS3BucketHelpBlock' type='text' id='awsS3Bucket' name='aws_s3_bucket' value='<?php echo esc_attr( $this->aws_s3_bucket ) ?>' placeholder='Existing bucket name' class='widefat' />
<p id='awsS3BucketHelpBlock' class='help-block'><?php _e( "Your static site will be published in this S3 bucket. It must already exist. Use AWS Console to create a bucket.", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method s3'>
<th>
<label for='aws_access_key_id'><?php _e( "AWS Access Key ID", $this->slug );?></label>
</th>
<td>
<input aria-describedby='awsAccessKeyIDHelpBlock' type='text' id='awsS3AccessKeyID' name='aws_access_key_id' value='<?php echo esc_attr( $this->aws_access_key_id ) ?>' placeholder='Access Key ID with write access to S3' class='widefat' />
<p id='awsS3AccessKeyIDHelpBlock' class='help-block'><?php _e( "If you don't have an access key, use AWS Console IAM to generate a new user and access key. It must have rights to publish to S3.", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method s3'>
<th>
<label for='aws_secret_access_key'><?php _e( "AWS Secret Access Key", $this->slug );?></label>
</th>
<td>
<input aria-describedby='awsSecretAccessKeyHelpBlock' type='text' id='awsSecretS3AccessKey' name='aws_secret_access_key' value='<?php echo esc_attr( $this->aws_secret_access_key ) ?>' placeholder='Secret Access Key with write access to S3' class='widefat' />
<p id='awsS3SecretAccessKeyHelpBlock' class='help-block'><?php _e( "If you don't have an access key, use AWS Console IAM to generate a new user and access key. It must have rights to publish to S3.", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method s3'>
<th>
<label for='aws_s3_region'><?php _e( "S3 Region", $this->slug );?></label>
</th>
<td>
<input aria-describedby='awsS3RegionHelpBlock' type='text' id='awsS3Region' name='aws_s3_region' value='<?php echo esc_attr( $this->aws_s3_region ) ?>' placeholder='us-east-1' class='widefat' />
<p id='awsS3RegionHelpBlock' class='help-block'><?php _e( "The region of your S3 bucket (e.g. us-east-1, eu-west-1, us-west-1).", $this->slug ); ?></p>
</td>
</tr>
<tr class='delivery-method s3'>
<th>
<label for='aws_s3_endpoint'><?php _e( "S3 Endpoint URL", $this->slug );?></label>
</th>
<td>
<input aria-describedby='awsS3EndpointHelpBlock' type='text' id='awsS3Endpoint' name='aws_s3_endpoint' value='<?php echo esc_attr( $this->aws_s3_endpoint ) ?>' placeholder='s3.amazonaws.com' class='widefat' />
<p id='awsS3EndpointHelpBlock' class='help-block'><?php _e( "The endpoint URL for your S3 provider (e.g. s3.amazonaws.com, s3.wasabisys.com, s3.us-west-002.backblazeb2.com).", $this->slug ); ?></p>
</td>
</tr>
<tr>
<th></th>
<td>
<p class='submit'>
<input class='button button-primary' type='submit' name='save' value='<?php _e( "Save Changes", $this->slug );?>' />
</p>
</td>
</tr>
</tbody>
</table>
</div>
<div id='advanced' class='tab-pane'>
<table class='form-table'>
<tbody>
<tr>
<th>
<label for='tempFilesDir'><?php _e( "Temporary Files Directory", $this->slug );?></label>
</th>
<td>
<?php $example_temp_files_dir = trailingslashit( plugin_dir_path( dirname( __FILE__ ) ) . 'static-files' );?>
<input aria-describedby='tempFilesDirHelpBlock' type='text' id='tempFilesDir' name='temp_files_dir' value='<?php echo esc_attr( $this->temp_files_dir ) ?>' placeholder='<?php echo $example_temp_files_dir; ?>'class='widefat' />
<p id='tempFilesDirHelpBlock' class='help-block'><?php _e( "Your static files (and ZIP archives, if generated) are temporarily saved to this directory. This directory must exist and be writeable.", $this->slug ); ?></p>
</td>
</tr>
<tr>
<th></th>
<td>
<label>
<input aria-describedby='deleteTempFilesHelpBlock' name='delete_temp_files' id='deleteTempFiles' value='1' type='checkbox' <?php if ( $this->delete_temp_files == '1' ) { echo 'checked'; } ?> />
<?php _e( "Delete temporary files", $this->slug ); ?>
</label>
<p id='deleteTempFilesHelpBlock' class='help-block'>
<?php _e( "Static files are temporarily saved to the directory above before being copied to their destination. These files can be deleted after the copy process, or you can keep them as a backup.", $this->slug ); ?>
</p>
</td>
</tr>
<tr>
<th>
<label for='additionalUrls'><?php _e( "Additional URLs", $this->slug );?></label>
</th>
<td>
<textarea aria-describedby='additionalUrlsHelpBlock' class='widefat' name='additional_urls' id='additionalUrls' rows='5' cols='10'><?php echo esc_html( $this->additional_urls ) ?></textarea>
<p id='additionalUrlsHelpBlock' class='help-block'>
<?php echo sprintf( __( "Simply Static will create a static copy of any page it can find a link to, starting at %s. If you want to create static copies of pages or files that <em>aren't</em> linked to, add the URLs here (one per line). Examples: <code>%s</code> or <code>%s</code>", $this->slug),
$this->origin_scheme . '://' . $this->origin_host,
$this->origin_scheme . '://' . $this->origin_host . '/hidden-page',
$this->origin_scheme . '://' . $this->origin_host . '/images/secret.jpg' ); ?>
</p>
</td>
</tr>
<tr>
<th></th>
<td>
<p class='submit'>
<input class='button button-primary' type='submit' name='save' value='<?php _e( "Save Changes", $this->slug );?>' />
</p>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>