Skip to content

Commit

Permalink
Merge branch 'release/140926'
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Oct 2, 2014
2 parents 5fbf799 + c1a7bfd commit 9f00a51
Show file tree
Hide file tree
Showing 11 changed files with 837 additions and 437 deletions.
Binary file added assets/icon-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/icon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
314 changes: 314 additions & 0 deletions quick-cache/CHANGELOG

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions quick-cache/includes/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ public function save_options($args)
$args = array_map('trim', stripslashes_deep((array)$args));
if(isset($args['base_dir'])) // No leading/trailing slashes please.
$args['base_dir'] = trim($args['base_dir'], '\\/'." \t\n\r\0\x0B");

$this->plugin->options = array_merge($this->plugin->default_options, $args);
$this->plugin->options = array_intersect_key($this->plugin->options, $this->plugin->default_options);

if(!trim($this->plugin->options['base_dir'], '\\/'." \t\n\r\0\x0B") // Empty?
|| strpos(basename($this->plugin->options['base_dir']), 'wp-') === 0 // Reserved?
Expand Down
14 changes: 12 additions & 2 deletions quick-cache/includes/menu-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ public function options()
echo ' <option value="1">'.__('Yes, if any single Post/Page is purged/reset; also purge any associated custom Term archive views.', $this->plugin->text_domain).'</option>'."\n";
echo ' <option value="0" selected="selected">'.__('No, my site doesn\'t use any custom Terms and/or I don\'t have any custom Term archive views.', $this->plugin->text_domain).'</option>'."\n";
echo ' </select></p>'."\n";
echo ' <h3>'.__('Auto-Purge "Custom Post Type Archives" Too?', $this->plugin->text_domain).'</h3>'."\n";
echo ' <p>'.__('Most sites do not use any Custom Post Types so it should be safe to disable this option. However, if your site uses Custom Post Types and they have their own Custom Post Type archive views, you may want to clear those when any associated post is cleared. Therefore, if a single Post with a Custom Post Type is changed in some way; and Quick Cache purges/resets the cache for that post, would you like Quick Cache to also purge any existing cache files for the associated Custom Post Type archive views?', $this->plugin->text_domain).'</p>'."\n";
echo ' <p><select name="'.esc_attr(__NAMESPACE__).'[save_options][cache_purge_custom_post_type_enable]">'."\n";
echo ' <option value="1" selected="selected">'.__('Yes, if any single Post with a Custom Post Type is purged/reset; also purge any associated Custom Post Type archive views.', $this->plugin->text_domain).'</option>'."\n";
echo ' <option value="0">'.__('No, my site doesn\'t use any Custom Post Types and/or I don\'t have any Custom Post Type archive views.', $this->plugin->text_domain).'</option>'."\n";
echo ' </select></p>'."\n";
echo ' </div>'."\n";

echo '</div>'."\n";
Expand All @@ -243,7 +249,7 @@ public function options()
echo ' <div class="plugin-menu-page-panel-body clearfix">'."\n";
echo ' <h3>'.__('Base Cache Directory (Must be Writable; e.g. <a href="http://codex.wordpress.org/Changing_File_Permissions" target="_blank">Permissions</a> <code>755</code> or Higher)', $this->plugin->text_domain).'</h3>'."\n";
echo ' <p>'.__('This is where Quick Cache will store the cached version of your site. If you\'re not sure how to deal with directory permissions, don\'t worry too much about this. If there is a problem, Quick Cache will let you know about it. By default, this directory is created by Quick Cache and the permissions are setup automatically. In most cases there is nothing more you need to do.', $this->plugin->text_domain).'</p>'."\n";
echo ' <table style="width:100%;"><tr><td style="width:1px; font-weight:bold; white-space:nowrap;">'.esc_html(WP_CONTENT_DIR).'</td><td><input type="text" name="'.esc_attr(__NAMESPACE__).'[save_options][base_dir]" value="'.esc_attr($this->plugin->options['base_dir']).'" /></td><td style="width:1px; font-weight:bold; white-space:nowrap;">/</td></tr></table>'."\n";
echo ' <table style="width:100%;"><tr><td style="width:1px; font-weight:bold; white-space:nowrap;">'.esc_html(WP_CONTENT_DIR).'/</td><td><input type="text" name="'.esc_attr(__NAMESPACE__).'[save_options][base_dir]" value="'.esc_attr($this->plugin->options['base_dir']).'" /></td><td style="width:1px; font-weight:bold; white-space:nowrap;">/</td></tr></table>'."\n";
echo ' <hr />'."\n";
echo ' <i class="fa fa-clock-o fa-4x" style="float:right; margin: 0 0 0 25px;"></i>'."\n";
echo ' <h3>'.__('Automatic Expiration Time (Max Age)', $this->plugin->text_domain).'</h3>'."\n";
Expand Down Expand Up @@ -444,8 +450,12 @@ public function options()
echo ' <h3>'.__('A List of URLs to Auto-Cache (One Per Line)', $this->plugin->text_domain).'</h3>'."\n";
echo ' <p><textarea name="'.esc_attr(__NAMESPACE__).'[save_options][auto_cache_other_urls]" rows="5" spellcheck="false" class="monospace"></textarea></p>'."\n";
echo ' <hr />'."\n";
echo ' <h3>'.__('Auto-Cache Delay Timer (in Milliseconds)', $this->plugin->text_domain).'</h3>'."\n";
echo ' <p>'.__('As the Auto-Cache Engine runs through each URL, you can tell it to wait X number of milliseconds between each connection that it makes. It is strongly suggested that you DO have some small delay here. Otherwise, you run the risk of hammering your own web server with multiple repeated connections whenever the Auto-Cache Engine is running. This is especially true on very large sites; where there is the potential for hundreds of repeated connections as the Auto-Cache Engine goes through a long list of URLs. Adding a delay between each connection will prevent the Auto-Cache Engine from placing a heavy load on the processor that powers your web server. A value of <code>500</code> milliseconds is suggested here (half a second). If you experience problems, you can bump this up a little at a time, in increments of <code>500</code> milliseconds; until you find a happy place for your server. <em>Please note that <code>1000</code> milliseconds = <code>1</code> full second.</em>', $this->plugin->text_domain).'</p>'."\n";
echo ' <p><input type="text" name="'.esc_attr(__NAMESPACE__).'[save_options][auto_cache_delay]" value="500" /></p>'."\n";
echo ' <hr />'."\n";
echo ' <h3>'.__('Auto-Cache User-Agent String', $this->plugin->text_domain).'</h3>'."\n";
echo ' <table style="width:100%;"><tr><td><input type="text" name="'.esc_attr(__NAMESPACE__).'[save_options][auto_cache_user_agent]" value="" /></td><td style="width:1px; font-weight:bold; white-space:nowrap;">; '.esc_html(__NAMESPACE__.' '.$this->plugin->version).'</td></tr></table>'."\n";
echo ' <table style="width:100%;"><tr><td><input type="text" name="'.esc_attr(__NAMESPACE__).'[save_options][auto_cache_user_agent]" value="WordPress" /></td><td style="width:1px; font-weight:bold; white-space:nowrap;">; '.esc_html(__NAMESPACE__.' '.$this->plugin->version).'</td></tr></table>'."\n";
echo ' <p class="info" style="display:block;">'.__('This is how the Auto-Cache Engine identifies itself when connecting to URLs. See <a href="http://en.wikipedia.org/wiki/User_agent" target="_blank">User Agent</a> in the Wikipedia.', $this->plugin->text_domain).'</p>'."\n";
echo ' </div>'."\n";
echo ' </div>'."\n";
Expand Down
2 changes: 1 addition & 1 deletion quick-cache/includes/share.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class share // Shared between {@link advanced_cache} and {@link plugin}
*
* @var string Current version of the software.
*/
public $version = '140829';
public $version = '141001';

/**
* Text domain for translations; based on `__NAMESPACE__`.
Expand Down
Loading

0 comments on commit 9f00a51

Please sign in to comment.