Back to Community

Resolving Common Smush Plugin Errors: A Troubleshooting Guide

Content

Users of the 'Smush Image Optimization – Optimize Images | Compress & Lazy Load Images | Convert WebP & AVIF | Image CDN' plugin occasionally encounter errors that can disrupt their website's functionality. This guide compiles the most frequent issues and their solutions, based on community reports.

1. Fatal Error: Call to undefined function wp_doing_cron()

The Problem: A fatal PHP error referencing an undefined function wp_doing_cron() in the class-parser.php file, often resulting in a blank white screen (Error 500) and locking users out of their WordPress admin.

Why It Happens: This function is built into WordPress core version 4.8.0 and later. The error occurs when running the Smush plugin on an older, unsupported version of WordPress.

The Solution: Update your WordPress installation to the latest version. If the error prevents you from accessing the admin dashboard to update, you can disable the plugin via FTP or your hosting file manager:

  1. Connect to your site via FTP/SFTP.
  2. Navigate to the /wp-content/plugins/ directory.
  3. Rename the wp-smushit folder to something like wp-smushit_old.
  4. This will deactivate the plugin, allowing you to log in and update WordPress.

2. Loopback Request Error

The Problem: Users receive an error stating "Your site seems to have an issue with loopback requests" when trying to run bulk smush operations or recheck images.

Why It Happens: A loopback request is when your server sends a request to itself. This error indicates the server is blocking or failing to complete these internal requests, which many plugins, including Smush, use for background tasks.

The Solution:

  1. Conflict Test: The most common cause is a conflict with another plugin or theme. Disable all other plugins and switch to a default WordPress theme (like Twenty Twenty-One). If the error disappears, reactivate your plugins and theme one by one to identify the culprit.
  2. Check Site Health: Go to Tools > Site Health in your WordPress admin. The Status tab may provide specific information about failed loopback tests.
  3. Server Configuration: Contact your hosting provider. They can check server-level settings (e.g., security mod_security rules, firewall configurations, or PHP handlers) that might be blocking localhost requests.

3. PHP Notices and Warnings (e.g., "Trying to get property of non-object")

The Problem: Notices and warnings about undefined indexes or trying to get a property of a non-object appear in logs or on the frontend/backend. These are not fatal but can indicate underlying issues.

Why It Happens: These are often related to incomplete or corrupted plugin data, conflicts with other code, or deprecated code that interacts differently with newer PHP versions.

The Solution:

  1. Resave Settings: Navigate to Smush > Settings, make no changes, and hit Save Changes. This can refresh and fix corrupted settings data.
  2. Reinstall the Plugin: Completely remove and reinstall Smush. Simply deactivating and deleting the plugin from the WordPress admin often works. For a clean slate, use FTP to ensure the /wp-smushit/ folder is completely removed from the /wp-content/plugins/ directory before reinstalling.

4. Admin-AJAX 400 (Bad Request) Errors

The Problem: 400 errors for AJAX calls (e.g., admin-ajax.php?action=smush_notice_s3_support_required) appear in the browser's console, potentially breaking functionality in the WordPress media library or Smush dashboard.

Why It Happens: A 400 error indicates the server rejected the request because it was malformed or there was a permission/configuration issue. This is frequently caused by a plugin or server security rule conflict.

The Solution:

  1. Conflict Test: As with the loopback error, perform a full conflict test by deactivating all other plugins and using a default theme to see if the error persists.
  2. Debug Log: Enable WordPress debugging by adding the following lines to your wp-config.php file above the /* That's all, stop editing! Happy publishing. */ line:
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    This will create a debug.log file in your /wp-content/ directory. Reproduce the error and check this log for more specific error messages.

5. Source Map Warnings in Browser Console

The Problem: Browser console shows warnings like "DevTools failed to load source map: Could not load content for... smush-global.min.js.map: HTTP error: status code 404".

Why It Happens: Source map files are used for debugging minified JavaScript and are not needed for the plugin to function. A 404 error simply means the browser can't find this optional file, often due to server caching or security rules.

The Solution: This warning can be safely ignored as it does not affect site functionality. If you wish to suppress the warning, you can often do so within your browser's developer tools settings or ensure your server is not blocking access to .map files.

General Troubleshooting Steps

For any persistent error, these steps are always a good starting point:

  • Clear All Caches: Clear your browser cache, any WordPress caching plugins, and your server-side cache (e.g., object caching, CDN cache).
  • Check WordPress and PHP Versions: Ensure you are running a supported version of WordPress and PHP.
  • Check Error Logs: Your web hosting provider should give you access to server error logs (e.g., error_log), which often contain more detailed information than what is displayed on screen.

If these steps do not resolve your issue, detailing the specific error message, your WordPress version, and the steps you've already tried is the best way to seek further assistance from the community.

Related Support Threads Support