You may have this kind of error with Smush – Optimize, Compress and Lazy Load Images :
Notice: wp_deregister_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the admin-bar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /wp-includes/functions.php on line 5225
Notice: wp_deregister_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the admin-bar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /wp-includes/functions.php on line 5225
Warning: Cannot modify header information – headers already sent by (output started at /wp-includes/functions.php:5225) in /wp-includes/functions.php on line 6270
Warning: Cannot modify header information – headers already sent by (output started at /wp-includes/functions.php:5225) in /wp-admin/includes/misc.php on line 1310
Warning: Cannot modify header information – headers already sent by (output started at /wp-includes/functions.php:5225) in /wp-admin/admin-header.php on line 9
Fatal error: Maximum execution time of 30 seconds exceeded in /wp-content/plugins/wp-smushit/core/class-stats.php on line 777
Or :
An error of type E_ERROR was caused in line 257 of the file /wp-content/plugins/wp-smush-pro/wp-smush.php. Error message: Uncaught Error: Class ‘Smush\Core\Api\API’ not found in /wp-content/plugins/wp-smush-pro/wp-smush.php:257
Stack trace:
#0 /wp-content/plugins/wp-smush-pro/wp-smush.php(216): WP_Smush->init()
#1 /wp-content/plugins/wp-smush-pro/wp-smush.php(198): WP_Smush->__construct()
#2 /wp-includes/class-wp-hook.php(292): WP_Smush::get_instance(”)
#3 /wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters(NULL, Array)
#4 /wp-includes/plugin.php(484): WP_Hook->do_action(Array)
#5 /wp-settings.php(423): do_action(‘plugins_loaded’)
#6 /wp-config.php(122): require_once(‘/nas/content/li…’)
#7 /wp-load.php(37): require_once(‘/nas/content/li…’)
#8 /wp-admin/admin-ajax.php(22): require_once(‘/nas/content/li…’)
Or :
Fatal error: Uncaught Error: Class “Smush\App\Abstract_Page” not found in /wp-content/plugins/wp-smushit/app/pages/class-dashboard.php:23 Stack trace: #0 /wp-content/plugins/wp-smushit/wp-smush.php(244): require() #1 /wp-content/plugins/wp-smushit/app/class-admin.php(277): WP_Smush->autoload() #2 /wp-includes/class-wp-hook.php(303): Smush\App\Admin->add_menu_pages() #3 /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #4 /wp-includes/plugin.php(470): WP_Hook->do_action() #5 /wp-admin/includes/menu.php(155): do_action() #6 /wp-admin/menu.php(341): require_once(‘’) #7 /wp-admin/admin.php(158): require(
Or :
PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “ajax_response” not found or invalid function name in /wp-includes/class-wp-hook.php:308
Stack trace:
#0 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)
#1 /wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#2 /wp-admin/admin-ajax.php(203): do_action()
There are multiple solutions to try to make it work.
Updates
The first thing to do if you are stuck with Smush – Optimize, Compress and Lazy Load Images is to ensure that all your WordPress is up to date. You should check your :
- WordPress
- Plugins
- Theme
Once all these updates are done, check back if these errors appear.
Check Smush – Optimize, Compress and Lazy Load Images
Sometimes, you just need to disable the plugin, and enable it just after to make it work again.
If it doesn’t work, your Smush – Optimize, Compress and Lazy Load Images 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 Smush – Optimize, Compress and Lazy Load Images? 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.
Alternative solutions
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.