Changeset 2000401
- Timestamp:
- 12/22/2018 07:31:01 PM (7 years ago)
- Location:
- gator-cache/trunk
- Files:
-
- 4 edited
-
gator-cache.php (modified) (6 diffs)
-
lib/GatorCacheRefresh.php (modified) (3 diffs)
-
lib/Reo/Classic/Request.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
gator-cache/trunk/gator-cache.php
r1814287 r2000401 2 2 /** 3 3 * @package Gator Cache 4 * @version 2.1. 74 * @version 2.1.8 5 5 */ 6 6 /* … … 12 12 Text Domain: gator-cache 13 13 Domain Path: /lang 14 Version: 2.1. 714 Version: 2.1.8 15 15 */ 16 16 class WpGatorCache … … 49 49 protected static $multiSiteData; 50 50 const PREFIX = 'gtr_cache'; 51 const VERSION = '2.1. 7';51 const VERSION = '2.1.8'; 52 52 const JP_MOBILE_MOD = 'minileven'; // JetPack mobile module slug 53 53 const SUPPORT_LINK = 'https://wordpress.org/support/plugin/gator-cache'; … … 364 364 } 365 365 $options = self::getOptions(); 366 GatorCache::getCache( 367 $opts = GatorCache::getConfig(self::$configPath)->toArray() 368 )->removeGroups($path, $groups = self::getCacheGroups($opts)); 366 if (false === ($cache = GatorCache::getCache($opts = GatorCache::getConfig(self::$configPath)->toArray()))) { 367 return; 368 } 369 $cache->removeGroups($path, $groups = self::getCacheGroups($opts)); 369 370 //purge the feed 370 371 if (!$options['skip_feeds']) { 371 GatorCache::getCache($opts)->removeGroups('/comments/feed', $groups);372 $cache->removeGroups('/comments/feed', $groups); 372 373 } 373 374 } … … 432 433 { 433 434 $options = self::getOptions(); 435 if (false === ($cache = GatorCache::getCache($opts = GatorCache::getConfig(self::$configPath)->toArray()))) { 436 return; 437 } 434 438 if (empty($path)) { 435 GatorCache::getCache( 436 $opts = GatorCache::getConfig(self::$configPath)->toArray() 437 )->purgeGroups(self::getCacheGroups($opts)); 438 return; 439 } 440 GatorCache::getCache( 441 $opts = GatorCache::getConfig(self::$configPath)->toArray() 442 )->removeGroups($path, self::getCacheGroups($opts)); 439 $cache->purgeGroups(self::getCacheGroups($opts)); 440 return; 441 } 442 $cache->removeGroups($path, self::getCacheGroups($opts)); 443 443 } 444 444 … … 781 781 return; 782 782 } 783 WpGatorCache::purgePath(false); 783 // WpGatorCache::purgePath(false); 784 WpGatorCache::flush(); 784 785 } 785 786 // @note - the autoptimize plugin tries to call wp_cache_clear_cache before it's even loaded!! -
gator-cache/trunk/lib/GatorCacheRefresh.php
r1511312 r2000401 7 7 protected $refresh = false; 8 8 protected $preTerms = array(); 9 protected $permalink = array(); 9 10 10 11 public function __construct($options, $configPath) … … 26 27 return; 27 28 } 29 // get permalink here in pre-update in case the post is transitioned to draft or otherwise non-published 30 $this->permalinks[$postId] = get_permalink($postId); 28 31 $post = array('ID' => $postId, 'post_type' => $postType); 29 32 if (false === ($taxonomies = $this->getArchiveTerms((object) $post))) { … … 76 79 //refresh parent posts and the current post 77 80 foreach (($posts = $this->getRefreshPosts($post, $newPost)) as $postId) { 78 if (false !== ($path = parse_url(get_permalink($postId), PHP_URL_PATH))) { 81 $permalink = $post->ID == $postId && isset($this->permalinks[$postId]) ? $this->permalinks[$postId] : get_permalink($postId); 82 // var_dump($permalink);exit; 83 if (false !== ($path = parse_url($permalink, PHP_URL_PATH))) { 79 84 $cache->removeGroups($path, $groups, true); 80 85 } -
gator-cache/trunk/lib/Reo/Classic/Request.php
r1068776 r2000401 936 936 //@note seems that query_string should be used rather than parsing the uri 937 937 if (isset($this->server['QUERY_STRING'])) { 938 // check for reverse proxy and remove url portion of query string 939 if (isset($this->server['HTTP_X_ORIGINAL_URL']) && 0 === strpos($this->server['QUERY_STRING'], $path = $this->getPathInfo())) { 940 $this->server['QUERY_STRING'] = substr($this->server['QUERY_STRING'], strlen($path)); 941 } 938 942 //normalize 939 943 if (strstr($this->server['QUERY_STRING'], '=') || strstr($this->server['QUERY_STRING'], '&')) { … … 1242 1246 public function hasQueryString() 1243 1247 { 1244 return !empty($this->server['QUERY_STRING']);1248 return null !== $this->getQueryString(); 1245 1249 } 1246 1250 -
gator-cache/trunk/readme.txt
r1814287 r2000401 4 4 Tags: cache, performance, optimize, bbpress, woocommerce, multisite, jetpack mobile 5 5 Requires at least: 3.8 6 Tested up to: 4.9.27 Stable tag: 2.1. 76 Tested up to: 5.0.2 7 Stable tag: 2.1.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 55 55 56 56 == Changelog == 57 = 2.1.8 = 58 * Fix caching issue when Nginx is used as a reverse proxy 59 * Remove post from cache when transitioned from published (Switch to Draft) 60 * Verify compatiblity with latest version of WordPress 61 * Better error checking when cache directory is not found (due to migrations, etc) 57 62 = 2.1.7 = 58 63 * Compatiblity with recent versions of WooCommerce, will not cache cart, checkout or other pertinent pages
Note: See TracChangeset
for help on using the changeset viewer.