Commit 3aa1bbdf authored by Jordan Michaels's avatar Jordan Michaels

release 2020032401

parent 9a1400d7
...@@ -2,11 +2,15 @@ ...@@ -2,11 +2,15 @@
Versions are recorded in YYYYMMDDnn format. Please include latest versions at the top. Versions are recorded in YYYYMMDDnn format. Please include latest versions at the top.
## 2017112801 ## 2020032401
* Initial Release. * [UPGRADE] Added proper images for Vivio Swift Icons and Header images
* [FIX] A few minor layout issues have been corrected
* [NEW] Added Browser Caching feature using the Cache-Control header (requires Apache mod_header) - Issue 5
## 2018011901 ## 2018021901
* Initial alpha release for internal testing of caching system. * [UPGRADE] The Vivio Swift Preload Cache is now a non-blocking event, and runs quietly in the background - Issue 9
* [FIX] The Preload Cache process should now actually run on plugin activation - Issue 8
* [NEW] Vivio Swift now offers a Browser Cache option, which currently gives you control over the cache-control max-age HTTP Header.
## 2018021301 ## 2018021301
* [NEW] Update Vivio-Swift HTML footer message to state if page was not cached due to exclude rule - Issue 1 * [NEW] Update Vivio-Swift HTML footer message to state if page was not cached due to exclude rule - Issue 1
...@@ -14,6 +18,8 @@ Versions are recorded in YYYYMMDDnn format. Please include latest versions at th ...@@ -14,6 +18,8 @@ Versions are recorded in YYYYMMDDnn format. Please include latest versions at th
* [NEW] Refresh Events now re-create preload cache if preload caching is enabled - Issue 7 * [NEW] Refresh Events now re-create preload cache if preload caching is enabled - Issue 7
* [NEW] The Preload Cache process should now run on plugin activation - Issue 8 * [NEW] The Preload Cache process should now run on plugin activation - Issue 8
## 2018021901 ## 2018011901
* [UPGRADE] The Vivio Swift Preload Cache is now a non-blocking event, and runs quietly in the background - Issue 9 * Initial alpha release for internal testing of caching system.
* [FIX] The Preload Cache process should now actually run on plugin activation - Issue 8
## 2017112801
* Initial Release.
\ No newline at end of file
<?php
class Vivio_Swift_Admin_Links
{
var $arr_links = array(
"help_mod_headers" => "https://kb.viviotech.net/display/KB/How+to+Install+mod_headers",
);
function get_link($name='')
{
return $this->arr_links[$name];
}
}
\ No newline at end of file
...@@ -42,7 +42,7 @@ class Vivio_Swift_Admin { ...@@ -42,7 +42,7 @@ class Vivio_Swift_Admin {
function create_admin_menus() function create_admin_menus()
{ {
$vivio_swift_icon = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiICAgd2lkdGg9IjMwMG1tIiAgIGhlaWdodD0iMzAwbW0iICAgdmlld0JveD0iMCAwIDMwMCAzMDAiICAgdmVyc2lvbj0iMS4xIiAgIGlkPSJzdmc0ODQ0IiAgIGlua3NjYXBlOnZlcnNpb249IjAuOTIuMSByMTUzNzEiICAgc29kaXBvZGk6ZG9jbmFtZT0icGx1Z2luLWljb24uc3ZnIj4gIDxkZWZzICAgICBpZD0iZGVmczQ4MzgiIC8+ICA8c29kaXBvZGk6bmFtZWR2aWV3ICAgICBpZD0iYmFzZSIgICAgIHBhZ2Vjb2xvcj0iIzAwMDAwMCIgICAgIGJvcmRlcmNvbG9yPSIjNjY2NjY2IiAgICAgYm9yZGVyb3BhY2l0eT0iMS4wIiAgICAgaW5r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VQICAgIfAhkiAAAAAlwSFlzAAAOxAAADsQBlSsOGwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAFcSURBVDiNjZPPSlVRGMV/31URJBFNsSuikIo0CEMEBzUIctQgcJgKPkMvEL6AQ0eizhrYMATBWVOf4Oo1JALDQQimIdn9NbjnyOm0D7gmm/19a6299r8gAbUDeAk8BbqABvA5Ii5S/CTUQXVF3VVv1Wt1Q+2vEkyr0xW9Z2rTNprqZJkwrH5TW+q++jxhMqpeZiYnal+xueP/WE+YzKtv1Lfqu7w4pP5OGKjWK7b0JEvci7qcELbUtQrxQ/U0473uBCZKnF/AakR8TBkAP4CvwDjwuAa0Cs0G8CIXq93qnBo5ISIEPmXTWg04Bf4A68AscKQuqbvAOXAIvC+l+HI3qnX1g7qgbheuqogr9UHhHBbzWmdEnKk3wEHFngF6gDpwnM1ngJ2I+Jk7PlK/V1xljqlCgk114J8lbD/Xs3sajCRzZuexZfvzlDGa0kSqmMV7BYxlpSawFxG3Ze5fNDWhFVEs0JAAAAAASUVORK5CYII=';
$this->main_menu_page = add_menu_page(__('Vivio Swift', 'vivio-swift'), __('Vivio Swift', 'vivio-swift'), VIVIO_SWIFT_CAPABILITY, VIVIO_SWIFT_MAIN_MENU_SLUG , array(&$this, 'handle_dashboard_menu_rendering'), $vivio_swift_icon); $this->main_menu_page = add_menu_page(__('Vivio Swift', 'vivio-swift'), __('Vivio Swift', 'vivio-swift'), VIVIO_SWIFT_CAPABILITY, VIVIO_SWIFT_MAIN_MENU_SLUG , array(&$this, 'handle_dashboard_menu_rendering'), $vivio_swift_icon);
add_submenu_page(VIVIO_SWIFT_MAIN_MENU_SLUG, __('Dashboard', 'vivio-swift'), __('Dashboard', 'vivio-swift') , VIVIO_SWIFT_CAPABILITY, VIVIO_SWIFT_MAIN_MENU_SLUG, array(&$this, 'handle_dashboard_menu_rendering')); add_submenu_page(VIVIO_SWIFT_MAIN_MENU_SLUG, __('Dashboard', 'vivio-swift'), __('Dashboard', 'vivio-swift') , VIVIO_SWIFT_CAPABILITY, VIVIO_SWIFT_MAIN_MENU_SLUG, array(&$this, 'handle_dashboard_menu_rendering'));
add_submenu_page(VIVIO_SWIFT_MAIN_MENU_SLUG, __('Cache', 'vivio-swift'), __('Cache', 'vivio-swift') , VIVIO_SWIFT_CAPABILITY, VIVIO_SWIFT_CACHE_MENU_SLUG, array(&$this, 'handle_cache_menu_rendering')); add_submenu_page(VIVIO_SWIFT_MAIN_MENU_SLUG, __('Cache', 'vivio-swift'), __('Cache', 'vivio-swift') , VIVIO_SWIFT_CAPABILITY, VIVIO_SWIFT_CACHE_MENU_SLUG, array(&$this, 'handle_cache_menu_rendering'));
......
...@@ -3,9 +3,7 @@ ...@@ -3,9 +3,7 @@
class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
{ {
var $dashboard_menu_page_slug = VIVIO_SWIFT_MAIN_MENU_SLUG; var $dashboard_menu_page_slug = VIVIO_SWIFT_MAIN_MENU_SLUG;
var $menu_tabs; var $menu_tabs;
var $menu_tabs_handler = array( var $menu_tabs_handler = array(
'tab1' => 'render_tab1', 'tab1' => 'render_tab1',
'tab2' => 'render_tab2', 'tab2' => 'render_tab2',
...@@ -17,6 +15,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -17,6 +15,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
function __construct() function __construct()
{ {
require_once('vivio-swift-admin-links.php');
$this->links = new Vivio_Swift_Admin_Links;
$this->render_menu_page(); $this->render_menu_page();
} }
...@@ -54,6 +54,13 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -54,6 +54,13 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
echo '</h2>'; echo '</h2>';
} }
function render_notifications()
{
global $vivio_swift_global;
// TODO check for global messages and post them here.
}
/* /*
* The menu rendering goes here * The menu rendering goes here
*/ */
...@@ -78,7 +85,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -78,7 +85,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
function render_tab1() function render_tab1()
{ {
echo '<div class="message_standard">'; echo '<div class="message_success">';
echo '<p>' . __('Thank you for trying Vivio Swift (beta). Please report bugs or issues <a href="https://viviotech.net/contactus.html" target="_blank">HERE</a>.', 'vivio-swift') . '</p>'; echo '<p>' . __('Thank you for trying Vivio Swift (beta). Please report bugs or issues <a href="https://viviotech.net/contactus.html" target="_blank">HERE</a>.', 'vivio-swift') . '</p>';
echo '<p><a href="https://twitter.com/viviotech/" target="_blank">' . __('Follow us on Twitter', 'vivio-swift') . '</a> ' . __('to stay up to date on new and improved features of this plugin.', 'vivio-swift') . '</p>'; echo '<p><a href="https://twitter.com/viviotech/" target="_blank">' . __('Follow us on Twitter', 'vivio-swift') . '</a> ' . __('to stay up to date on new and improved features of this plugin.', 'vivio-swift') . '</p>';
echo '</div>'; echo '</div>';
...@@ -135,6 +142,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -135,6 +142,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
// set and save submitted settings // set and save submitted settings
$vivio_swift_global->configs->set_value('vivio_swift_cache_enabled',isset($_POST["vivio_swift_cache_enabled"])?'1':''); $vivio_swift_global->configs->set_value('vivio_swift_cache_enabled',isset($_POST["vivio_swift_cache_enabled"])?'1':'');
$vivio_swift_global->configs->set_value('vivio_swift_preload_cache_enabled',isset($_POST["vivio_swift_preload_cache_enabled"])?'1':''); $vivio_swift_global->configs->set_value('vivio_swift_preload_cache_enabled',isset($_POST["vivio_swift_preload_cache_enabled"])?'1':'');
$vivio_swift_global->configs->set_value('vivio_swift_cache_control_headers_enable',isset($_POST["vivio_swift_cache_control_headers_enable"])?'1':'');
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
$this->show_msg_settings_updated(); $this->show_msg_settings_updated();
...@@ -145,7 +153,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -145,7 +153,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
<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('Quick Cache', 'vivio-swift');?></label> <label for="title"><?php _e('Quick Settings', 'vivio-swift');?></label>
</h3> </h3>
<div class="inside"> <div class="inside">
...@@ -174,6 +182,17 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -174,6 +182,17 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
</label> </label>
</td> </td>
</tr> </tr>
<tr valign="top">
<th scope="row"><?php _e('Browser Cache', 'vivio-swift')?>:</th>
<td>
<label class="switch">
<input name="vivio_swift_cache_control_headers_enable"
id="vivio_swift_cache_control_headers_enable"
type="checkbox"<?php if($vivio_swift_global->configs->get_value('vivio_swift_cache_control_headers_enable')=='1') echo ' checked="checked"'; ?> value="1"/>
<span class="slider round"></span>
</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>
...@@ -248,8 +267,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -248,8 +267,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
<div class="inside"> <div class="inside">
<p><?php _e('Has this plugin helped you? Let others know!', '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="https://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="https://wordpress.org/support/plugin/vivio-swift" target="_blank">Give a Good Rating on Wordpress</a></p>
</div> </div>
</div> </div>
</div> </div>
...@@ -273,7 +292,6 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -273,7 +292,6 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
<?php <?php
} }
function render_tab2() function render_tab2()
{ {
...@@ -305,7 +323,26 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -305,7 +323,26 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
: </strong><code><?php echo VIVIO_SWIFT_CACHE_BOT_NAME; ?></code><br/> : </strong><code><?php echo VIVIO_SWIFT_CACHE_BOT_NAME; ?></code><br/>
</div> </div>
</div><!-- End of Site Info --> </div>
<div class="postbox">
<h3 class="hndle">
<label for="title"><?php _e('Apache Environment', 'vivio-swift');?></label>
</h3>
<div class="inside">
<strong><?php _e('VERSION', 'vivio-swift');?>
: </strong><code><?php echo ($vivio_swift_global->util_apache->apache_version()) ? $vivio_swift_global->util_apache->apache_version() : "Unknown"; ?></code>
<?php if(!$vivio_swift_global->util_apache->apache_version()){echo '<font color="red">WARNING</font>';} ?><br/>
<strong><?php _e('mod_rewrite', 'vivio-swift');?>
: </strong><code><?php echo ($vivio_swift_global->util_apache->test_mod_rewrite()) ? "Yes" : "Unknown"; ?></code>
<?php if(!$vivio_swift_global->util_apache->test_mod_rewrite()){echo '<font color="red">WARNING</font>';} ?><br/>
<strong><?php _e('mod_headers', 'vivio-swift');?>
: </strong><code><?php echo ($vivio_swift_global->util_apache->test_mod_headers()) ? "Yes" : "Unknown"; ?></code>
<?php if(!$vivio_swift_global->util_apache->test_mod_headers()){echo '<font color="red">WARNING</font> <a href="'.$this->links->get_link("help_mod_headers").'" target="_blank" style="text-decoration: none;"><span class="dashicons dashicons-editor-help"></span></a>';} ?><br/>
</div>
</div>
<div class="postbox"> <div class="postbox">
<h3 class="hndle"> <h3 class="hndle">
...@@ -333,14 +370,14 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -333,14 +370,14 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
<strong>CURL <?php _e('Library Present', 'vivio-swift');?> <strong>CURL <?php _e('Library Present', 'vivio-swift');?>
: </strong><code><?php echo (function_exists('curl_init')) ? "Yes" : "No"; ?></code><br/> : </strong><code><?php echo (function_exists('curl_init')) ? "Yes" : "No"; ?></code><br/>
<strong><?php _e('Debug File Write Permissions', 'vivio-swift');?> <strong><?php _e('Debug File Write Permissions', 'vivio-swift');?>
: </strong><code><?php echo (is_writable(VIVIO_SWIFT_PATH)) ? "Writable" : "Not Writable"; ?></code><br/> : </strong><code><?php echo (is_writable(VIVIO_SWIFT_PATH."/logs/".VIVIO_SWIFT_LOG_FILE)) ? "Writable</code>" : "Not Writable</code> "."<font color='red'>WARNING</font>" ?><br/>
</div> </div>
</div><!-- End of Site Info --> </div>
<div class="postbox"> <div class="postbox">
<h3 class="hndle"> <h3 class="hndle">
<label for="title"><?php _e('PHP Info', 'vivio-swift');?></label> <label for="title"><?php _e('PHP Environment', 'vivio-swift');?></label>
</h3> </h3>
<div class="inside"> <div class="inside">
...@@ -726,6 +763,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -726,6 +763,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
</form> </form>
</div> </div>
</div> </div>
<?php <?php
} }
...@@ -791,11 +830,10 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -791,11 +830,10 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
$vivio_swift_global->debug_logger->reset_log_file('1'); $vivio_swift_global->debug_logger->reset_log_file('1');
//$vivio_swift_global->debug_logger->reset_log_file('2');//cron //$vivio_swift_global->debug_logger->reset_log_file('2');//cron
$preload_enabled = ($this->configs->get_value('vivio_swift_preload_cache_enabled')=='1')?true:false; $preload_enabled = ($vivio_swift_global->configs->get_value('vivio_swift_preload_cache_enabled')=='1')?true:false;
if ($preload_enabled){wp_schedule_single_event(time(), 'vivio_swift_schedule_preload_cache');} if ($preload_enabled){wp_schedule_single_event(time(), 'vivio_swift_schedule_preload_cache');}
$this->show_msg_settings_updated(); $this->show_msg_settings_updated();
} }
?> ?>
<div class="postbox"> <div class="postbox">
......
...@@ -377,6 +377,45 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages ...@@ -377,6 +377,45 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages
</form> </form>
</div> </div>
</div> </div>
<div class="postbox closed">
<h3 class="hndle">
<label for="title"><?php _e('Cookie Viewer', 'vivio-swift');?></label><small style="margin-left: 20px;"><?php _e('[Show/Hide]', 'vivio-swift');?></small>
</h3>
<div class="inside">
<form action="" method="POST">
<?php wp_nonce_field('vivio_swift_cookie_viewer_nonce'); ?>
<table class="widefat">
<thead>
<tr>
<th><?php _e('Cookie Name (sanitized)', 'vivio-swift') ?></th>
<!-- <th><?php _e('Delete', 'vivio-swift') ?></th> -->
</tr>
</thead>
<tbody>
<?php
foreach ((array)$_COOKIE as $cookie_key => $cookie_value){
echo '<tr>';
echo '<td class="pattern_cell">' . sanitize_text_field($cookie_key) . "</td>";
//echo '<td class="action_cell"><button name="vivio_swift_delete_cookie" class="pure-button button-error" type="submit"';
//echo 'value="'.sanitize_text_field($cookie_key).'"';
//echo '>';
//echo '<span class="dashicons dashicons-no"></span></button></td>';
echo '</tr>';
}
?>
</tbody>
<tfoot>
<tr>
<th><?php _e('Cookie Name (sanitized)', 'vivio-swift') ?></th>
<!-- <th><?php _e('Delete', 'vivio-swift') ?></th> -->
</tr>
</tfoot>
</table>
</form>
</div>
</div>
</div> </div>
<?php <?php
} }
...@@ -646,7 +685,7 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages ...@@ -646,7 +685,7 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages
id="vivio_swift_path_is_value" id="vivio_swift_path_is_value"
name="vivio_swift_path_is_value" name="vivio_swift_path_is_value"
value="" value=""
/>/ />
<button type="submit" name="vivio_swift_add_path_is">Add</button> <button type="submit" name="vivio_swift_add_path_is">Add</button>
<span class="description"><?php _e('A URL whos path is this value will not use cache.', 'vivio-swift'); ?></span> <span class="description"><?php _e('A URL whos path is this value will not use cache.', 'vivio-swift'); ?></span>
</td> </td>
...@@ -813,6 +852,7 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages ...@@ -813,6 +852,7 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages
<tr valign="top"> <tr valign="top">
<th scope="row"><?php _e('Add New', 'vivio-swift')?>:</th> <th scope="row"><?php _e('Add New', 'vivio-swift')?>:</th>
<td> <td>
<?php echo get_bloginfo('wpurl').'/*filename' ?>
<input type="text" size="10" <input type="text" size="10"
id="vivio_swift_path_ends_with_value" id="vivio_swift_path_ends_with_value"
name="vivio_swift_path_ends_with_value" name="vivio_swift_path_ends_with_value"
...@@ -822,7 +862,6 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages ...@@ -822,7 +862,6 @@ class Vivio_Swift_Exclusions_Menu extends Vivio_Swift_Admin_Messages
<span class="description"><?php _e('A URL whos path is this value will not use cache.', 'vivio-swift'); ?></span> <span class="description"><?php _e('A URL whos path is this value will not use cache.', 'vivio-swift'); ?></span>
</td> </td>
</tr> </tr>
</table> </table>
<table class="widefat"> <table class="widefat">
<thead> <thead>
......
...@@ -3,7 +3,7 @@ class Vivio_Swift_Cache_Preload ...@@ -3,7 +3,7 @@ class Vivio_Swift_Cache_Preload
{ {
function __construct() function __construct()
{ {
add_action('vivio_swift_schedule_preload_cache', array(&$this, 'schedule_create_preload_cache')); //add_action('vivio_swift_schedule_preload_cache', array(&$this, 'schedule_create_preload_cache'));
} }
function enable() function enable()
...@@ -196,12 +196,14 @@ class Vivio_Swift_Cache_Preload ...@@ -196,12 +196,14 @@ class Vivio_Swift_Cache_Preload
// scheduled task for Vivio_Swift_Cron() // scheduled task for Vivio_Swift_Cron()
function schedule_create_preload_cache() function schedule_create_preload_cache()
{ {
/*
global $vivio_swift_global; global $vivio_swift_global;
$vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Preload::schedule_create_preload_cache() - running scheduled preload cache...", 2); $vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Preload::schedule_create_preload_cache() - running scheduled preload cache...", 2);
$preload_enabled = ($vivio_swift_global->configs->get_value('vivio_swift_preload_cache_enabled')=='1')?true:false; $preload_enabled = ($vivio_swift_global->configs->get_value('vivio_swift_preload_cache_enabled')=='1')?true:false;
if ($preload_enabled){ if ($preload_enabled){
$vivio_swift_global->cache_obj->create_preload_cache(1); $vivio_swift_global->cache_obj->create_preload_cache(1);
} }
*/
} }
} }
\ No newline at end of file
...@@ -29,7 +29,7 @@ class Vivio_Swift_Config_Settings ...@@ -29,7 +29,7 @@ class Vivio_Swift_Config_Settings
$vivio_swift_global->configs->add_value('vivio_swift_preload_last_run_date',''); $vivio_swift_global->configs->add_value('vivio_swift_preload_last_run_date','');
// htaccess rules // htaccess rules
$vivio_swift_global->configs->add_value('vivio_swift_place_custom_rules_at_top','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_custom_rules_at_top','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_posts','1');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_posts','1');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_query_strings','1');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_query_strings','1');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_cookie_contains','1');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_cookie_contains','1');//Checkbox
...@@ -39,18 +39,23 @@ class Vivio_Swift_Config_Settings ...@@ -39,18 +39,23 @@ class Vivio_Swift_Config_Settings
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_is','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_is','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_is_values',array());//array list $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_is_values',array());//array list
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_ends_with','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_ends_with','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_ends_with_values',array('.html','.png','.jpg','.jpeg','.gif','.xml','.json'));//array list $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_ends_with_values',array('.html','.png','.jpg','.jpeg','.gif','.ico','.svg','.xml','.json'));//array list
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_contains','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_contains','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_contains_values',array());//array list $vivio_swift_global->configs->add_value('vivio_swift_cache_exclude_path_contains_values',array());//array list
$vivio_swift_global->configs->add_value('vivio_swift_cache_enable_custom_rules','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_cache_enable_custom_rules','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_custom_rules_values',array());//array list $vivio_swift_global->configs->add_value('vivio_swift_cache_custom_rules_values',array());//array list
// htaccess cache-control
$vivio_swift_global->configs->add_value('vivio_swift_cache_control_headers_enable','0');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_cache_control_headers_values',Vivio_Swift_Config_Settings::default_cache_control_groups());
// Compression options // Compression options
$vivio_swift_global->configs->add_value('vivio_swift_minify_css','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_compress_minify_css','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_minify_js','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_compress_minify_js','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_minify_html','');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_compress_minify_html','');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_combine_css','1');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_compress_combine_css','1');//Checkbox
$vivio_swift_global->configs->add_value('vivio_swift_combine_js','1');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_compress_combine_js','1');//Checkbox
// refresh events // refresh events
$vivio_swift_global->configs->add_value('vivio_swift_refresh_on_post_new','1');//Checkbox $vivio_swift_global->configs->add_value('vivio_swift_refresh_on_post_new','1');//Checkbox
...@@ -87,7 +92,7 @@ class Vivio_Swift_Config_Settings ...@@ -87,7 +92,7 @@ class Vivio_Swift_Config_Settings
$vivio_swift_global->configs->set_value('vivio_swift_preload_last_run_date',''); $vivio_swift_global->configs->set_value('vivio_swift_preload_last_run_date','');
//htaccess rules //htaccess rules
$vivio_swift_global->configs->set_value('vivio_swift_place_custom_rules_at_top','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_custom_rules_at_top','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_posts','1');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_posts','1');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_query_strings','1');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_query_strings','1');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_cookie_contains','1');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_cookie_contains','1');//Checkbox
...@@ -97,18 +102,22 @@ class Vivio_Swift_Config_Settings ...@@ -97,18 +102,22 @@ class Vivio_Swift_Config_Settings
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_is','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_is','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_is_values',array());//array list $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_is_values',array());//array list
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with_values',array('.html','.png','.jpg','.jpeg','.gif','.xml','.json'));//array list $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with_values',array('.html','.png','.jpg','.jpeg','.gif','.ico','.svg','.xml','.json'));//array list
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains_values',array());//array list $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains_values',array());//array list
$vivio_swift_global->configs->set_value('vivio_swift_cache_enable_custom_rules','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_cache_enable_custom_rules','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_custom_rules_values',array());//array list $vivio_swift_global->configs->set_value('vivio_swift_cache_custom_rules_values',array());//array list
// htaccess cache-control
$vivio_swift_global->configs->set_value('vivio_swift_cache_control_headers_enable','0');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_cache_control_headers_values',Vivio_Swift_Config_Settings::default_cache_control_groups());
// Compression options // Compression options
$vivio_swift_global->configs->set_value('vivio_swift_minify_css','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_compress_minify_css','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_minify_js','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_compress_minify_js','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_minify_html','');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_compress_minify_html','');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_combine_css','1');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_compress_combine_css','1');//Checkbox
$vivio_swift_global->configs->set_value('vivio_swift_combine_js','1');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_compress_combine_js','1');//Checkbox
// refresh events // refresh events
$vivio_swift_global->configs->set_value('vivio_swift_refresh_on_post_new','1');//Checkbox $vivio_swift_global->configs->set_value('vivio_swift_refresh_on_post_new','1');//Checkbox
...@@ -120,4 +129,31 @@ class Vivio_Swift_Config_Settings ...@@ -120,4 +129,31 @@ class Vivio_Swift_Config_Settings
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
} }
static function default_cache_control_groups()
{
$groups = array(
0 => [ 'name' => 'Image Files',
'max-age' => '2419200', // 1 month
'enable-cache' => '1',
'extensions' => array('png','jpg','jpeg','gif','ico','svg')
],
1 => [ 'name' => 'Static Files',
'max-age' => '604800', // 1 week
'enable-cache' => '1',
'extensions' => array('css','js','pdf','txt','csv')
],
2 => [ 'name' => 'HTML Files',
'max-age' => '86400', // 1 day
'enable-cache' => '1',
'extensions' => array('html','htm')
],
3 => [ 'name' => 'Dynamic Files',
'max-age' => '0', // no cache
'enable-cache' => '0',
'extensions' => array('php')
]
);
return $groups;
}
} }
\ No newline at end of file
...@@ -73,9 +73,14 @@ class Vivio_Swift_Logger ...@@ -73,9 +73,14 @@ class Vivio_Swift_Logger
{ {
if(empty($file_name))$file_name = $this->default_log_file; if(empty($file_name))$file_name = $this->default_log_file;
$debug_log_file = $this->log_folder_path.'/'.$file_name; $debug_log_file = $this->log_folder_path.'/'.$file_name;
$fp=fopen($debug_log_file,'a'); if (is_writeable($debug_log_file)){
fwrite($fp, $content); $fp=fopen($debug_log_file,'a');
fclose($fp); fwrite($fp, $content);
fclose($fp);
return true;
} else {
return false;
}
} }
function reset_log_file($file_name='') function reset_log_file($file_name='')
...@@ -85,9 +90,14 @@ class Vivio_Swift_Logger ...@@ -85,9 +90,14 @@ class Vivio_Swift_Logger
if($file_name=='2')$file_name = $this->default_log_file_cron; if($file_name=='2')$file_name = $this->default_log_file_cron;
$debug_log_file = $this->log_folder_path.'/'.$file_name; $debug_log_file = $this->log_folder_path.'/'.$file_name;
$content = $this->get_debug_timestamp().$this->log_reset_marker; $content = $this->get_debug_timestamp().$this->log_reset_marker;
$fp=fopen($debug_log_file,'w'); if (is_writeable($debug_log_file)){
fwrite($fp, $content); $fp=fopen($debug_log_file,'w');
fclose($fp); fwrite($fp, $content);
fclose($fp);
return true;
} else {
return false;
}
} }