Commit ca0c07a8 authored by Jordan Michaels's avatar Jordan Michaels

Release 2018021901 - Issues 8,9

parent 0b70f998
...@@ -7,3 +7,13 @@ Versions are recorded in YYYYMMDDnn format. Please include latest versions at th ...@@ -7,3 +7,13 @@ Versions are recorded in YYYYMMDDnn format. Please include latest versions at th
## 2018011901 ## 2018011901
* Initial alpha release for internal testing of caching system. * Initial alpha release for internal testing of caching system.
## 2018021301
* [NEW] Update Vivio-Swift HTML footer message to state if page was not cached due to exclude rule - Issue 1
* [NEW] Added and updated refresh events for pages, tags, and categories - Issue 6
* [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
## 2018021901
* [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
# [Vivio Swift](https://code.viviotech.net/jordan/vivio-swift) # [Vivio Swift](https://code.viviotech.net/jordan/vivio-swift)
The Vivio Swift WordPress plugin alpha release provides a comprehensive page caching system that completely bypasses PHP using .htaccess files. The primary goal of this release is to demonstrate and test the page caching systems, exclusion system, logging features, and refresh events. The Vivio Swift WordPress plugin (beta) provides a comprehensive page caching system that completely bypasses PHP using .htaccess files. The primary goal of this realease is to demonstrate and test the page caching systems, exclusion system, logging features, and refresh events.
## Page Caching ## Page Caching
...@@ -31,13 +31,13 @@ The Vivio Swift WordPress plugin alpha release provides a comprehensive page cac ...@@ -31,13 +31,13 @@ The Vivio Swift WordPress plugin alpha release provides a comprehensive page cac
## Planned Features ## Planned Features
* Image compression using GD or Vivio service
* CSS minification (compression) * CSS minification (compression)
* JS minification (compression) * JS minification (compression)
* 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
* Image compression using GD or Vivio service
# Installation # Installation
......
No preview for this file type
...@@ -5,14 +5,21 @@ abstract class Vivio_Swift_Admin_Messages ...@@ -5,14 +5,21 @@ abstract class Vivio_Swift_Admin_Messages
function show_msg_settings_updated() function show_msg_settings_updated()
{ {
echo '<div id="message" class="updated fade"><p><strong>'; echo '<div id="message" class="updated fade"><p><strong>';
_e('Settings successfully updated.','all-in-one-wp-security-and-firewall'); _e('Settings successfully updated.','vivio-swift');
echo '</strong></p></div>';
}
static function show_msg_preload_scheduled()
{
echo '<div id="message" class="updated fade"><p><strong>';
_e('New preload cache process has been scheduled...','vivio-swift');
echo '</strong></p></div>'; echo '</strong></p></div>';
} }
static function show_msg_record_deleted_st() static function show_msg_record_deleted_st()
{ {
echo '<div id="message" class="updated fade"><p><strong>'; echo '<div id="message" class="updated fade"><p><strong>';
_e('The selected record(s) deleted successfully!','all-in-one-wp-security-and-firewall'); _e('The selected record(s) deleted successfully!','vivio-swift');
echo '</strong></p></div>'; echo '</strong></p></div>';
} }
......
...@@ -98,9 +98,9 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -98,9 +98,9 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
// set and save settings // set and save settings
if (isset($_POST["vivio_swift_cache_enabled"])){ if (isset($_POST["vivio_swift_cache_enabled"])){
Vivio_Swift_Cache_OnAccess::enable(); $vivio_swift_global->cache_obj->cache_onaccess->enable();
} else { } else {
Vivio_Swift_Cache_OnAccess::disable(); $vivio_swift_global->cache_obj->cache_onaccess->disable();
} }
...@@ -109,7 +109,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -109,7 +109,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
if (isset($_POST['vivio_swift_cache_clear_submit'])) if (isset($_POST['vivio_swift_cache_clear_submit']))
{ {
Vivio_Swift_Cache_OnAccess::clear(); $vivio_swift_global->cache_obj->cache_onaccess->clear();
$this->show_msg_settings_updated(); $this->show_msg_settings_updated();
} }
...@@ -157,7 +157,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -157,7 +157,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
<tr valign="top"> <tr valign="top">
<th scope="row"><?php _e('Current Cache', 'vivio-swift')?>:</th> <th scope="row"><?php _e('Current Cache', 'vivio-swift')?>:</th>
<td> <td>
<span class="description"><?php echo Vivio_Swift_Utility_File::get_file_count().' Files ('.Vivio_Swift_Utility_File::get_directory_size().')'; ?></span> <span class="description"><?php echo $vivio_swift_global->util_file->get_file_count().' Files ('.$vivio_swift_global->util_file->get_directory_size().')'; ?></span>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -179,7 +179,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -179,7 +179,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
if (isset($_POST['vivio_swift_cache_clear_submit'])) if (isset($_POST['vivio_swift_cache_clear_submit']))
{ {
Vivio_Swift_Cache_Preload::clear(); $vivio_swift_global->cache_obj->cache_preload->clear();
$this->show_msg_settings_updated(); $this->show_msg_settings_updated();
} }
...@@ -190,15 +190,12 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -190,15 +190,12 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
// if preload is enabled, calc the expiration date // if preload is enabled, calc the expiration date
if (($preload_cache_enabled=='1') && ($preload_last_run_date!='')){ if (($preload_cache_enabled=='1') && ($preload_last_run_date!='')){
$cache_expires_in_txt = Vivio_Swift_Utility_Date::format_interval($preload_last_run_datetime); $cache_expires_in_txt = $vivio_swift_global->util_date->format_interval($preload_last_run_datetime);
} else { } else {
$cache_expires_in_txt = "No Preload Cache on record."; $cache_expires_in_txt = "No Preload Cache on record.";
} }
if ( if (isset($_POST['vivio_swift_save_preload_cache_settings']))
isset($_POST['vivio_swift_save_preload_cache_settings']) ||
isset($_POST['vivio_swift_preload_force_refresh'])
)
{ {
$error = ''; $error = '';
...@@ -209,11 +206,6 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -209,11 +206,6 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
wp_die("Error: Nonce check failed in preload settings."); wp_die("Error: Nonce check failed in preload settings.");
} }
if (isset($_POST['vivio_swift_preload_force_refresh'])){
// force a preload cache refresh
$vivio_swift_global->cache_obj->cache_preload->create_preload_cache(1);
}
$vivio_swift_preload_cache_expire_hours_val = sanitize_text_field($_POST['vivio_swift_preload_cache_expire_hours']); $vivio_swift_preload_cache_expire_hours_val = sanitize_text_field($_POST['vivio_swift_preload_cache_expire_hours']);
if(!is_numeric($vivio_swift_preload_cache_expire_hours_val)) if(!is_numeric($vivio_swift_preload_cache_expire_hours_val))
{ {
...@@ -232,9 +224,9 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -232,9 +224,9 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
// set and save settings // set and save settings
if (isset($_POST["vivio_swift_preload_cache_enabled"])){ if (isset($_POST["vivio_swift_preload_cache_enabled"])){
Vivio_Swift_Cache_Preload::enable(); $vivio_swift_global->cache_obj->cache_preload->enable();
} else { } else {
Vivio_Swift_Cache_Preload::disable(); $vivio_swift_global->cache_obj->cache_preload->disable();
} }
$vivio_swift_global->configs->set_value('vivio_swift_preload_cache_expire_hours',absint($vivio_swift_preload_cache_expire_hours_val)); $vivio_swift_global->configs->set_value('vivio_swift_preload_cache_expire_hours',absint($vivio_swift_preload_cache_expire_hours_val));
...@@ -243,6 +235,22 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -243,6 +235,22 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
$this->show_msg_settings_updated(); $this->show_msg_settings_updated();
} }
if (isset($_POST['vivio_swift_preload_force_refresh']))
{
// verify nonce
$nonce = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce, 'vivio_swift_preload_cache_nonce')) {
$vivio_swift_global->debug_logger->log_debug("Nonce check failed in preload settings.", 4);
wp_die("Error: Nonce check failed in preload settings.");
}
if (isset($_POST['vivio_swift_preload_force_refresh'])){
// force a preload cache refresh
$vivio_swift_global->cache_obj->cache_preload->create_preload_cache(1);
$this->show_msg_preload_scheduled();
}
}
?> ?>
<div id="vivio-swift-container"> <div id="vivio-swift-container">
...@@ -310,7 +318,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages ...@@ -310,7 +318,7 @@ class Vivio_Swift_Cache_Menu extends Vivio_Swift_Admin_Messages
<tr valign="top"> <tr valign="top">
<th scope="row"><?php _e('Current Cache', 'vivio-swift')?>:</th> <th scope="row"><?php _e('Current Cache', 'vivio-swift')?>:</th>
<td> <td>
<span class="description"><?php echo Vivio_Swift_Utility_File::get_file_count().' Files ('.Vivio_Swift_Utility_File::get_directory_size().')'; ?></span> <span class="description"><?php echo $vivio_swift_global->util_file->get_file_count().' Files ('.$vivio_swift_global->util_file->get_directory_size().')'; ?></span>
</td> </td>
</tr> </tr>
</table> </table>
......
...@@ -92,7 +92,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -92,7 +92,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
// if preload is enabled, calc the expiration date // if preload is enabled, calc the expiration date
if (($preload_cache_enabled=='1') && ($preload_last_run_date!='')){ if (($preload_cache_enabled=='1') && ($preload_last_run_date!='')){
$cache_expires_in_txt = Vivio_Swift_Utility_Date::format_interval($preload_last_run_datetime); $cache_expires_in_txt = $vivio_swift_global->util_date->format_interval($preload_last_run_datetime);
} else { } else {
$cache_expires_in_txt = "No Preload Cache on record."; $cache_expires_in_txt = "No Preload Cache on record.";
} }
...@@ -106,7 +106,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -106,7 +106,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
wp_die("Error: Nonce check failed when attempting to clear cache."); wp_die("Error: Nonce check failed when attempting to clear cache.");
} }
Vivio_Swift_Cache_Preload::clear(); $vivio_swift_global->cache_obj->cache_preload->clear();
$this->show_msg_settings_updated(); $this->show_msg_settings_updated();
} }
...@@ -120,6 +120,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -120,6 +120,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
// force a preload cache refresh // force a preload cache refresh
$vivio_swift_global->cache_obj->cache_preload->create_preload_cache(1); $vivio_swift_global->cache_obj->cache_preload->create_preload_cache(1);
$this->show_msg_preload_scheduled();
} }
if (isset($_POST['vivio_swift_cache_dashboard_submit'])) if (isset($_POST['vivio_swift_cache_dashboard_submit']))
...@@ -195,7 +196,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -195,7 +196,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
<tr valign="top"> <tr valign="top">
<th scope="row"><?php _e('Current Cache', 'vivio-swift')?>:</th> <th scope="row"><?php _e('Current Cache', 'vivio-swift')?>:</th>
<td> <td>
<span class="description"><?php echo Vivio_Swift_Utility_File::get_file_count().' Files ('.Vivio_Swift_Utility_File::get_directory_size().')'; ?></span> <span class="description"><?php echo $vivio_swift_global->util_file->get_file_count().' Files ('.$vivio_swift_global->util_file->get_directory_size().')'; ?></span>
</td> </td>
</tr> </tr>
</table> </table>
...@@ -621,64 +622,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -621,64 +622,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
</div> </div>
</div> </div>
<?php /*
<!-- view logs option -->
<div class="postbox">
<h3 class="hndle">
<label for="title"><?php _e('View Logs for the Vivio Swift Plugin', 'vivio-swift');?></label>
</h3>
<div class="inside">
<form action=""
id="vivio_swift_dashboard_logs"
method="POST">
<?php wp_nonce_field('vivio-swift-logs-nonce'); ?>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php _e('Log File', 'vivio-swift')?>:</th>
<td>
<select id="vivio_swift_log_file" name="vivio_swift_log_file">
<option
value=""><?php _e('--Select a file--', 'vivio-swift')?></option>
<option
value="vivio-swift-log.txt" <?php selected($file_selected, 'vivio-swift-log.txt'); ?>>
vivio-swift-log
</option>
<option
value="vivio-swift-log-cron-job.txt" <?php selected($file_selected, 'vivio-swift-log-cron-job.txt'); ?>>
vivio-swift-log-cron-job
</option>
</select>
<span class="description"><?php _e('Select one of the log files to view the contents', 'vivio-swift'); ?></span>
</td>
</tr>
</table>
<input type="submit" name="vivio_swift_view_logs"
value="<?php _e('View Logs', 'vivio-swift')?>"
class="pure-button"/>
</form>
</div>
</div>
?>
<?php <?php
if (isset($_POST['vivio_swift_view_logs']) && $file_selected)//Do form submission tasks
{
//Check nonce before doing anything
$nonce = $_REQUEST['_wpnonce'];
if (!wp_verify_nonce($nonce, 'vivio-swift-logs-nonce')) {
$vivio_swift_global->debug_logger->log_debug("Nonce check failed while attempting to view logs.", 4);
wp_die("Error: Nonce check failed while attempting to view logs.");
}
//Let's make sure that the file selected can only ever be the correct log file of this plugin.
$vivio_swift_valid_log_files = array('vivio-swift-log.txt', 'vivio-swift-log-cron-job.txt');
if(!in_array($file_selected, $vivio_swift_valid_log_files)){
$file_selected = '';
unset($_POST['vivio_swift_view_logs']);
wp_die(__('Error: The selected file is not a Vivio Swift log file.','vivio-swift'));
}
*/
if (!empty($file_selected)) { if (!empty($file_selected)) {
?> ?>
<div class="postbox"> <div class="postbox">
...@@ -691,7 +635,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -691,7 +635,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
$vivio_swift_log_dir = VIVIO_SWIFT_PATH . '/logs'; $vivio_swift_log_dir = VIVIO_SWIFT_PATH . '/logs';
$log_file = $vivio_swift_log_dir . '/' . $file_selected; $log_file = $vivio_swift_log_dir . '/' . $file_selected;
if (file_exists($log_file)) { if (file_exists($log_file)) {
$log_contents = Vivio_Swift_Utility_File::get_file_contents($log_file); $log_contents = $vivio_swift_global->util_file->get_file_contents($log_file);
} else { } else {
$log_contents = ''; $log_contents = '';
} }
...@@ -712,11 +656,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -712,11 +656,8 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
</form> </form>
</div> </div>
</div> </div>
<?php <?php
} }
// }
} }
function render_tab4() function render_tab4()
...@@ -806,7 +747,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -806,7 +747,7 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
<div class="inside"> <div class="inside">
<textarea class="text_area_file_output width_full margin_10_0" rows="20" readonly><?php <textarea class="text_area_file_output width_full margin_10_0" rows="20" readonly><?php
$htaccess_contents = Vivio_Swift_Utility_Htaccess::display_htaccess(); $htaccess_contents = $vivio_swift_global->util_htaccess->display_htaccess();
if (empty($htaccess_contents)){ if (empty($htaccess_contents)){
echo __('Vivio Swift has nothing to write to .htaccess', 'vivio-swift'); echo __('Vivio Swift has nothing to write to .htaccess', 'vivio-swift');
...@@ -842,14 +783,16 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages ...@@ -842,14 +783,16 @@ class Vivio_Swift_Dashboard_Menu extends Vivio_Swift_Admin_Messages
// reset options // reset options
Vivio_Swift_Config_Settings::reset_to_defaults(); Vivio_Swift_Config_Settings::reset_to_defaults();
// clear cache directory // clear cache directory
Vivio_Swift_Utility_File::clear_cache_dir(); $vivio_swift_global->util_file->clear_cache_dir();
// reset .htaccess // reset .htaccess
Vivio_Swift_Utility_Htaccess::delete_from_htaccess(); $vivio_swift_global->util_htaccess->delete_from_htaccess();
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
// reset logs // reset logs
$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;
if ($preload_enabled){wp_schedule_single_event(time(), 'vivio_swift_schedule_preload_cache');}
$this->show_msg_settings_updated(); $this->show_msg_settings_updated();
} }
......
...@@ -27,12 +27,14 @@ class Vivio_Swift_Activator{ ...@@ -27,12 +27,14 @@ class Vivio_Swift_Activator{
// configure cron handlers // configure cron handlers
/*
if ( !wp_next_scheduled('vivio_swift_hourly_cron_event') ) { if ( !wp_next_scheduled('vivio_swift_hourly_cron_event') ) {
wp_schedule_event(time(), 'hourly', 'vivio_swift_hourly_cron_event'); //schedule an hourly cron event wp_schedule_event(time(), 'hourly', 'vivio_swift_hourly_cron_event'); //schedule an hourly cron event
} }
if ( !wp_next_scheduled('vivio_swift_daily_cron_event') ) { if ( !wp_next_scheduled('vivio_swift_daily_cron_event') ) {
wp_schedule_event(time(), 'daily', 'vivio_swift_daily_cron_event'); //schedule an daily cron event wp_schedule_event(time(), 'daily', 'vivio_swift_daily_cron_event'); //schedule an daily cron event
} }
*/
} }
} }
...@@ -4,7 +4,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -4,7 +4,7 @@ class Vivio_Swift_Cache_Excludes
function __construct() function __construct()
{ {
global $vivio_swift_global;
} }
function get_cookie_values() function get_cookie_values()
...@@ -25,7 +25,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -25,7 +25,7 @@ class Vivio_Swift_Cache_Excludes
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_cookie_values',array_values($arr_cookie_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_cookie_values',array_values($arr_cookie_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
} }
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
function remove_cookie_value($val) function remove_cookie_value($val)
...@@ -38,8 +38,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -38,8 +38,7 @@ class Vivio_Swift_Cache_Excludes
} }
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_cookie_values',array_values($arr_cookie_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_cookie_values',array_values($arr_cookie_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess(); }
}
//returns true if passed cookie value is listed in required cookie exclusions //returns true if passed cookie value is listed in required cookie exclusions
function cookie_check_required_value($val) function cookie_check_required_value($val)
...@@ -69,7 +68,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -69,7 +68,7 @@ class Vivio_Swift_Cache_Excludes
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_user_agent_values',array_values($arr_user_agent_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_user_agent_values',array_values($arr_user_agent_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
} }
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
function remove_user_agent_value($val) function remove_user_agent_value($val)
...@@ -82,7 +81,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -82,7 +81,7 @@ class Vivio_Swift_Cache_Excludes
} }
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_user_agent_values',array_values($arr_user_agent_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_user_agent_values',array_values($arr_user_agent_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
//returns true if passed user_agent value is listed in required user_agent exclusions //returns true if passed user_agent value is listed in required user_agent exclusions
...@@ -115,7 +114,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -115,7 +114,7 @@ class Vivio_Swift_Cache_Excludes
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
} }
$vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Excludes::add_path_is_value() - writing .htaccess file...", 1); $vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Excludes::add_path_is_value() - writing .htaccess file...", 1);
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
function remove_path_is_value($val) function remove_path_is_value($val)
...@@ -132,7 +131,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -132,7 +131,7 @@ class Vivio_Swift_Cache_Excludes
} }
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_is_values',array_values($arr_path_is_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_is_values',array_values($arr_path_is_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
function get_path_ends_with_values() function get_path_ends_with_values()
...@@ -153,7 +152,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -153,7 +152,7 @@ class Vivio_Swift_Cache_Excludes
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with_values',array_values($arr_path_ends_with_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with_values',array_values($arr_path_ends_with_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
} }
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
function remove_path_ends_with_value($val) function remove_path_ends_with_value($val)
...@@ -170,7 +169,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -170,7 +169,7 @@ class Vivio_Swift_Cache_Excludes
} }
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with_values',array_values($arr_path_ends_with_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_ends_with_values',array_values($arr_path_ends_with_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
function get_path_contains_values() function get_path_contains_values()
...@@ -191,7 +190,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -191,7 +190,7 @@ class Vivio_Swift_Cache_Excludes
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains_values',array_values($arr_path_contains_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains_values',array_values($arr_path_contains_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
} }
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
function remove_path_contains_value($val) function remove_path_contains_value($val)
...@@ -208,7 +207,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -208,7 +207,7 @@ class Vivio_Swift_Cache_Excludes
} }
$vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains_values',array_values($arr_path_contains_values)); $vivio_swift_global->configs->set_value('vivio_swift_cache_exclude_path_contains_values',array_values($arr_path_contains_values));
$vivio_swift_global->configs->save_config(); $vivio_swift_global->configs->save_config();
Vivio_Swift_Utility_Htaccess::write_to_htaccess(); $vivio_swift_global->util_htaccess->write_to_htaccess();
} }
// returns error message is condition is hit. otherwise simply returns false. // returns error message is condition is hit. otherwise simply returns false.
...@@ -245,7 +244,7 @@ class Vivio_Swift_Cache_Excludes ...@@ -245,7 +244,7 @@ class Vivio_Swift_Cache_Excludes
// cookie excludes // cookie excludes
// forced refreshes do not need to process cookies // forced refreshes do not need to process cookies
if(!$force){ if(!$force){
$arr_cookie_values=Vivio_Swift_Cache_Excludes::get_cookie_values(); $arr_cookie_values=$vivio_swift_global->cache_obj->cache_excludes->get_cookie_values();
foreach ($arr_cookie_values as $i => $value) { foreach ($arr_cookie_values as $i => $value) {
foreach ((array)$_COOKIE as $cookie_key => $cookie_value){ foreach ((array)$_COOKIE as $cookie_key => $cookie_value){
$searchval='/'.$value.'/i';