Skip to content

Commit

Permalink
Merge branch 'release/150227'
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Feb 28, 2015
2 parents 2f6cbae + a5ce1f4 commit 88acfbc
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 56 deletions.
2 changes: 1 addition & 1 deletion quick-cache/includes/actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function save_options($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_merge($this->plugin->default_options, $this->plugin->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?
Expand Down
24 changes: 21 additions & 3 deletions quick-cache/includes/share.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class share // Shared between {@link advanced_cache} and {@link plugin}
*
* @var string Current version of the software.
*/
public $version = '150129';
public $version = '150129.1';

/**
* Plugin slug; based on `__NAMESPACE__`.
Expand Down Expand Up @@ -300,8 +300,26 @@ public function build_cache_path($url, $with_user_token = '', $with_version_salt
}
if(!($flags & $this::CACHE_PATH_NO_PATH))
{
if(isset($url['path'][201])) // Extremely long?
{
$url['_path_tmp'] = '/'; // Initialize tmp path.
foreach(explode('/', $url['path']) as $_path_component)
{
if(!isset($_path_component[0]))
continue; // Empty.

if(isset($_path_component[201]))
$_path_component = 'lpc-'.sha1($_path_component);
$url['_path_tmp'] .= $_path_component.'/';
}
$url['path'] = $url['_path_tmp']; // Shorter components.
unset($_path_component, $url['_path_tmp']); // Housekeeping.

if(isset($url['path'][2001])) // Overall path length is very long?
$url['path'] = '/lp-'.sha1($url['path']).'/';
}
if(!empty($url['path']) && strlen($url['path'] = trim($url['path'], '\\/'." \t\n\r\0\x0B")))
$cache_path .= $url['path'].'/';
$cache_path .= $url['path'].'/'; // Has a path, let's use it :-)
else if(!($flags & $this::CACHE_PATH_NO_PATH_INDEX)) $cache_path .= 'index/';
}
if($this->is_extension_loaded('mbstring') && mb_check_encoding($cache_path, 'UTF-8'))
Expand All @@ -322,7 +340,7 @@ public function build_cache_path($url, $with_user_token = '', $with_version_salt
if($with_version_salt !== '') // Allow a `0` value if desirable.
$cache_path = rtrim($cache_path, '/').'.v/'.str_replace(array('/', '\\'), '-', $with_version_salt).'/';
}
$cache_path = trim(preg_replace('/\/+/', '/', $cache_path), '/');
$cache_path = trim(preg_replace(array('/\/+/', '/\.+/'), array('/', '.'), $cache_path), '/');

if($flags & $this::CACHE_PATH_ALLOW_WILDCARDS) // Allow `*`?
$cache_path = preg_replace('/[^a-z0-9\/.*]/i', '-', $cache_path);
Expand Down
96 changes: 50 additions & 46 deletions quick-cache/includes/translations/quick-cache.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the same license as the Quick Cache package.
msgid ""
msgstr ""
"Project-Id-Version: Quick Cache 150129\n"
"Project-Id-Version: Quick Cache 150129.1\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/quick-cache\n"
"POT-Creation-Date: 2015-01-30 01:26:09+00:00\n"
"POT-Creation-Date: 2015-02-28 19:02:52+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -1036,97 +1036,97 @@ msgstr ""
msgid "Unable to determine cache directory location."
msgstr ""

#: includes/share.php:1507 includes/share.php:1649
#: includes/share.php:1525 includes/share.php:1667
msgid "The `options` property w/ a `cache_max_age` key is not defined in this class."
msgstr ""

#: includes/share.php:1533
#: includes/share.php:1551
msgid "Unable to delete files. Rename failure on directory: `%1$s`."
msgstr ""

#: includes/share.php:1556 includes/share.php:1717 includes/share.php:1823
#: includes/share.php:1574 includes/share.php:1735 includes/share.php:1841
msgid "Unable to delete symlink: `%1$s`."
msgstr ""

#: includes/share.php:1568 includes/share.php:1729 includes/share.php:1831
#: includes/share.php:1586 includes/share.php:1747 includes/share.php:1849
msgid "Unable to delete file: `%1$s`."
msgstr ""

#: includes/share.php:1582 includes/share.php:1743 includes/share.php:1839
#: includes/share.php:1600 includes/share.php:1761 includes/share.php:1857
msgid "Unable to delete dir: `%1$s`."
msgstr ""

#: includes/share.php:1588 includes/share.php:1749 includes/share.php:1845
#: includes/share.php:1606 includes/share.php:1767 includes/share.php:1863
msgid "Unexpected resource type: `%1$s`."
msgstr ""

#: includes/share.php:1594 includes/share.php:1694 includes/share.php:1755
#: includes/share.php:1612 includes/share.php:1712 includes/share.php:1773
msgid "Unable to delete files. Rename failure on tmp directory: `%1$s`."
msgstr ""

#: includes/share.php:1809 includes/share.php:1851
#: includes/share.php:1827 includes/share.php:1869
msgid "Unable to delete all files/dirs. Rename failure on tmp directory: `%1$s`."
msgstr ""

#: includes/share.php:1856
#: includes/share.php:1874
msgid "Unable to delete directory: `%1$s`."
msgstr ""

#: includes/share.php:1891
#: includes/share.php:1909
msgid "Unable to find the wp-config.php file."
msgstr ""

#: includes/share.php:1907
#: includes/share.php:1925
msgid "No writable tmp directory."
msgstr ""

#: includes/share.php:1912
#: includes/share.php:1930
msgid "Unable to obtain an exclusive lock."
msgstr ""

#: includes/share.php:1965
#: includes/share.php:1983
msgid "%1$s file"
msgid_plural "%1$s files"
msgstr[0] ""
msgstr[1] ""

#: includes/share.php:1981
#: includes/share.php:1999
msgid "%1$s directory"
msgid_plural "%1$s directories"
msgstr[0] ""
msgstr[1] ""

#: includes/share.php:1997
#: includes/share.php:2015
msgid "%1$s file/directory"
msgid_plural "%1$s files/directories"
msgstr[0] ""
msgstr[1] ""

#: includes/share.php:2030
#: includes/share.php:2048
msgid "Invalid hook."
msgstr ""

#: includes/version-specific-upgrade.php:68
#: includes/version-specific-upgrade.php:69
msgid "<strong>Quick Cache:</strong> this version is a <strong>complete rewrite</strong> :-) Please review your Quick Cache options carefully!"
msgstr ""

#: includes/version-specific-upgrade.php:78
#: includes/version-specific-upgrade.php:79
msgid "<strong>Quick Cache Feature Notice:</strong> This version of Quick Cache adds new options for Feed caching. Feed caching is now disabled by default. If you wish to enable feed caching, please visit the Quick Cache options panel."
msgstr ""

#: includes/version-specific-upgrade.php:108
#: includes/version-specific-upgrade.php:109
msgid "<strong>Quick Cache Feature Notice:</strong> This version of Quick Cache introduces a new <a href=\"http://www.websharks-inc.com/r/quick-cache-branched-cache-structure-wiki/\" target=\"_blank\">Branched Cache Structure</a> and several other <a href=\"http://www.websharks-inc.com/post/quick-cache-v140605-now-available/\" target=\"_blank\">new features</a>."
msgstr ""

#: includes/version-specific-upgrade.php:132
#: includes/version-specific-upgrade.php:133
msgid "<strong>Quick Cache Notice:</strong> This version of Quick Cache changes the default base directory that it uses, from <code>ABSPATH</code> to <code>WP_CONTENT_DIR</code>. This is for improved compatibility with installations that choose to use a custom <code>WP_CONTENT_DIR</code> location."
msgstr ""

#: includes/version-specific-upgrade.php:133
#: includes/version-specific-upgrade.php:134
msgid "Quick Cache has detected that your previously configured cache directory may have been in conflict with this change. As a result, your Quick Cache configuration has been updated to the new default value; just to keep things running smoothly for you :-). If you would like to review this change, please see: <code>Dashboard ⥱ Quick Cache ⥱ Directory &amp; Expiration Time</code>; where you may customize it further if necessary."
msgstr ""

#: includes/version-specific-upgrade.php:180
#: includes/version-specific-upgrade.php:181
msgid "<strong>Important Quick Cache Announcement:</strong> Quick Cache is changing its name to ZenCache! Read more about this change <a href=\"http://www.websharks-inc.com/post/quick-cache-is-changing-its-name/\" target=\"_blank\">here</a>."
msgstr ""

Expand All @@ -1146,89 +1146,93 @@ msgstr ""
msgid "To remove this message, please deactivate %1$s."
msgstr ""

#: quick-cache.inc.php:391
#: quick-cache.inc.php:375
msgid "<strong>NOTICE:</strong> <a href=\"http://zencache.com/announcing-zencache-formerly-quick-cache/\" target=\"_blank\">Quick Cache is now ZenCache</a>! No further updates will be made to Quick Cache after March 6th, 2015; see <a href=\"http://zencache.com/kb-article/how-to-migrate-from-quick-cache-lite-to-zencache-lite/\" target=\"_blank\">migration instructions</a>."
msgstr ""

#: quick-cache.inc.php:400
msgid "<strong>Quick Cache:</strong> detected a new version of itself. Recompiling w/ latest version... wiping the cache... all done :-)"
msgstr ""

#. #-#-#-#-# quick-cache.pot (Quick Cache 150129) #-#-#-#-#
#. #-#-#-#-# quick-cache.pot (Quick Cache 150129.1) #-#-#-#-#
#. Plugin Name of the plugin/theme
#: quick-cache.inc.php:551 quick-cache.inc.php:567
#: quick-cache.inc.php:560 quick-cache.inc.php:576
msgid "Quick Cache"
msgstr ""

#: quick-cache.inc.php:585
#: quick-cache.inc.php:594
msgid "Settings"
msgstr ""

#: quick-cache.inc.php:586
#: quick-cache.inc.php:595
msgid "Preview Pro Features"
msgstr ""

#: quick-cache.inc.php:587
#: quick-cache.inc.php:596
msgid "Upgrade"
msgstr ""

#: quick-cache.inc.php:633 quick-cache.inc.php:704
#: quick-cache.inc.php:642 quick-cache.inc.php:719
msgid "dismiss &times;"
msgstr ""

#: quick-cache.inc.php:762
#: quick-cache.inc.php:777
msgid "Every 15 Minutes"
msgstr ""

#: quick-cache.inc.php:889
#: quick-cache.inc.php:904
msgid "<strong>Quick Cache:</strong> detected significant changes. Found %1$s in the cache; auto-wiping."
msgstr ""

#: quick-cache.inc.php:933
#: quick-cache.inc.php:948
msgid "<strong>Quick Cache:</strong> detected important site changes. Found %1$s in the cache for this site; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1012
#: quick-cache.inc.php:1027
msgid "Post"
msgstr ""

#: quick-cache.inc.php:1020
#: quick-cache.inc.php:1035
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache for %2$s ID: <code>%3$s</code>; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1183
#: quick-cache.inc.php:1198
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache, for XML feeds of type: <code>%2$s</code>; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1226
#: quick-cache.inc.php:1241
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache for XML sitemaps; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1269
#: quick-cache.inc.php:1284
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache for the designated \"Home Page\"; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1327
#: quick-cache.inc.php:1342
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache for the designated \"Posts Page\"; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1382
#: quick-cache.inc.php:1397
msgid "Untitled"
msgstr ""

#: quick-cache.inc.php:1393
#: quick-cache.inc.php:1408
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache for Custom Post Type: <code>%2$s</code>; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1483
#: quick-cache.inc.php:1498
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache for Author Page: <code>%2$s</code>; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1635
#: quick-cache.inc.php:1650
msgid "<strong>Quick Cache:</strong> detected changes. Found %1$s in the cache for %2$s: <code>%3$s</code>; auto-clearing."
msgstr ""

#: quick-cache.inc.php:1924 quick-cache.inc.php:1952
#: quick-cache.inc.php:1939 quick-cache.inc.php:1967
msgid "Doing it wrong! Missing `base_dir` option value. MUST call this method after `setup()`."
msgstr ""

#: quick-cache.inc.php:2362
#: quick-cache.inc.php:2377
msgid "Please disable the LITE version of Quick Cache before you activate the PRO version."
msgstr ""

Expand Down
1 change: 1 addition & 0 deletions quick-cache/includes/version-specific-upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function run_handlers()
$this->from_lt_v140612();
$this->from_lt_v141009();
$this->from_lt_v141105();
$this->from_lt_v150129_1();
}

/*
Expand Down
19 changes: 17 additions & 2 deletions quick-cache/quick-cache.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public function setup()

'version' => $this->version,
'crons_setup' => '0', // `0` or timestamp.
'zencache_notice1_enqueued' => '0', // `0` or `1` if already enqueued

/* Primary switch; enable? */

Expand Down Expand Up @@ -369,6 +370,14 @@ public function activate()
*/
public function check_version()
{
if(!$this->options['zencache_notice1_enqueued'])
{
$this->enqueue_notice(__('<strong>NOTICE:</strong> <a href="http://zencache.com/announcing-zencache-formerly-quick-cache/" target="_blank">Quick Cache is now ZenCache</a>! No further updates will be made to Quick Cache after March 6th, 2015; see <a href="http://zencache.com/kb-article/how-to-migrate-from-quick-cache-lite-to-zencache-lite/" target="_blank">migration instructions</a>.', $this->text_domain), 'persistent-class-update-nag-zencache-notice1', TRUE);
$this->options['zencache_notice1_enqueued'] = '1';
update_option(__NAMESPACE__.'_options', $this->options);
if(is_multisite()) update_site_option(__NAMESPACE__.'_options', $this->options);
}

$current_version = $prev_version = $this->options['version'];
if(version_compare($current_version, $this->version, '>='))
return; // Nothing to do; we've already upgraded them.
Expand Down Expand Up @@ -632,9 +641,15 @@ public function all_admin_notices()
$_dismiss = add_query_arg(urlencode_deep(array(__NAMESPACE__ => array('dismiss_notice' => array('key' => $_key)), '_wpnonce' => wp_create_nonce())));
$_dismiss = '<a style="'.esc_attr($_dismiss_css).'" href="'.esc_attr($_dismiss).'">'.__('dismiss &times;', $this->text_domain).'</a>';
}
echo apply_filters(__METHOD__.'__notice', '<div class="updated"><p>'.$_notice.$_dismiss.'</p></div>', get_defined_vars());
if(strpos($_key, 'class-update-nag') !== FALSE)
$_class = 'update-nag';
else if(strpos($_key, 'class-error') !== FALSE)
$_class = 'error';
else
$_class = 'updated';
echo apply_filters(__METHOD__.'__notice', '<div class="'.$_class.'"><p>'.$_notice.$_dismiss.'</p></div>', get_defined_vars());
}
unset($_key, $_notice, $_dismiss_css, $_dismiss); // Housekeeping.
unset($_key, $_notice, $_dismiss_css, $_dismiss, $_class); // Housekeeping.
}

/**
Expand Down
2 changes: 1 addition & 1 deletion quick-cache/quick-cache.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
Version: 150129
Version: 150129.1
Text Domain: quick-cache
Plugin Name: Quick Cache
Network: true
Expand Down
Loading

0 comments on commit 88acfbc

Please sign in to comment.