From 384900526908aeed7b9ea5f2e1ad2d04e7531c6d Mon Sep 17 00:00:00 2001 From: Raam Dev Date: Mon, 20 Feb 2017 18:15:12 -0500 Subject: [PATCH] Phing release of v170220 with the following changes: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - **New Feature:** Comet Cache can now be configured to automatically clear the cache for date-based archive views whenever any single post is cleared due to changes in content, title, etc. See: **Dashboard → Comet Cache → Plugin Options → Automatic Cache Clearing → Auto-Clear "Date-Based Archives" Too?**. See also: [Issue #724](https://github.com/websharks/comet-cache/issues/724). - **New Pro Feature:** Apache Optimizations now include a new option that allows site owners to enforce an exact host name for all requests. See: **Dashboard → Comet Cache Pro → Plugin Options → Apache Optimizations → Enforce an Exact Host Name?**. See also: [Issue #101](https://github.com/websharks/comet-cache/issues/101). - **Bug Fix:** Apache detection sometimes inaccurate. So instead of using default WP core globals for server detection, Comet Cache now uses it's own set of Apache/Nginx/IIS detection functions. And, this release enhances our Apache and Nginx detection routines; making them smart enough to catch additional edge cases; i.e., to further reduce the likelihood of there being a false-positive. See [Issue #748](https://github.com/websharks/comet-cache/issues/748). - **Bug Fix:** Some XML-RPC and REST API requests were being cached inadvertently. See [Issue #855](https://github.com/websharks/comet-cache/issues/855). - **Bug Fix:** Broken textarea field due to `white-space:nowrap` in Firefox. See [Issue #866](https://github.com/websharks/comet-cache/issues/866). - **Bug Fix:** This release resolves empty directories being left in the cache folder, in some scenarios. See [Thread #866](https://forums.wpsharks.com/t/cache-folders-not-removed-during-clean-up-process/866). - **Bug Fix** (Pro): Some REST requests were being redirected incorrectly whenever Apache Optimizations were enabled. See [Issue #855](https://github.com/websharks/comet-cache/issues/855). - **Compatibility Bug Fix:** Some Jetpack API calls were being cached inadvertently. See [Issue #855](https://github.com/websharks/comet-cache/issues/855). - **Enhancement:** Notes in HTML source now indicate fully functional on first load for improved clarity. See [Issue #860](https://github.com/websharks/comet-cache/issues/860). - **Enhancement:** Enhancing security by removing `basename(__FILE__)` from direct access notices. --- .gitchange | 2 +- CHANGELOG.md | 4 ++-- comet-cache.php | 2 +- readme.txt | 15 +++++++++++++- src/includes/classes/MenuPageOptions.php | 2 +- .../interfaces/Shared/NcDebugConsts.php | 4 ++-- src/includes/stub.php | 2 +- src/includes/traits/Ac/NcDebugUtils.php | 4 ++-- src/includes/traits/Ac/ObUtils.php | 4 ++-- .../traits/Plugin/WcpDateArchiveUtils.php | 20 +++++++++---------- 10 files changed, 36 insertions(+), 23 deletions(-) diff --git a/.gitchange b/.gitchange index 073f132..455151c 100644 --- a/.gitchange +++ b/.gitchange @@ -1,4 +1,4 @@ 1460135613 49dd4154d8f5d3b70691c8e3f52a063a49137fb7:57be33556df067.43016776 853d9120b42cf4f2eabe2f35ea18a6ace7170ea6:588bb5682f4739.12912408 -d0e05c36184f81b133761b71ca6ee0136be67409:58926dbb57e4a4.36452623 +d0e05c36184f81b133761b71ca6ee0136be67409:58ab78802b0522.43963767 diff --git a/CHANGELOG.md b/CHANGELOG.md index c575fe6..9765412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -= v170201-RC = += v170220 = - **New Feature:** Comet Cache can now be configured to automatically clear the cache for date-based archive views whenever any single post is cleared due to changes in content, title, etc. See: **Dashboard → Comet Cache → Plugin Options → Automatic Cache Clearing → Auto-Clear "Date-Based Archives" Too?**. See also: [Issue #724](https://github.com/websharks/comet-cache/issues/724). - **New Pro Feature:** Apache Optimizations now include a new option that allows site owners to enforce an exact host name for all requests. See: **Dashboard → Comet Cache Pro → Plugin Options → Apache Optimizations → Enforce an Exact Host Name?**. See also: [Issue #101](https://github.com/websharks/comet-cache/issues/101). @@ -9,7 +9,7 @@ - **Bug Fix** (Pro): Some REST requests were being redirected incorrectly whenever Apache Optimizations were enabled. See [Issue #855](https://github.com/websharks/comet-cache/issues/855). - **Compatibility Bug Fix:** Some Jetpack API calls were being cached inadvertently. See [Issue #855](https://github.com/websharks/comet-cache/issues/855). - **Enhancement:** Notes in HTML source now indicate fully functional on first load for improved clarity. See [Issue #860](https://github.com/websharks/comet-cache/issues/860). -- **Code Cleanup:** Enhancing security by removing `basename(__FILE__)` from direct access notices. +- **Enhancement:** Enhancing security by removing `basename(__FILE__)` from direct access notices. = v161227 = diff --git a/comet-cache.php b/comet-cache.php index 004b578..fe53205 100644 --- a/comet-cache.php +++ b/comet-cache.php @@ -1,6 +1,6 @@ plugin->isApache() || $this->plugin->isProPreview()) { + if ($this->plugin->isApache() || $this->plugin->isProPreview()) { echo '
'."\n"; echo ' '."\n"; diff --git a/src/includes/interfaces/Shared/NcDebugConsts.php b/src/includes/interfaces/Shared/NcDebugConsts.php index 6b6d014..42fab5f 100644 --- a/src/includes/interfaces/Shared/NcDebugConsts.php +++ b/src/includes/interfaces/Shared/NcDebugConsts.php @@ -69,7 +69,7 @@ interface NcDebugConsts /** * No-cache because it's an `XMLRPC_REQUEST`. * - * @since 17xxxx Enhancing compatibility with API requests. + * @since 170220 Enhancing compatibility with API requests. * * @type string A unique string identifier in the set of `NC_DEBUG_` constants. */ @@ -78,7 +78,7 @@ interface NcDebugConsts /** * No-cache because it's a `REST_REQUEST`. * - * @since 17xxxx Enhancing compatibility with API requests. + * @since 170220 Enhancing compatibility with API requests. * * @type string A unique string identifier in the set of `NC_DEBUG_` constants. */ diff --git a/src/includes/stub.php b/src/includes/stub.php index eda6400..b313a49 100644 --- a/src/includes/stub.php +++ b/src/includes/stub.php @@ -13,7 +13,7 @@ require_once dirname(__DIR__).'/vendor/autoload.php'; require_once __DIR__.'/functions/i18n-utils.php'; -${__FILE__}['version'] = '170201-RC'; //version// +${__FILE__}['version'] = '170220'; //version// ${__FILE__}['plugin'] = dirname(dirname(__DIR__)); ${__FILE__}['plugin'] .= '/'.basename(${__FILE__}['plugin']).'.php'; ${__FILE__}['ns_path'] = str_replace('\\', '/', __NAMESPACE__); // To dir/path. diff --git a/src/includes/traits/Ac/NcDebugUtils.php b/src/includes/traits/Ac/NcDebugUtils.php index 8e2eb2d..89499a2 100644 --- a/src/includes/traits/Ac/NcDebugUtils.php +++ b/src/includes/traits/Ac/NcDebugUtils.php @@ -38,7 +38,7 @@ public function maybeSetDebugInfo($reason_code, $reason = '') * Echoes `NC_DEBUG_` info in the WordPress `shutdown` phase (if applicable). * * @since 150422 Rewrite. - * @since 17xxxx Do not display for API requests. + * @since 170220 Do not display for API requests. * * @attaches-to `shutdown` hook in WordPress w/ a late priority. */ @@ -68,7 +68,7 @@ public function maybeEchoNcDebugInfo() * Gets `NC_DEBUG_` info (if applicable). * * @since 150422 Rewrite. - * @since 17xxxx Adding API request constants. + * @since 170220 Adding API request constants. * * @param string $reason_code One of the `NC_DEBUG_` constants. * @param string $reason Optional; to override the default description with a custom message. diff --git a/src/includes/traits/Ac/ObUtils.php b/src/includes/traits/Ac/ObUtils.php index a3e69e3..32a464a 100644 --- a/src/includes/traits/Ac/ObUtils.php +++ b/src/includes/traits/Ac/ObUtils.php @@ -119,7 +119,7 @@ trait ObUtils * Start output buffering or serve cache. * * @since 150422 Rewrite. - * @since 17xxxx Adding API request constants. + * @since 170220 Adding API request constants. * * @note This is a vital part of Comet Cache. * This method serves existing (fresh) cache files. It is also responsible @@ -265,7 +265,7 @@ public function maybeStartOutputBuffering() * Output buffer handler; i.e. the cache file generator. * * @since 150422 Rewrite. - * @since 17xxxx Adding API request constants. + * @since 170220 Adding API request constants. * * @param string $buffer The buffer from {@link \ob_start()}. * @param int $phase A set of bitmask flags. diff --git a/src/includes/traits/Plugin/WcpDateArchiveUtils.php b/src/includes/traits/Plugin/WcpDateArchiveUtils.php index 6de4626..aac4064 100644 --- a/src/includes/traits/Plugin/WcpDateArchiveUtils.php +++ b/src/includes/traits/Plugin/WcpDateArchiveUtils.php @@ -8,7 +8,7 @@ trait WcpDateArchiveUtils /** * Automatically clears date archives. * - * @since 17xxxx Date archive clearing. + * @since 170220 Date archive clearing. * * @param int $post_id A WordPress post ID. * @param bool $force Defaults to a `FALSE` value. @@ -64,19 +64,19 @@ public function autoClearDateArchiveCache($post_id, $force = false) $date_archive_urls = []; // Initialize archive urls. $publish_time = get_post_time('U', true, $post_id); - $Y = strtotime('Y', $publish_time); - $m = strtotime('m', $publish_time); - $j = strtotime('j', $publish_time); + $Y = date('Y', $publish_time); + $m = date('m', $publish_time); + $j = date('j', $publish_time); if ($this->options['cache_clear_date_archives_enable'] === '1') { - $date_archive_links[sprintf(__('%1$s Date Archive', 'comet-cache'), $Y)] = get_year_link($Y); - $date_archive_links[sprintf(__('%1$s/%2$s Date Archive', 'comet-cache'), $Y, $m)] = get_month_link($Y, $m); - $date_archive_links[sprintf(__('%1$s/%2$s/%3$s Date Archive', 'comet-cache'), $Y, $m, $j)] = get_day_link($Y, $m, $j); + $date_archive_urls[sprintf(__('%1$s Date Archive', 'comet-cache'), $Y)] = get_year_link($Y); + $date_archive_urls[sprintf(__('%1$s/%2$s Date Archive', 'comet-cache'), $Y, $m)] = get_month_link($Y, $m); + $date_archive_urls[sprintf(__('%1$s/%2$s/%3$s Date Archive', 'comet-cache'), $Y, $m, $j)] = get_day_link($Y, $m, $j); } elseif ($this->options['cache_clear_date_archives_enable'] === '2') { - $date_archive_links[sprintf(__('%1$s/%2$s Date Archive', 'comet-cache'), $Y, $m)] = get_month_link($Y, $m); - $date_archive_links[sprintf(__('%1$s/%2$s/%3$s Date Archive', 'comet-cache'), $Y, $m, $j)] = get_day_link($Y, $m, $j); + $date_archive_urls[sprintf(__('%1$s/%2$s Date Archive', 'comet-cache'), $Y, $m)] = get_month_link($Y, $m); + $date_archive_urls[sprintf(__('%1$s/%2$s/%3$s Date Archive', 'comet-cache'), $Y, $m, $j)] = get_day_link($Y, $m, $j); } else { // Assume $this->options['cache_clear_date_archives_enable'] === '3' - $date_archive_links[sprintf(__('%1$s/%2$s/%3$s Date Archive', 'comet-cache'), $Y, $m, $j)] = get_day_link($Y, $m, $j); + $date_archive_urls[sprintf(__('%1$s/%2$s/%3$s Date Archive', 'comet-cache'), $Y, $m, $j)] = get_day_link($Y, $m, $j); } foreach ($date_archive_urls as $_label => $_url) { $_url_regex = $this->buildHostCachePathRegex($_url);