Title: Error with WP Rocket
Last modified: June 12, 2023

---

# Error with WP Rocket

 *  Resolved [sboyertcm](https://wordpress.org/support/users/sboyertcm/)
 * (@sboyertcm)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/)
 * Hello,
   When I have ShortPixel Critical CSS and WP Rocket activate both at the
   same tume, I have this error. I only have this when ShortPixel Critical CSS is
   activated. I use PHP 8.2.
 * **Deprecated**: Function rocket_clean_wpengine() is **deprecated** since version
   3.6.1! Use \WP_Rocket\ThirdParty\Hostings\WPEngine::clean_wpengine instead. in**/
   var/www/html/wp-includes/functions.php** on line **5405**
 * **Fatal error**: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback)
   must be a valid callback, function “rocket_clean_supercacher” not found or invalid
   function name in /var/www/html/wp-includes/class-wp-hook.php:310 Stack trace:#
   0 /var/www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL,
   Array) #1 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)#
   2 /var/www/html/wp-content/plugins/wp-rocket/inc/functions/files.php(866): do_action(‘
   after_rocket_cl…’, ‘/var/www/html/w…’, ”, ‘..’) #3 /var/www/html/wp-content/plugins/
   wp-rocket/inc/common/purge.php(459): rocket_clean_domain(”) #4 /var/www/html/
   wp-includes/class-wp-hook.php(308): do_admin_post_rocket_purge_cache(”) #5 /var/
   www/html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)#
   6 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #7 /var/
   www/html/wp-admin/admin-post.php(85): do_action(‘admin_post_purg…’) #8 {main}
   thrown in **/var/www/html/wp-includes/class-wp-hook.php** on line **310**
 * Do you have any clue ?
 * Thanks
    -  This topic was modified 2 years, 11 months ago by [sboyertcm](https://wordpress.org/support/users/sboyertcm/).

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Support [Gerard Blanco](https://wordpress.org/support/users/sixaxis/)
 * (@sixaxis)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-16814140)
 * Hi [@sboyertcm](https://wordpress.org/support/users/sboyertcm/)!
 * Have you asked the WP Rocket team already? I have a feeling they may be able 
   to shed more light into this. Let us know what they say, please!
 * Thank you,
 *  Thread Starter [sboyertcm](https://wordpress.org/support/users/sboyertcm/)
 * (@sboyertcm)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-16817756)
 * Hi,
 * Yes, I asked WP Rocket team. I will keep you update.
 * Thanks
 *  [Piotrek Boniu](https://wordpress.org/support/users/boniu91/)
 * (@boniu91)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-16938631)
 * Hello [@sixaxis](https://wordpress.org/support/users/sixaxis/) Piotr from WP 
   Rocket here.
   It looks like you’re using deprecated function directly in your 
   code, as per our developer:[https://github.com/wp-media/wp-rocket/issues/5972#issuecomment-1658991491](https://github.com/wp-media/wp-rocket/issues/5972#issuecomment-1658991491)
   Please feel free to ask any question inside this issue if you need any help.
 *  Plugin Support [Gerard Blanco](https://wordpress.org/support/users/sixaxis/)
 * (@sixaxis)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-16940520)
 * Thanks Piotrek! I will forward this to our dev team.
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-16944719)
 * Hello [@boniu91](https://wordpress.org/support/users/boniu91/) and [@sboyertcm](https://wordpress.org/support/users/sboyertcm/),
 * Thanks for pointing this out. It looks like somehow the error is only triggered
   on WP Engine (they must have some integration with WP Rocket), and that’s probably
   the reason why we haven’t spotted this in our testing.
 * Here’s a dev version that contains the necessary fix for this issue:
 * [https://shortpixel.com/downloads/shortpixel-critical-css-1.0.1-DEV01.zip](https://shortpixel.com/downloads/shortpixel-critical-css-1.0.1-DEV01.zip)
 * We’d really appreciate if you could test this version on a staging/dev version
   of your site. If everything works well, we’ll include the fix in the next release
   of our plugin.
 * Thanks!
 *  [Alfonso Catrón](https://wordpress.org/support/users/alfonso100/)
 * (@alfonso100)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-16963300)
 * Hey there! Alfonso from WP Rocket support team here. 
   I tested the dev version
   and I am still getting an error, It happens when you try to save the CDN option
   in WP Rocket:
 * `Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback)
   must be a valid callback, non-static method WP_Rocket\ThirdParty\Hostings\WPEngine::
   clean_wpengine() cannot be called statically in /public_html/wp-includes/class-
   wp-hook.php:312 Stack trace: #0 /public_html/wp-includes/class-wp-hook.php(334):
   WP_Hook->apply_filters(NULL, Array) #1 /public_html/wp-includes/plugin.php(517):
   WP_Hook->do_action(Array) #2 /public_html/wp-content/plugins/wp-rocket/inc/functions/
   files.php(860): do_action('after_rocket_cl…', '/home/…', '', 'https://wphanga…')#
   3 /public_html/wp-content/plugins/wp-rocket/inc/admin/options.php(94): rocket_clean_domain()#
   4 /public_html/wp-includes/class-wp-hook.php(312): rocket_after_save_options(
   Array, Array) #5 /public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(
   NULL, Array) #6 /public_html/wp-includes/plugin.php(517): WP_Hook->do_action(
   Array) #7 /public_html/wp-includes/option.php(581): do_action('update_option_w…',
   Array, Array, 'wp_rocket_setti…') #8 /public_html/wp-admin/options.php(322): 
   update_option('wp_rocket_setti…', Array) #9 {main} thrown in /public_html/wp-
   includes/class-wp-hook.php on line 312`
 *  Plugin Author [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * (@petredobrescu)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-17016584)
 * Dear [@alfonso100](https://wordpress.org/support/users/alfonso100/), [@boniu91](https://wordpress.org/support/users/boniu91/),
 * Thanks for the error report, here’s another attempt (we’re doing this pretty 
   blind since we’re not having access to a WP Engine site to fully test this with
   WP Rocket):
 * [https://shortpixel.com/downloads/shortpixel-critical-css-1.0.1-DEV02.zip](https://shortpixel.com/downloads/shortpixel-critical-css-1.0.1-DEV02.zip)
 * Please tell us if this one works as expected and we’ll surely release a new version
   with this fix.
 * Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Error with WP Rocket’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/shortpixel-critical-css_56c9d7.svg)
 * [ShortPixel Critical CSS](https://wordpress.org/plugins/shortpixel-critical-css/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/shortpixel-critical-css/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/shortpixel-critical-css/)
 * [Active Topics](https://wordpress.org/support/plugin/shortpixel-critical-css/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/shortpixel-critical-css/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/shortpixel-critical-css/reviews/)

 * 7 replies
 * 5 participants
 * Last reply from: [Pedro](https://wordpress.org/support/users/petredobrescu/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/error-with-wp-rocket/#post-17016584)
 * Status: resolved