@wrigs1 Would you mind posting the code for your AC Plugin?
In fact it appears that the load_ac_plugins() function is not written in the advanced_cache file from the advanced_cache_tpl
@wrigs1 writes…
I assume this functionality is still supposed to be present.
That’s correct. It is still in the current release of ZenCache. Happy to take a look at your AC plugin file if you continue to have trouble.
@dams83 writes…
it appears that the load_ac_plugins() function is not written in the advanced_cache
The call is still there and ZenCache continues to support AC plugins. See source code in the latest release. However, the code that loads AC plugins was refactored in the latest release; i.e., it can be a bit confusing, because the code is not in the same place as it was.
Referencing: AcPluginUtils.php
See also. Updated AC plugin example file.
@wrigs1 writes…
Under previous versions of Zencache your example plugin
Copy that. I just took a second look and I can confirm this problem also.
I opened a bug report with a pull request here, along with a short-term workaround and explanation. Thank you for reporting!
Please see: https://github.com/websharks/zencache/issues/514
A fix for this issue was pushed to the latest copy of ZenCache v150626 as part of critical revision just now. Thanks again for reporting!
@wrigs1 @dams83 Thank you for reporting this important issue! As Jason mentioned above, we’ve emergency-patched the latest release (v150626) so you just need to download it again and you should get the patched copy.
Thread Starter
wrigs1
(@wrigs1)
Thanks JasWSInc & raamdev for the rapid response and quick fix.
From the links above (without wading through ZC code) it appears that the “AC class” is now “zencache_advanced_cache” whereas under previous versions it was “zencache__advanced_cache” (with a DOUBLE underscore).
I assume this change to a single underscore is not a typo; and to ensure my plugin is backwards compatible with older versions of ZC/QC I’ll have to do something like this:
if ( !empty($GLOBALS['zencache_advanced_cache']) ):
$ac = $GLOBALS['zencache_advanced_cache'];
$ac->add_filter('zencache_version_salt', 'my_salt_shaker');
elseif ( !empty($GLOBALS['zencache__advanced_cache']) ):
$ac = $GLOBALS['zencache__advanced_cache'];
$ac->add_filter(get_class($ac). '__version_salt', 'my_salt_shaker');
else:
$ac = $GLOBALS['quick_cache__advanced_cache'];
$ac->add_filter(get_class($ac). '__version_salt', 'my_salt_shaker');
endif;
Also; I assume in other plugins to detect whether a site is using ZC/QC I’ll need to do something like:
if( class_exists('\\quick_cache\\plugin')
|| class_exists('\\zencache\\plugin')
|| !empty($GLOBALS['zencache_advanced_cache']) )
// then the site is using ZC/QC
@wrigs1 Yes, all of that looks correct.
The only note that I would make is that instead of $ac->add_filter
you can now use $ac->addFilter()
, which is the most up-to-date call (either way currently works fine).
I assume this change to a single underscore is not a typo
Correct. Not a typo. Looks good to me, other than addFilter()
as Raam mentioned 🙂
Thread Starter
wrigs1
(@wrigs1)
@raamdev @jaswsinc Thanks again for the quick response/fantastic support.