2.4.0 causes errors
-
After updating to 2.4.0, I go to my dashboard and everything starts flickering. It’s hard to get anything to work because the pages keep refreshing. I also get this error message:
PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘autoptimize_flush_pagecache’ not found or invalid function name in /home/[redacted]/public_html/main/wp-includes/class-wp-hook.php on line 284
When I first saw this this afternoon, I was finally able to turn on Rollback and go back to 2.3.4. Then Jetpack automatically updated the plugin again, but everything seemed to be working okay now, so I left it.
Hours later, I opened my dashboard again, and the flickering was happening again. Once again I managed to roll it back to 2.3.4, turned off Jetpack’s automatic update, and now it’s fine.
I am using this snippet:
// Automatically clear Autoptimize cache if it goes beyond 2GB
if (class_exists(‘autoptimizeCache’)) {
$myMaxSize = 10000; # You may change this value to lower like 500000 for 500MB if you have limited server space
$statArr=autoptimizeCache::stats();
$cacheSize=round($statArr[1]/1024);if ($cacheSize>$myMaxSize){
autoptimizeCache::clearall();
header(“Refresh:0”); # Refresh the page so that autoptimize can create new cache files and it does not break the page after clearall.
}
}…But I don’t know if this is actually related, because I use the snippet with Autoptimize on two sites, and the other site is running normally.
- The topic ‘2.4.0 causes errors’ is closed to new replies.