You may have this kind of error with Speed Optimizer (SG CachePress) :
Warning: Use of undefined constant COOKIEHASH - assumed 'COOKIEHASH' (this will throw an Error in a future version of PHP) in /wp-content/plugins/sg-cachepress/core/File_Cacher/File_Cacher.php on line 785
Fatal error: Uncaught Error: Call to a member function using_index_permalinks() on null in /wp-includes/rest-api.php:403 Stack trace: #0 /wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher.php(175): get_rest_url() #1 /wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher_Posts.php(31): SiteGround_Optimizer\Supercacher\Supercacher->purge_rest_cache() #2 /wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher_Posts.php(138): SiteGround_Optimizer\Supercacher\Supercacher_Posts->purge_post_cache(3097) #3 /wp-includes/class-wp-hook.php(294): SiteGround_Optimizer\Supercacher\Supercacher_Posts->purge_all_post_cache(3097) #4 /wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array) #5 in /wp-includes/rest-api.php on line 403
Warning: Undefined array key “REQUEST_METHOD” in /wp-content/plugins/sg-cachepress/core/Helper/File_Cacher_Trait.php on line 17
There are multiple solutions to try to make it work.
The first thing to do if you are stuck with Speed Optimizer (SG CachePress) is to ensure that all your WordPress is up to date. You should check your :
Once all these updates are done, check back if these errors appear.
Check Speed Optimizer (SG CachePress)
Sometimes, you just need to disable the plugin, and enable it just after to make it work again.
If it doesn’t work, your Speed Optimizer (SG CachePress) plugin may be corrupted. To ensure that it’s not your case, you have to re-download the plugin (or the theme delivered with the plugin) and try to install it again.
Check others plugins
Are you sure that the error is related to Speed Optimizer (SG CachePress)? Maybe not.
It could be related to another plugin that is not compatible. It could happen when you use a cache plugin, a security plugin, or simply a poorly developed plugin.
Disable all plugins. Then, check for your error, if the error is still there, the problem is not related to plugins compatibility. If there are no more errors, then enable every plugin one by one and check for the error. The goal is to target the plugin involved.
Try another theme
The error can be a problem with your theme.
If it’s not already done, then you should install & activate the default WordPress theme like Twenty Twenty-Two. Check for the error, and see what is happening to be sure that your WordPress theme is not the cause.
Permalinks & htaccess
If it doesn’t work, you may have a problem with your WordPress permalinks and/or your htaccess file. You should go on your WordPress dashboard, and re-saving permalinks from the permalinks page.
Contact the developer
If all these solutions don’t work, we advise you to contact the plugin developer.
You may have found a new bug, or a specific issue. You should get in touch with the developer either on the WordPress plugin forum, either by mail, either on their specific website with their own support.
If the developer doesn’t reply, or your problem is very urgent, then you should try an alternative to the plugin.
There are thousands of plugins on the official directory, and many others outside. You should try to find and test them!
If the issue is very specific, and the plugin could not be replaced, we advise you to contact an expert.
This is the best way to ensure you're not going to break your site anymore.