diff --git a/quick-cache/quick-cache.inc.php b/quick-cache/quick-cache.inc.php index 5b95737..f073624 100644 --- a/quick-cache/quick-cache.inc.php +++ b/quick-cache/quick-cache.inc.php @@ -761,6 +761,7 @@ public function auto_purge_post_terms_cache($id) '\/[^\/]+\/'.preg_quote($cache_path_no_scheme_quv_ext, '/'). '(?:\/index)?(?:\.|\/(?:page|comment\-page)\/[0-9]+[.\/])/'; + $_i = 0; /** @var $_file \RecursiveDirectoryIterator For IDEs. */ foreach($this->dir_regex_iteration($cache_dir, $regex) as $_file) if($_file->isFile() || $_file->isLink()) { @@ -772,16 +773,17 @@ public function auto_purge_post_terms_cache($id) throw new \exception(sprintf(__('Unable to auto-purge file: `%1$s`.', $this->text_domain), $_file->getPathname())); $counter++; // Increment counter for each file purge. - if(!empty($_notices) || !is_admin()) - continue; // Stop here; we already issued a notice, or this notice is N/A. + if(!is_admin() || $_i > 100) + continue; // Stop here; we're at our max number of notices or this notice is N/A. + $_i++; $_notices = (is_array($_notices = get_option(__NAMESPACE__.'_notices'))) ? $_notices : array(); $_notices[] = ''. sprintf(__('Quick Cache: detected changes. Found cache files for %1$s: %2$s (auto-purging).', $this->text_domain), $_term['taxonomy_label'], $_term['term_name']); update_option(__NAMESPACE__.'_notices', $_notices); } } - unset($_term, $_file, $_notices); // Just a little housekeeping. + unset($_term, $_file, $_notices, $_i); // Just a little housekeeping. return apply_filters(__METHOD__, $counter, get_defined_vars()); }