Commit 0451845f authored by Jordan Michaels's avatar Jordan Michaels

clarification and usability updates

parent 6a0290bb
...@@ -37,4 +37,17 @@ The Vivio Swift WordPress plugin alpha release provides a comprehensive page cac ...@@ -37,4 +37,17 @@ The Vivio Swift WordPress plugin alpha release provides a comprehensive page cac
* CSS combination to reduce the number of HTTP requests to a server * CSS combination to reduce the number of HTTP requests to a server
* JS combination to reduce the number of HTTP requests to a server * JS combination to reduce the number of HTTP requests to a server
* Asynchronous loading of Google Fonts * Asynchronous loading of Google Fonts
* Disabling of render-blocking JS * Disabling of render-blocking JS
\ No newline at end of file
# Installation
To install, simply download the vivio-swift.zip file and extract it into your wordpress '/wp-content/plugins/' folder, or upload the zip using the plugin management screen in your Wordpress Installation.
## Download and Extract
```
# cd /home/username/public_html/wp-content/plugins/
# wget https://code.viviotech.net/wp/vivio-swift/raw/master/vivio-swift.zip
# unzip vivio-swift.zip
```
... then activate the plugin via the wordpress plugins screen.
\ No newline at end of file
No preview for this file type
...@@ -76,7 +76,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -76,7 +76,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
global $vivio_swift_global; global $vivio_swift_global;
echo '<div class="message_standard">'; echo '<div class="message_standard">';
echo '<p>' . __('On-Access Cache will create a page cache if it doesn\'t exist yet. It is recommended to keep this on unless there is a conflict with another plugin.', 'vivio-swift') . '</p>'; echo '<p>' . __('On-Access Cache creates a cache whenever a cachable PHP page is accessed. It is recommended to keep this on unless there is a conflict with another plugin.', 'vivio-swift') . '</p>';
echo '</div>'; echo '</div>';
// process cache settings // process cache settings
...@@ -174,7 +174,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -174,7 +174,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
global $vivio_swift_global; global $vivio_swift_global;
echo '<div class="message_standard">'; echo '<div class="message_standard">';
echo '<p>' . __('Preload cache will cashe all pages on your site and refresh that cache if it expires. It is recommended that you run both On-Access and Preload Cache together.', 'vivio-swift') . '</p>'; echo '<p>' . __('Preload cache will cache your entire site and refresh that cache when it expires. It is recommended that you run both On-Access and Preload Cache together.', 'vivio-swift') . '</p>';
echo '</div>'; echo '</div>';
if (isset($_POST['vivio_swift_cache_clear_submit'])) if (isset($_POST['vivio_swift_cache_clear_submit']))
......
...@@ -85,6 +85,18 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -85,6 +85,18 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
global $vivio_swift_global; global $vivio_swift_global;
$cache_expires_in_txt = '';
$preload_cache_enabled = $vivio_swift_global->configs->get_value('vivio_swift_preload_cache_enabled');
$preload_last_run_date = $vivio_swift_global->configs->get_value('vivio_swift_preload_last_run_date');
$preload_last_run_datetime = new DateTime( $vivio_swift_global->configs->get_value('vivio_swift_preload_last_run_date') );
// if preload is enabled, calc the expiration date
if (($preload_cache_enabled=='1') && ($preload_last_run_date!='')){
$cache_expires_in_txt = Vivio_Swift_Utility_Date::format_interval($preload_last_run_datetime);
} else {
$cache_expires_in_txt = "No Preload Cache on record.";
}
if (isset($_POST['vivio_swift_clear_cache_submit'])) if (isset($_POST['vivio_swift_clear_cache_submit']))
{ {
// verify nonce // verify nonce
...@@ -101,9 +113,9 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -101,9 +113,9 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
if (isset($_POST['vivio_swift_preload_force_refresh'])){ if (isset($_POST['vivio_swift_preload_force_refresh'])){
// verify nonce // verify nonce
$nonce = $_REQUEST['_wpnonce']; $nonce = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce, 'vivio_swift_cache_dashboard_nonce')) { if (!wp_verify_nonce($nonce, 'vivio_swift_preload_dashboard_nonce')) {
$vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Dashboard_Menu::render_tab1 - Nonce check failed in preload settings.", 4); $vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Dashboard_Menu::render_tab1 - Nonce check failed in preload dashboard.", 4);
wp_die("Error: Nonce check failed when attempting to update cache settings."); wp_die("Error: Nonce check failed when attempting to update cache dashboard.");
} }
// force a preload cache refresh // force a preload cache refresh
...@@ -161,16 +173,6 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -161,16 +173,6 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
</label> </label>
</td> </td>
</tr> </tr>
<tr valign="top">
<th scope="row"><?php _e('Force Preload Refresh', 'vivio-swift')?>:</th>
<td>
<label>
<input type="submit" name="vivio_swift_preload_force_refresh" value="<?php _e('Force Refresh', 'vivio-swift')?>"
class="pure-button button-small"
<?php if(!$vivio_swift_global->configs->get_value('vivio_swift_preload_cache_enabled')=='1') echo ' disabled'; ?> />
</label>
</td>
</tr>
</table> </table>
<input type="submit" name="vivio_swift_cache_dashboard_submit" id="vivio_swift_cache_dashboard_submit" value="<?php _e('Save Settings', 'vivio-swift')?>" class="pure-button" /> <input type="submit" name="vivio_swift_cache_dashboard_submit" id="vivio_swift_cache_dashboard_submit" value="<?php _e('Save Settings', 'vivio-swift')?>" class="pure-button" />
</form> </form>
...@@ -203,15 +205,49 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -203,15 +205,49 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
</div> </div>
</div> </div>
<div class="dashboard_box_small">
<div class="postbox">
<h3 class="hndle">
<label for="title"><?php _e('Preload Cache', 'vivio-swift');?></label>
</h3>
<div class="inside">
<form action=""
id="vivio_swift_preload_dashboard"
method="POST">
<?php wp_nonce_field('vivio_swift_preload_dashboard_nonce'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Current Preload Cache Age', 'vivio-swift')?>:</th>
<td>
<span class="description"><?php echo $cache_expires_in_txt; //echo ' ('.$preload_last_run_date.')' ?></span>
</td>
</tr>
<tr valign="top">
<th scope="row"><?php _e('Force Preload Refresh', 'vivio-swift')?>:</th>
<td>
<label>
<input type="submit" name="vivio_swift_preload_force_refresh" value="<?php _e('Force Refresh', 'vivio-swift')?>"
class="pure-button button-small"
<?php if(!$vivio_swift_global->configs->get_value('vivio_swift_preload_cache_enabled')=='1') echo ' disabled'; ?> />
</label>
</td>
</tr>
</table>
</form>
</div>
</div>
</div>
<div class="dashboard_box_small"> <div class="dashboard_box_small">
<div class="postbox"> <div class="postbox">
<h3 class="hndle"> <h3 class="hndle">
<label for="title"><?php _e('Spread the Word', 'vivio-swift');?></label> <label for="title"><?php _e('Spread the Word', 'vivio-swift');?></label>
</h3> </h3>
<div class="inside"> <div class="inside">
<p><?php _e('Has this plugin helped you? Pay it forward and let others know! Here is how you can help:', 'vivio-swift');?></p> <p><?php _e('Has this plugin helped you? Let others know!', 'vivio-swift');?></p>
<p><a href="https://www.facebook.com/viviotech" target="_blank">Like us on Facebook</a></p> <p><a href="https://www.facebook.com/viviotech" target="_blank">Like us on Facebook</a></p>
<p><a href="http://twitter.com/intent/tweet?url=https://viviotech.net/&text=Using the Vivio Swift #Wordpress plugin from @viviotech has really helped speed up my site! Check it out!" target="_blank">Post to Twitter</a></p> <p><a href="http://twitter.com/intent/tweet?url=https://viviotech.net/&text=Using the Vivio Swift Wordpress plugin from @viviotech has really helped speed up my site! Check it out!" target="_blank">Post to Twitter</a></p>
<p><a href="#" target="_blank">Give a Good Rating on Wordpress</a></p> <p><a href="#" target="_blank">Give a Good Rating on Wordpress</a></p>
</div> </div>
</div> </div>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment