Initial commit
This commit is contained in:
@ -0,0 +1,58 @@
|
||||
<div class="bitbucket_settings_block" style="display:none;">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl-bitbucket"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-bitbucket', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p><i><?php echo __("Set this to the URL you intend to host your static exported site on, ie http://mystaticsite.com. Do not set this to the same URL as the WordPress site you're currently using (the address in your browser above). This plugin will rewrite all URLs in the exported static html from your current WordPress URL to what you set here. Supports http, https and protocol relative URLs.", 'static-html-output-plugin');?></i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bbToken"><?php echo __('Personl Access Token', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bbToken', 'Bitbucket Personal Access Token', '<a href="https://bitbucket.com/settings/tokens/new" target="_blank">How do I get this?</a>', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bbRepo"><?php echo __('Account & Repository Name', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bbRepo', 'Account / Repository Name', 'ie, leonstafford/wordpress-static-html-plugin'); ?><br>
|
||||
|
||||
<p><i>Repository cannot be empty, just create any file via the Bitbucket UI if needed</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bbBranch"><?php echo __('Branch', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bbBranch', 'Branch', 'usually \'master\' or \'bb-pages\''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bbPath"><?php echo __('Subdirectory', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bbPath', 'Path within repository', 'Usually the repository root (leave this blank) or the \'doc\' folder'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bb_test"><?php echo __('Test Bitbucket Settings', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="bitbucket-test-button" type="button" class="btn-primary button">Test Bitbucket Settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,64 @@
|
||||
<div class="bunnycdn_settings_block" style="display:none;">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl-bunnycdn"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-bunnycdn', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p><i><?php echo __("Set this to the URL you intend to host your static exported site on, ie http://mystaticsite.com. Do not set this to the same URL as the WordPress site you're currently using (the address in your browser above). This plugin will rewrite all URLs in the exported static html from your current WordPress URL to what you set here. Supports http, https and protocol relative URLs.", 'static-html-output-plugin');?></i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bunnycdnStorageZoneName"><?php echo __('Storage Zone', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bunnycdnStorageZoneName', 'Storage Zone Name', 'ie, mybunnystoragezone. This is where the files will be uploaded to. '); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bunnycdnStorageZoneAccessKey"><?php echo __('Storage Zone Access Key', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bunnycdnStorageZoneAccessKey', 'Storage Zone Access Key', 'Find in your Storage Zone settings', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bunnycdnPullZoneID"><?php echo __('Pull Zone ID', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bunnycdnPullZoneID', 'Pull Zone ID', 'Numeric. ie, 1234. This will do a cache purge once all files are transferred', 'number'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bunnycdnPullZoneAccessKey"><?php echo __('Pull Zone Access Key', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bunnycdnPullZoneAccessKey', 'Pull Zone Access Key', 'Find in your Account settings', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bunnycdnRemotePath"><?php echo __('Subdirectory', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'bunnycdnRemotePath', 'BunnyCDN Remote Path', 'will attempt to create folder recursively if non-existent'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="bunny_test"><?php echo __('Test BunnyCDN Settings', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="bunny-test-button" type="button" class="btn-primary button">Test BunnyCDN Settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,44 @@
|
||||
|
||||
<div class="folder_settings_block">
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl-folder"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-folder', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p><i>Set this to the URL your visitors will use to access your site.</i></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="targetFolder"><?php echo __('Target Directory', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<input id="targetFolder" name="targetFolder" class="regular-text" style="width:100%;"
|
||||
value="<?php echo $this->options->targetFolder ? $this->options->targetFolder : $this->wp_site->site_path . 'mystaticsite'; ?>" /><br>
|
||||
|
||||
<p>By exporting to a directory on your current server, you can check how it will look when published and make any adjustments needed. If you put this in a publicly accessible path and the links have been rewritten to support it, you may use this method to easily preview your static site without needing to leave your browser.</p>
|
||||
|
||||
<p>As a safeguard, this plugin will only allow you to export to a new directory, an empty directory, or one that contains a file named <code>.wp2static_safety</code> inside. You can write to any existing, populated directories, by placing a file named as such within.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display:none;">
|
||||
<th scope="row">
|
||||
<label for="folder_test"><?php echo __('Test Directory', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="folder-test-button" type="button" class="btn-primary button">Test Folder is Writable</button>
|
||||
<span id="folder_test_results"></span>
|
||||
|
||||
<p>This will check the folder exists, else try to create it, along with a test file and directory inside it. It will also create the <code>.wp2static_safety</code> file within.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
@ -0,0 +1,82 @@
|
||||
<div class="ftp_settings_block" style="display:none;">
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl"><?php echo __('Base URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-ftp', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p> <i><?php echo __("Set this to the URL you intend to host your static exported site on, ie http://mystaticsite.com. Do not set this to the same URL as the WordPress site you're currently using (the address in your browser above). This plugin will rewrite all URLs in the exported static html from your current WordPress URL to what you set here. Supports http, https and protocol relative URLs.", 'static-html-output-plugin');?></i> </p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ftpServer"><?php echo __('FTP Server', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ftpServer', '198.176.1.23', ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ftpPort"><?php echo __('FTP Port', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ftpPort', '21', ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ftpUsername"><?php echo __('FTP Username', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ftpUsername', 'FTP Username', ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ftpPassword"><?php echo __('FTP Password', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ftpPassword', 'FTP Password', '', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ftpRemotePath"><?php echo __('FTP Remote Path', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ftpRemotePath', 'FTP Remote Path', 'will attempt to create folder recursively if non-existent'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ftpTLS"><?php echo __('Use FTPS (TLS)', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayCheckbox($this, 'ftpTLS', 'Use FTP with TLS'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="useActiveFTP"><?php echo __('Use active FTP', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayCheckbox($this, 'useActiveFTP', 'Use active FTP (defaults to passive mode) <a href="https://stackoverflow.com/q/1699145/1668057" target="_blank">What\'s the difference?</a>'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ftp_test"><?php echo __('Test FTP Credentials', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="ftp-test-button" type="button" class="btn-primary button">Test FTP Settings</button>
|
||||
<div class="spinner is-active" style="float:none;width:auto;height:auto;padding:10px 0 10px 50px;;"> </div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,66 @@
|
||||
<div class="github_settings_block" style="display:none;">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl-github"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-github', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p><i><?php echo __("Set this to the URL you intend to host your static exported site on, ie http://mystaticsite.com. Do not set this to the same URL as the WordPress site you're currently using (the address in your browser above). This plugin will rewrite all URLs in the exported static html from your current WordPress URL to what you set here. Supports http, https and protocol relative URLs.", 'static-html-output-plugin');?></i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ghToken"><?php echo __('Personl Access Token', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ghToken', 'GitHub Personal Access Token', '<a href="https://github.com/settings/tokens/new" target="_blank">How do I get this?</a>', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ghRepo"><?php echo __('Account & Repository Name', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ghRepo', 'Account / Repository Name', 'ie, leonstafford/wp2static'); ?><br>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ghBranch"><?php echo __('Branch', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ghBranch', 'Branch', 'usually \'master\' or \'gh-pages\''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ghPath"><?php echo __('Subdirectory', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ghPath', 'Path within repository', 'Usually the repository root (leave this blank) or the \'doc\' folder'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="ghCommitMessage"><?php echo __('Commit message', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'ghCommitMessage', 'WP2Static %ACTION% %FILENAME%', 'Anything you like, with special vars %ACTION% and %FILENAME% available'); ?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="gh_test"><?php echo __('Test GitHub Settings', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="github-test-button" type="button" class="btn-primary button">Test GitHub Settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,56 @@
|
||||
<div class="gitlab_settings_block" style="display:none;">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl-gitlab"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-gitlab', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p><i><?php echo __("Set this to the URL you intend to host your static exported site on, ie http://mystaticsite.com. Do not set this to the same URL as the WordPress site you're currently using (the address in your browser above). This plugin will rewrite all URLs in the exported static html from your current WordPress URL to what you set here. Supports http, https and protocol relative URLs.", 'static-html-output-plugin');?></i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="glToken"><?php echo __('Personl Access Token', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'glToken', 'GitLab Personal Access Token', '<a href="https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html" target="_blank">Get one here (with API access)</a>', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="glProject"><?php echo __('Project ID', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'glProject', 'Project ID', 'find this in your GitLab > Project > Details page'); ?><br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="glBranch"><?php echo __('Branch', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'glBranch', 'Branch', ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="glPath"><?php echo __('Subdirectory', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'glPath', 'Path within repository', 'Usually the repository root (leave this blank) or the \'doc\' folder'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="gl_test"><?php echo __('Test GitLab Settings', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="gitlab-test-button" type="button" class="btn-primary button">Test GitLab Settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WP Static HTML Output
|
||||
*
|
||||
* Copyright (c) 2011 Leon Stafford
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="updated fade">
|
||||
<p><strong><?php echo $this->message; ?></strong></p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if (is_array($this->exportLog) && count($this->exportLog)): ?>
|
||||
<h3>Export Log</h3>
|
||||
<pre class="wpsho-export-log"><?php echo implode("\n", array_keys($this->exportLog)) ?></pre>
|
||||
<?php endif ?>
|
@ -0,0 +1,59 @@
|
||||
<div class="netlify_settings_block" style="display:none;">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl-netlify"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-netlify', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p><i><?php echo __("Set this to the URL you intend to host your static exported site on, ie http://mystaticsite.com. Do not set this to the same URL as the WordPress site you're currently using (the address in your browser above). This plugin will rewrite all URLs in the exported static html from your current WordPress URL to what you set here. Supports http, https and protocol relative URLs.", 'static-html-output-plugin');?></i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="netlifyPersonalAccessToken"><?php echo __('Personal Access Token', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'netlifyPersonalAccessToken', 'Netlify Personal Access Token', '<a href="https://app.netlify.com/account/applications/personal" target="_blank">How do I get this?</a>', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="netlifySiteID"><?php echo __('Site ID', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'netlifySiteID', 'Netlify Site ID', 'supports: mystaticsite, mystaticsite.netlify.com, mydomain.com, 3970e0fe-8564-4903-9a55-c5f8de49fb8b'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="netlifyRedirects"><?php echo __('Redirects File', 'static-html-output-plugin');?></label>
|
||||
<p><a href="https://www.netlify.com/docs/redirects/" target="_blank">more info</a></p>
|
||||
</th>
|
||||
<td>
|
||||
<textarea class="widefat" name="netlifyRedirects" id="netlifyRedirects" rows="5" cols="10"><?php echo $this->options->netlifyRedirects ? $this->options->netlifyRedirects : '' ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="netlifyHeaders"><?php echo __('Headers File', 'static-html-output-plugin');?></label>
|
||||
<p><a href="https://www.netlify.com/docs/headers-and-basic-auth/" target="_blank">more info</a></p>
|
||||
</th>
|
||||
<td>
|
||||
<textarea class="widefat" name="netlifyHeaders" id="netlifyHeaders" rows="5" cols="10"><?php echo $this->options->netlifyHeaders ? $this->options->netlifyHeaders : '' ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="netlify_test"><?php echo __('Test Netlify Settings', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="netlify-test-button" type="button" class="btn-primary button">Test Netlify Settings</button>
|
||||
<span id="netlify_test_results"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* @package WP2Static
|
||||
*
|
||||
* Copyright (c) 2011 Leon Stafford
|
||||
*/
|
||||
|
||||
$ajax_nonce = wp_create_nonce( 'wpstatichtmloutput' );
|
||||
|
||||
require_once(__DIR__ . '/../plugin/WP2Static/TemplateHelper.php');
|
||||
|
||||
$tpl = new TemplateHelper();
|
||||
|
||||
?>
|
||||
|
||||
<div class="wrap wp2static">
|
||||
<?php if ( PHP_VERSION < 5.4 ) : ?>
|
||||
|
||||
<div class="notice notice-error inline">
|
||||
<h2 class="title">Outdated PHP version detected</h2>
|
||||
<p>The current officially supported PHP versions can be found on <a href="http://php.net/supported-versions.php" target="_blank">PHP.net</a></p>
|
||||
|
||||
<p>Whilst the plugin tries to work on the most common PHP environments, it currently requires PHP 5.4 or higher.</p>
|
||||
|
||||
<p>As official security support drops for PHP 5.6 at the end of 2018, it is strongly recommended to upgraded your WordPress hosting environment to PHP 7, ideally, PHP 7.1 or 7.2, as 7.0 will also stop being supported in December, 2018.<br><br>For help on upgrading your environment, please join our support community at <a href="https://wp2static.com/community/" target="_blank">https://wp2static.com/community/</a></p>
|
||||
|
||||
<p>Your current PHP version is: <?php echo PHP_VERSION; ?></p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if ( ! $this->wp_site->uploads_writable ) : ?>
|
||||
|
||||
<div class="notice notice-error inline is-dismissible">
|
||||
<h2 class="title">Your uploads directory is not writable</h2>
|
||||
<p>Please ensure that <code><?php echo $this->wp_site->wp_uploads_path; ?></code>
|
||||
is writable by your webserver.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->wp_site->curl_enabled ) : ?>
|
||||
|
||||
<div class="notice notice-error inline is-dismissible">
|
||||
<h2 class="title">You need the cURL extension enabled on your web server</h2>
|
||||
<p> This is a library that allows the plugin to better export your static site out to services like GitHub, S3, Dropbox, BunnyCDN, etc. It's usually an easy fix to get this working. You can try Googling "How to enable cURL extension for PHP", along with the name of the environment you are using to run your WordPress site. This may be something like DigitalOcean, GoDaddy or LAMP, MAMP, WAMP for your webserver on your local computer. If you're still having trouble, the developer of this plugin is easger to help you get up and running. Please ask for help on our <a href="https://forum.wp2static.com">forum</a>.</p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ( ! $this->wp_site->permalinks_set ) : ?>
|
||||
|
||||
<div class="notice notice-error inline is-dismissible">
|
||||
<h2 class="title">You need to set your WordPress Pemalinks</h2>
|
||||
|
||||
<p>Due to the nature of how static sites work, you'll need to have some kind of permalinks structure defined in your <a href="<?php echo admin_url( 'options-permalink.php' ); ?>">Permalink Settings</a> within WordPress. To learn more on how to do this, please see WordPress's official guide to the <a href="https://codex.wordpress.org/Settings_Permalinks_Screen">Settings Permalinks Screen</a>.</p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<h2 class="nav-tab-wrapper">
|
||||
<a href="#" class="nav-tab nav-tab-active">Deploy static website</a>
|
||||
<a href="#" class="nav-tab">Crawling</a>
|
||||
<a href="#" class="nav-tab">Processing</a>
|
||||
<a href="#" class="nav-tab">Advanced options</a>
|
||||
<a href="#" class="nav-tab">Help</a>
|
||||
<a href="#" class="nav-tab">Logs</a>
|
||||
<a href="#" class="nav-tab"><span class="dashicons dashicons-heart" style="color:red;margin-top:3px;"></span></a>
|
||||
</h2>
|
||||
|
||||
|
||||
<!-- main form containing options that get sent -->
|
||||
<form id="general-options" class="options-form" method="post" action="">
|
||||
|
||||
<!-- placeholder input fields to allow select menu deployment options to use existing behaviour -->
|
||||
<span class="hiddenExportOptions" style="display:none;">
|
||||
<?php $tpl->displayCheckbox($this, 'createZip', 'Create a ZIP file of your statically exported site, ready for you to manually deploy. Download link will appear in the Export Log below'); ?>
|
||||
</span>
|
||||
|
||||
<?php
|
||||
|
||||
function generateDeploymentMethodOptions() {
|
||||
$options = array(
|
||||
"folder" => array('Subdirectory on current server', 'free'),
|
||||
"blank1" => array("--- Manual Deployment ---", 'free'),
|
||||
"zip" => array('ZIP archive (.zip)'),
|
||||
"blank2" => array("--- Automated Deployment ---"),
|
||||
"s3" => array("Amazon S3"),
|
||||
"bitbucket" => array("Bitbucket"),
|
||||
"bunnycdn" => array("BunnyCDN"),
|
||||
"github" => array("GitHub Pages"),
|
||||
"gitlab" => array("GitLab"),
|
||||
"netlify" => array("Netlify"),
|
||||
"blank3" => array("--- Other Automated Deployments ---"),
|
||||
"ftp" => array("FTP"),
|
||||
);
|
||||
|
||||
foreach ($options as $key => $value) {
|
||||
echo "<option value='$key'>$value[0]</option>";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php require_once(__DIR__ . '/tab_export.phtml'); ?>
|
||||
<?php require_once(__DIR__ . '/tab_crawling.phtml'); ?>
|
||||
<?php require_once(__DIR__ . '/tab_processing.phtml'); ?>
|
||||
<?php require_once(__DIR__ . '/tab_advanced.phtml'); ?>
|
||||
<?php require_once(__DIR__ . '/tab_help.phtml'); ?>
|
||||
<?php require_once(__DIR__ . '/tab_logs.phtml'); ?>
|
||||
<?php require_once(__DIR__ . '/tab_love.phtml'); ?>
|
||||
|
||||
<br>
|
||||
|
||||
<span class="submit" style="display:none;">
|
||||
<?php wp_nonce_field($this->onceAction) ?>
|
||||
<input id="formActionHiddenField" class="hiddenActionField" type="hidden" name="action" value="wp_static_html_output_ajax" />
|
||||
<input id="basedir" type="hidden" name="basedir" value="" />
|
||||
<input id="wp_site_url" type="hidden" name="wp_site_url" value="" />
|
||||
<input id="wp_uploads_path" type="hidden" name="wp_uploads_path" value="" />
|
||||
<input id="wp_uploads_url" type="hidden" name="wp_uploads_url" value="" />
|
||||
<input id="subdirectory" type="hidden" name="subdirectory" value="<?php echo $this->wp_site->subdirectory; ?>" />
|
||||
<input id="wp_site_path" type="hidden" name="wp_site_path" value="" />
|
||||
<input id="wp_inc" type="hidden" name="wp_inc" value="" />
|
||||
<input id="wp_active_theme" type="hidden" name="wp_active_theme" value="" />
|
||||
<input id="wp_uploads" type="hidden" name="wp_uploads" value="" />
|
||||
<input id="hiddenNonceField" type="hidden" name="nonce" value="<?php echo $ajax_nonce; ?>" />
|
||||
<input id="hiddenAJAXAction" type="hidden" name="ajax_action" value="" />
|
||||
<input name="staticExportSettings" class="hiddenSettingsField" type="hidden" name="action" value="" />
|
||||
</span>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="wp2static-footer">
|
||||
|
||||
<div class="inside">
|
||||
|
||||
<div class="submit">
|
||||
<?php wp_nonce_field($this->onceAction) ?>
|
||||
<button id="startExportButton" class="button-primary button-hero" disabled>Start static site export</button>
|
||||
<button class="saveSettingsButton button-secondary" disabled>Save current options</button>
|
||||
<button class="button resetDefaultSettingsButton" disabled>Reset to default settings</button>
|
||||
<button style="display:none;" class="button cancelExportButton">Cancel export</button>
|
||||
|
||||
<a href="" id="downloadZIP"><button class="button button-secondary button-call-to-action" target="_blank">Download ZIP</button></a>
|
||||
|
||||
<a href="#" class="button button-secondary button-call-to-action" target="_blank" id="goToMyStaticSite" style="display:none;">Go to my deployed site</a>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- end inside -->
|
||||
|
||||
<div id="pbar-container">
|
||||
<div id="pbar-fill">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="progress-container">
|
||||
<div id="progress">
|
||||
<div class="pulsate-css"></div>
|
||||
<div id="current_action">Starting export</div>
|
||||
</div>
|
||||
|
||||
<p id="exportDuration" style="display:block;"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div><!-- end wp2static-footer -->
|
||||
|
||||
</div>
|
@ -0,0 +1,112 @@
|
||||
<div class="s3_settings_block" style="display:none;">
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl-s3"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-s3', 'http://mystaticsite.com', '', ''); ?><br>
|
||||
|
||||
<p><i>Set this to the URL your visitors will use to access your site. For an S3 hosted website, you have a few options which will influence what you put in this field. </i></p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="s3Key"><?php echo __('Access Key ID', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 's3Key', 'Access Key ID', 'ie, AKIAIOSFODNN7EXAMPLE'); ?><br>
|
||||
|
||||
<p><i>Your S3 user will need permissions to put objects into the bucket. Check that the user whose Key you are using has the correct permissions for S3. You may attach the 'AmazonS3FullAccess' to the user or give more fine grained permissions control via <a href="https://aws.amazon.com/iam/" target="_blank">AWS's IAM</a>.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="s3Key"><?php echo __('Secret Access Key', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 's3Secret', 'Secret Access Key', 'ie, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="s3Region"><?php echo __('Region', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php
|
||||
|
||||
// TODO: shift to S3 model/helper
|
||||
$s3_regions = array(
|
||||
"us-east-1" => "US East (N. Virginia)",
|
||||
"us-east-2" => "US East (Ohio)",
|
||||
"us-west-1" => "US West (N. California)",
|
||||
"us-west-2" => "US West (Oregon)",
|
||||
"ca-central-1" => "Canada (Central)",
|
||||
"ap-south-1" => "Asia Pacific (Mumbai)",
|
||||
"ap-northeast-2" => "Asia Pacific (Seoul)",
|
||||
"ap-southeast-1" => "Asia Pacific (Singapore)",
|
||||
"ap-southeast-2" => "Asia Pacific (Sydney)",
|
||||
"ap-northeast-1" => "Asia Pacific (Tokyo)",
|
||||
"ap-northeast-3" => "Asia Pacific (Osaka-Local)",
|
||||
"eu-central-1" => "EU (Frankfurt)",
|
||||
"eu-west-1" => "EU (Ireland)",
|
||||
"eu-west-2" => "EU (London)",
|
||||
"eu-west-3" => "EU (Paris)",
|
||||
"eu-north-1" => "EU (Stockholm)",
|
||||
"sa-east-1" => "South America (São Paulo)",
|
||||
"cn-north-1" => "China (Beijing)",
|
||||
"cn-northwest-1" => "China (Ningxia)",
|
||||
);
|
||||
?>
|
||||
|
||||
<?php $tpl->displaySelectMenu($this, $s3_regions, 's3Region', 'Region', 'ie, my-static-site'); ?><br>
|
||||
|
||||
<span class="description">choose the AWS region your bucket was created in</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="s3Bucket"><?php echo __('Bucket', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 's3Bucket', 'S3 Bucket', 'ie, my-static-site'); ?><br>
|
||||
|
||||
<p><i>Your bucket name as it appears in your <a href="https://s3.console.aws.amazon.com/s3/home" target="_blank">AWS Console for S3</a>.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="s3RemotePath"><?php echo __('Subdirectory', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 's3RemotePath', 'Subfolder in your bucket', 'ie, static-website'); ?><br>
|
||||
|
||||
<p><i>In case you want to put your site in a sub directory of a bucket, this will deploy all the static website files into the folder name you specify here.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="cfDistributionId"><?php echo __('CloudFront Cache Invalidation', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'cfDistributionId', 'CloudFront Distribution ID', 'ie, ABC123DEFX'); ?><br>
|
||||
|
||||
<p><i>If using CloudFront in your S3 static website setup, enter the CloudFront Distribution ID here and it will create an invalidation request for all files at the end of the deployment process. The invalidation usually happens within a few minutes. You can check any pending invalidations in your <a href="https://console.aws.amazon.com/cloudfront/home" target="_blank">AWS Console's CloudFront page</a>. You AWS user will need to have the CloudFrontFullAccess permissions or a more controlled policy, that includes the ability to send CloudFront invalidation requests.</i></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="s3_test"><?php echo __('Test S3 Settings', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<button id="s3-test-button" type="button" class="btn-primary button">Test S3 Settings</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="https://docs.wp2static.com/en/deploying/deployment-options/amazon-s3/" target="_blank">Read the docs</a> for more on deploying your WordPress site to S3
|
||||
</div>
|
@ -0,0 +1,139 @@
|
||||
<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 -->
|
||||
|
@ -0,0 +1,138 @@
|
||||
<div class="crawl_settings" style="display:none;">
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="useBasicAuth"><?php echo __('Use basic authentication', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayCheckbox($this, 'useBasicAuth', 'My WP site requires Basic Auth to access'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="basicAuthUser"><?php echo __('Basic auth user', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'basicAuthUser', 'Basic Auth user', '', ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="basicAuthPassword"><?php echo __('Basic auth password', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'basicAuthPassword', 'Basic Auth password', '', 'password'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="crawlPort"><?php echo __('Custom crawling port', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'crawlPort', 'Custom crawling port', ''); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label><?php echo __('Initial crawl list', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<p>Before it starts to export your site, the plugin first generates a list of all WordPress URLs it thinks it should include. It takes these from what it knows about your posts, pages, tags, archives and media.</p>
|
||||
|
||||
<div id="initial_crawl_list_loader" class="spinner is-active" style="float:none;width:auto;height:auto;padding:10px 0 10px 50px;background-position:20px 0;">
|
||||
Generating initial file list
|
||||
</div>
|
||||
|
||||
<i><p id="initial_crawl_list_count"></p></i>
|
||||
<br>
|
||||
<a id="preview_initial_crawl_list_button" style="display:none;" href="<?php echo $this->wp_site->uploads_url; ?>/WP-STATIC-INITIAL-CRAWL-LIST.txt" class="button button-secondary" target="_blank">Preview initial crawl list</a>
|
||||
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="detection_level"><?php echo __('Detection level', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select name="detection_level" id="detection_level">
|
||||
<?php
|
||||
// TODO: shift this into helper function for select
|
||||
$detection_levels = array(
|
||||
'everything' => 'As much as possible',
|
||||
'posts_and_pages' => 'Posts and pages only',
|
||||
'homepage' => 'Homepage only'
|
||||
);
|
||||
|
||||
foreach($detection_levels as $key => $level) : ?>
|
||||
<option value="<?php echo $key; ?>"<?php echo $this->options->detection_level == $key ? ' selected' : ''; ?>><?php echo $level; ?></option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
|
||||
<button class="button button-secondary" id="save-and-reload">Save and reload</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label><?php echo __('Exclude certain URLs', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<p>Where the plugin has detected too many files and you want to exclude certain URLs from being crawled, please specify these URLs here.</p> <br>
|
||||
|
||||
<i><p>You can enter this as a partial string or full path</p> <br>
|
||||
|
||||
<?php echo $this->wp_site_url; ?>/wp-content/themes/twentyseventeen/banana.jpg<br>
|
||||
/my_pricelist.pdf<br>
|
||||
.js<br>
|
||||
</i>
|
||||
<br>
|
||||
|
||||
<textarea class="widefat" name="excludeURLs" id="excludeURLs" rows="5" cols="10"><?php echo $this->options->excludeURLs ? $this->options->excludeURLs : '' ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label><?php echo __('Include additional URLs', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<p>Where the plugin fails to detect certain URLs that you know you want to include, please add these here. This will be applied after any exclusions, in case you want to exclude a whole directory, then include just one file from it.</p> <br>
|
||||
|
||||
<i><p>Supported formats are relative URLs</p> <br>
|
||||
|
||||
<?php echo $this->wp_site_url; ?><br>
|
||||
<?php echo $this->wp_site_url; ?>/wp-content/themes/twentyseventeen/banana.jpg<br>
|
||||
/my_pricelist.pdf<br>
|
||||
</i>
|
||||
<br>
|
||||
|
||||
<textarea class="widefat" name="additionalUrls" id="additionalUrls" rows="5" cols="10"><?php echo $this->options->additionalUrls ? $this->options->additionalUrls : '' ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="crawl_delay"><?php echo __('Crawl Delay', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select name="crawl_delay" id="crawl_delay">
|
||||
<?php
|
||||
// TODO: shift this into helper function for select
|
||||
$delays = 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($delays as $delay) : ?>
|
||||
<option value="<?php echo $delay; ?>"<?php echo $this->options->crawl_delay == $delay ? ' selected' : ''; ?>><?php echo $delay; ?></option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</select><br>
|
||||
|
||||
<p>This is set to 0, by default, for better performance, but if exports are failing and no error appears with Debug Log enabled or you see "Too many files open" or such errors in the server logs, try increasing this value until you get a successful export.</p>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div><!-- end crawl_setings -->
|
@ -0,0 +1,47 @@
|
||||
<div class="export_your_site">
|
||||
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="selected_deployment_option"><?php echo __('Where will you host the optimized version of your site?', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<select class="selected_deployment_method" name="selected_deployment_option">
|
||||
<?php generateDeploymentMethodOptions(); ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<!-- legacy multi-export functionality relied on the baseUrl field being first in the settings block -->
|
||||
<input style="display:none;" type="text" id="baseUrl" name="baseUrl" value="<?php echo esc_attr($this->baseUrl) ?>" size="50" placeholder="http://mystaticsite.com" />
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
// load up each deployment settings block
|
||||
$deployment_options = array(
|
||||
'zip',
|
||||
'ftp',
|
||||
'folder',
|
||||
's3',
|
||||
'bunnycdn',
|
||||
'netlify',
|
||||
'github',
|
||||
'gitlab',
|
||||
'bitbucket',
|
||||
);
|
||||
|
||||
foreach($deployment_options as $deployment_option) {
|
||||
require_once(__DIR__ . '/' . $deployment_option . '_settings_block.phtml');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</div> <!-- end export_your_site -->
|
||||
|
@ -0,0 +1,67 @@
|
||||
<div class="help_troubleshooting" style="display:none;">
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-book-alt"></span>
|
||||
<label><?php echo __('Documentation & Tutorials', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://wp2static.com" target="_blank">
|
||||
Official documentation and tutorials at wp2static.com
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-wordpress-alt"></span>
|
||||
<label><?php echo __('Ask a WordPress expert', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://wordpress.stackexchange.com" target="_blank">
|
||||
https://wordpress.stackexchange.com
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-groups"></span>
|
||||
<label><?php echo __('Community', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://forum.wp2static.com/" target="_blank">
|
||||
Our support and development forum
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-format-chat"></span>
|
||||
<label><?php echo __('Community', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://t.me/wp2static" target="_blank">
|
||||
Chat for users & developers via Telegram
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-hammer"></span>
|
||||
<label><?php echo __('Report a bug', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://github.com/WP2static/wp2static/" target="_blank">
|
||||
Our project page on GitHub
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!-- end advanced settings -->
|
||||
|
@ -0,0 +1,30 @@
|
||||
<div class="export_logs" style="display:none;">
|
||||
|
||||
<br>
|
||||
|
||||
<select id="log_switcher">
|
||||
<option value="">Choose a log to view</option>
|
||||
<option value="detected_wordpress_urls">Detected WordPress URLs</option>
|
||||
<option value="modified_crawl_list">Modified crawl list</option>
|
||||
<option value="discovered_urls">Discovered URLs during crawl</option>
|
||||
<option value="crawled_links">Crawled links</option>
|
||||
<option value="encountered_404s">404s encountered</option>
|
||||
<option value="export_log">Export log</option>
|
||||
</select>
|
||||
|
||||
<button id="reload_log_button" class="button-secondary">(Re)load log</button>
|
||||
|
||||
|
||||
|
||||
<div id="log_load_progress" class="pulsate-css" style="float:none;display:none;"></div>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<textarea id="export_log_textarea" style="width:100%;min-height:300px;" disabled>
|
||||
Please select a log to view from the menu above
|
||||
</textarea>
|
||||
|
||||
|
||||
</div> <!-- end advanced settings -->
|
||||
|
@ -0,0 +1,81 @@
|
||||
<div class="give_love" style="display:none;">
|
||||
|
||||
<p>
|
||||
This is first and foremost free, <a href="" target="https://github.com/leonstafford/wordpress-static-html-plugin/">open source</a> software, but aiming to cover development, support and promotional costs via <a href="https://wp2static.com" target="_blank">licenses for commercial usage</a>.
|
||||
</p>
|
||||
|
||||
<h2>Other ways to support this plugin</h2>
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-wordpress-alt"></span>
|
||||
<label><?php echo __('Leave a review', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://wordpress.org/support/plugin/static-html-output-plugin/reviews/" target="_blank">
|
||||
Official WordPress.org reviews for WP2Static
|
||||
</a>
|
||||
|
||||
<p>Reviews play a large part in helping people decide to try a plugin. Try to include how the plugin helped you solve a particular problem.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-book-alt"></span>
|
||||
<label><?php echo __('Documentation', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://github.com/leonstafford/wp-static-site-generator-documentation" target="_blank">
|
||||
Help write / translate our documentation
|
||||
</a>
|
||||
|
||||
<p>A never-ending, continual improvement process that benefits from any input. Instructions on the linked page. If it's too technical, make contact and we can find another way to get your contributions.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-twitter"></span>
|
||||
<label><?php echo __('Spread the word', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://twitter.com/wp2static" target="_blank">
|
||||
Tweet about @wp2static
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-format-chat"></span>
|
||||
<label><?php echo __('Help others', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://wp2static.com/community/" target="_blank">
|
||||
Help other users in our forums, StackExchange, Slack, Twitter, GitHub Issues or official WordPress.org plugin support page.
|
||||
</a>
|
||||
|
||||
<p>We want to help more people realize the benefits of going static and easing their transition. Be there to help answer questions and support each other.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<span class="dashicons dashicons-video-alt3"></span>
|
||||
<label><?php echo __('Video tutorials', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<a href="https://www.youtube.com/watch?v=JmU6lrB8bRs" target="_blank">
|
||||
Create screencasts/tutorials
|
||||
</a>
|
||||
|
||||
<p>Many people prefer to learn visually, with video tutorials a really effective way to convey the whole WordPress to static site solution. If you make a how-to video or other WordPress to static or general static website video, we'll happily promote it for you.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
</div> <!-- end advanced settings -->
|
||||
|
@ -0,0 +1,109 @@
|
||||
<div class="processing_settings" style="display:none;">
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="useRelativeURLs"><?php echo __('Use relative URLs', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<?php $tpl->displayCheckbox($this, 'useRelativeURLs', 'Use relative URLs'); ?>
|
||||
|
||||
<p> URLs in the exported site will be rewritten as <a href="https://www.w3schools.com/tags/tag_base.asp" target="_blank">relative URLs</a>. ie, <code>http://mydomain.com/some_dir/some_file.jpg</code> will become <code>some_dir/some_file.jpg</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseHREF"><?php echo __('Base HREF', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseHREF', 'Base HREF', '', ''); ?>
|
||||
|
||||
<p>Setting this will tell the browser to resolve all URLs using this as a base. ie, with a Base HREF of <code>/</code> and the relative URL setting enabled above, a relative link of <code>some_dir/some_file.jpg</code> will resolve to <code>/some_dir/some_file.jpg</code></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label><?php echo __('Rewrite Links in source code', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<p>In order to hide any trace that your site uses WordPress, the following paths will be rewritten. You can leave these default options in, but for more control, you can overwrite them.</p><br>
|
||||
|
||||
<p>Replace, for example, default WordPress paths within the source code</p> <br>
|
||||
|
||||
<p>use the full path, such as:</p>
|
||||
|
||||
<pre>
|
||||
wp-content/themes/twentyseventeen/,contents/ui/mytheme/
|
||||
wp-includes/,inc/
|
||||
</pre>
|
||||
|
||||
<i>URLs will be first checked to ensure they are part of this site, not an external WordPress site, which would mess up URLs of linked images, etc</i>
|
||||
|
||||
<br>
|
||||
|
||||
<?php
|
||||
$default_rewrite_rules = '';
|
||||
?>
|
||||
|
||||
<textarea class="widefat" name="rewrite_rules" id="rewrite_rules" rows="5" cols="10"><?php echo $this->options->rewrite_rules ? $this->options->rewrite_rules : $default_rewrite_rules; ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label><?php echo __('Rename Exported Directories', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<p>Likely required if doing any URL rewriting above.</p><br>
|
||||
|
||||
<p>Set the source directory, then a comma and the target directory. </p
|
||||
|
||||
<p>
|
||||
In order to move wp-content/themes/twentyseventeen to contents/ui/mytheme, we'd need:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
wp-content,contents
|
||||
contents/themes,contents/ui
|
||||
contents/ui/twentyseventeen,contents/ui/mytheme
|
||||
wp-includes/,inc/
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<?php
|
||||
$default_rename_rules = '';
|
||||
?>
|
||||
|
||||
<textarea class="widefat" name="rename_rules" id="rename_rules" rows="5" cols="10"><?php echo $this->options->rename_rules ? $this->options->rename_rules : $default_rename_rules; ?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="stripping"><?php echo __('Remove cruft', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
|
||||
<?php $tpl->displayCheckbox($this, 'removeConditionalHeadComments', 'Remove conditional comments within HEAD', 'checked'); ?>
|
||||
|
||||
<p>Mostly obsolete, previously used for detecting versions of Internet Explorer and serving different CSS or JS.</p><br>
|
||||
|
||||
<?php $tpl->displayCheckbox($this, 'removeWPMeta', 'Remove WP Meta tags'); ?>
|
||||
|
||||
<p>The <code><meta> name="generator" content="WordPress 4.9.8" /></code> type tags.</p><br>
|
||||
|
||||
<?php $tpl->displayCheckbox($this, 'removeWPLinks', 'Remove WP <link> tags'); ?>
|
||||
|
||||
<p>ie, <code><link& rel="EditURI"...</code> type tags that usually aren't needed.</p><br>
|
||||
|
||||
<?php $tpl->displayCheckbox($this, 'removeHTMLComments', 'Remove HTML comments'); ?>
|
||||
|
||||
<p>ie, <code><!-- / Yoast SEO plugin. --></code> type comments that are ridiculously wasting bytes</p><br>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div><!-- end processing_setings -->
|
@ -0,0 +1,46 @@
|
||||
<div class="zip_settings_block" style="display:none;">
|
||||
|
||||
<?php if ( ! extension_loaded('zip') ) : ?>
|
||||
|
||||
<div class="notice notice-error inline">
|
||||
<h2 class="title">WARNING: ZIP extension missing</h2>
|
||||
|
||||
<p>This can be a common issue but easy to fix. It means that the installation of the PHP programming language on your web host does not currently have support for reading and generating compressed ZIP files. This is needed for the plugin to be able to generate a .zip archive of your static website. Here's some hosting company and platform specific guides on how to fix:</p>
|
||||
|
||||
<ul>
|
||||
<li><a target="_blank" href="https://godaddy.com/help/enable-custom-php-modules-12036">GoDaddy</a></li>
|
||||
<li><a target="_blank" href="https://stackoverflow.com/questions/23564138/how-to-enable-zip-dll-in-xampp">XAMPP</a></li>
|
||||
<li><a target="_blank" href="https://stackoverflow.com/questions/38104348/install-php-zip-on-php-5-6-on-ubuntu">Ubuntu</a></li>
|
||||
<li><a target="_blank" href="https://www.digitalocean.com/community/questions/php-7-0-ziparchive-library-is-missing-or-disabled">DigitalOcean</a></li>
|
||||
<li><a target="_blank" href="http://lmgtfy.com/?q=how+to+get+zip+extension+php">Ask Dr. Google</a></li>
|
||||
</ul>
|
||||
|
||||
<p>After installing/enabling the ZIP extension for PHP, you will likely also need to restart your webserver (Apache or nginx) for it to be usable within WordPress and this plugin.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<strong><?php echo __('Allow offline usage', 'static-html-output-plugin');?></strong>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayCheckbox($this, 'allowOfflineUsage', "Check this if you're going to run your site locally, ie on a USB drive given to a client. All links will be made relative and no Destination URL will be used."); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">
|
||||
<label for="baseUrl"><?php echo __('Destination URL', 'static-html-output-plugin');?></label>
|
||||
</th>
|
||||
<td>
|
||||
<?php $tpl->displayTextfield($this, 'baseUrl-zip', 'http://mystaticsite.com', '', ''); ?>
|
||||
|
||||
<p> <i><?php echo __("Set this to the URL you intend to host your static exported site on, ie http://mystaticsite.com. Do not set this to the same URL as the WordPress site you're currently using (the address in your browser above). This plugin will rewrite all URLs in the exported static html from your current WordPress URL to what you set here. Supports http, https and protocol relative URLs.", 'static-html-output-plugin');?></i> </p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
Reference in New Issue
Block a user