
If you are using Autoptimize WordPress plugin and you have visited this page, then you might have encountered failed to open stream error. What follows is a brief explanation of what causes the error and how to fix it.
Failed to open stream error in Autoptimize
The failed to open stream error points to issues with loading of a file stored in wp-content/cache/autoptimize/css/. The error message is generated from /home/wp/disk/wordpress/wp-content/plugins/autoptimize/classes/autoptimizeCache.php
Problem
The error is suggesting that the mentioned file cannot be loaded by WordPress. You might experience the error if you try to clear Autoptimize plugin cache or when activating and deactivating the plugin.
If the error continues to throw, the error log file can grow too large in size which can slow your website’s load speed or you may run out of allocated disk space.
How to fix the error
Solution 1: Update the plugin and WordPress version
Update the Autoptimize plugin and WordPress Core to the latest version. If this does not fix the error then try solution 2.
Solution 2: Add Code Filter to functions.php file
- Go to your WordPress Child Theme files
- Open functions.php file
- Add the code below.
add_filter(‘autoptimize_filter_cache_checkdirs_on_write’,’__return_true’);
Make sure you are adding the code to a child theme to avoid losing the code if there is a theme update in the future.
Before you leave, Subscribe to our Newsletter to be updated via email when Blogging Tools you use to run your blog release new features or make critical changes. For any question about this post, or anything else related to website technologies, we are responding on Reddit or comment below.
Leave a Reply