AO no cache output
-
I updated to the lasted version from AO. Now the plugin generates the cache but my website dont use the cache files.
The page I need help with: [log in to see the link]
-
weird, let’s start with some questions;
* do you see errors in the php errorlog?
* are you using other plugins that use/ manipulate the output buffer? can you try disabling those briefly?
* can you roll back to 2.3.4 to confirm this is a regression in AO?frank
hi frank, I just looked in my errorlog and noticed that there is a bug due to the following function. I disabled the corresponding function but what is the error?
//* Remove type tag from script and style //add_filter('style_loader_tag', 'codeless_remove_type_attr', 10, 2); //add_filter('script_loader_tag', 'codeless_remove_type_attr', 10, 2); //add_filter('autoptimize_html_after_minify', 'codeless_remove_type_attr', 10, 2); function codeless_remove_type_attr($tag, $handle) { return preg_replace("/type=['\"]text\/(javascript|css)['\"]/", '', $tag); }
Thanks for your help!
What is the exact error in your PHP errorlog Felix?
[05-Oct-2018 13:13:01 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function codeless_remove_type_attr(), 1 passed in /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php on line 286 and exactly 2 expected in /www/htdocs/w013ad9d/webshaped.de/wp-content/themes/bootstrap-for-genesis-4/functions.php:133 Stack trace: #0 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php(286): codeless_remove_type_attr('<!DOCTYPE html>...') #1 /www/htdocs/w013ad9d/webshaped.de/wp-includes/plugin.php(203): WP_Hook->apply_filters('<!DOCTYPE html>...', Array) #2 /www/htdocs/w013ad9d/webshaped.de/wp-content/plugins/autoptimize/classes/autoptimizeMain.php(442): apply_filters('autoptimize_htm...', '<!DOCTYPE html>...') #3 [internal function]: autoptimizeMain->end_buffering('<!DOCTYPE html>...', 9) #4 /www/htdocs/w013ad9d/webshaped.de/wp-includes/functions.php(3743): ob_end_flush() #5 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php(286): wp_ob_end_flush_all('') #6 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class in /www/htdocs/w013ad9d/webshaped.de/wp-content/themes/bootstrap-for-genesis-4/functions.php on line 133 [05-Oct-2018 13:13:01 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function codeless_remove_type_attr(), 1 passed in /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php on line 286 and exactly 2 expected in /www/htdocs/w013ad9d/webshaped.de/wp-content/themes/bootstrap-for-genesis-4/functions.php:133 Stack trace: #0 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php(286): codeless_remove_type_attr('<!DOCTYPE html>...') #1 /www/htdocs/w013ad9d/webshaped.de/wp-includes/plugin.php(203): WP_Hook->apply_filters('<!DOCTYPE html>...', Array) #2 /www/htdocs/w013ad9d/webshaped.de/wp-content/plugins/autoptimize/classes/autoptimizeMain.php(442): apply_filters('autoptimize_htm...', '<!DOCTYPE html>...') #3 [internal function]: autoptimizeMain->end_buffering('<!DOCTYPE html>...', 9) #4 /www/htdocs/w013ad9d/webshaped.de/wp-includes/functions.php(3743): ob_end_flush() #5 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php(286): wp_ob_end_flush_all('') #6 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class in /www/htdocs/w013ad9d/webshaped.de/wp-content/themes/bootstrap-for-genesis-4/functions.php on line 133 [05-Oct-2018 13:14:03 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function codeless_remove_type_attr(), 1 passed in /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php on line 286 and exactly 2 expected in /www/htdocs/w013ad9d/webshaped.de/wp-content/themes/bootstrap-for-genesis-4/functions.php:133 Stack trace: #0 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php(286): codeless_remove_type_attr('<!DOCTYPE html>...') #1 /www/htdocs/w013ad9d/webshaped.de/wp-includes/plugin.php(203): WP_Hook->apply_filters('<!DOCTYPE html>...', Array) #2 /www/htdocs/w013ad9d/webshaped.de/wp-content/plugins/autoptimize/classes/autoptimizeMain.php(442): apply_filters('autoptimize_htm...', '<!DOCTYPE html>...') #3 [internal function]: autoptimizeMain->end_buffering('<!DOCTYPE html>...', 9) #4 /www/htdocs/w013ad9d/webshaped.de/wp-includes/functions.php(3743): ob_end_flush() #5 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class-wp-hook.php(286): wp_ob_end_flush_all('') #6 /www/htdocs/w013ad9d/webshaped.de/wp-includes/class in /www/htdocs/w013ad9d/webshaped.de/wp-content/themes/bootstrap-for-genesis-4/functions.php on line 133
OK, I see the problem. You could try
function codeless_remove_type_attr($tag, $handle="")
if that does not work you might have to create a separate function for the AO hook, with only one argument;
function codeless_remove_type_attr($tag)
hope this helps,
frankThank you very much, the first variant helped.
you’re welcome Felix, enjoy the weekend ??
- The topic ‘AO no cache output’ is closed to new replies.