BugWP
Submit a Bug
Back to Community

Troubleshooting cURL 28 and Missing Header Errors in WP-Optimize Image Compression

22 threads Sep 16, 2025

Content

Many users of the 'WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance' plugin encounter two frustrating errors when trying to compress images:

  • cURL error 28: Connection timed out after 10001 milliseconds
  • Missing header/body separator: There was an error connecting to the image compression server.

These errors can halt your optimization efforts. Based on community reports and troubleshooting threads, here’s a breakdown of why this happens and the most effective steps to resolve it.

Why Do These Errors Occur?

The image compression feature in WP-Optimize relies on a connection to a third-party API service, reSmush.it. The errors indicate a failure in the communication between your website and the reSmush.it servers. This can be caused by several factors:

  1. Server-Side Blockades: A firewall, security plugin, or hosting provider security policy on your website's server might be blocking the outbound connection to the reSmush.it API.
  2. Local Development Environment: Websites hosted on a local machine (e.g., XAMPP, LocalWP) often cannot establish a successful external connection to the compression service.
  3. reSmush.it Server Issues: Occasionally, the reSmush.it service itself experiences temporary downtime or connectivity problems, which is entirely outside the control of the WP-Optimize plugin.
  4. Incorrect File Paths: If a website has been migrated, old absolute file paths stored in the database can prevent the plugin from locating images to compress, leading to failures.

How to Troubleshoot and Fix the Issue

Step 1: Rule Out Temporary Service Outages

First, check if the problem is widespread. The reSmush.it team has experienced temporary server issues in the past. Try compressing an image again after waiting 30-60 minutes. If the service is down, you will need to wait for the reSmush.it team to resolve it on their end.

Step 2: Investigate Local Server Blocks

If the issue persists, the problem is likely on your side. The most common cause is a blocked connection.

  • Temporarily Disable Security Plugins/Firewalls: Deactivate any security plugins (e.g., Wordfence), web application firewalls (WAF), or server-level firewalls temporarily. Then, attempt to compress an image again. If it works, you know the block was the cause. You will need to whitelist the connection in your security tool's settings.
  • Contact Your Hosting Provider: Ask your host if they are blocking outbound connections to external APIs. Provide them with the error and ask them to whitelist the necessary connections for reSmush.it.

Step 3: Check the Logs for Clues

WP-Optimize provides detailed logs that can help diagnose the problem.

  1. Navigate to WP-Optimize > Images.
  2. Click the blue "View logs" button in the lower-right corner.
  3. Review the log entries for any specific error messages. Phrases like "Cannot establish connection with reSmush.it webservice" often point to a connectivity issue.

Step 4: Special Consideration for Localhost and Migrated Sites

  • Local Development: Image compression typically will not work on a locally hosted site (localhost) because the reSmush.it API cannot connect back to your internal machine. It is recommended to perform compression tasks on a live, publicly accessible server.
  • After Migrating a Website: If you moved your site and now see errors about missing files with old paths, the database still contains references to the previous server's file structure. You will need to update these paths using a database search and replace tool, like the Better Search Replace plugin, to ensure they reflect the new server's absolute path.

Step 5: When to Contact reSmush.it

If you have ruled out all local issues (no firewalls, confirmed with your host, site is live), and the problem continues for an extended period, the issue may require configuration on the API's side. In this case, you can reach out to the reSmush.it team directly through their contact page for further assistance, as they manage the server infrastructure.

Conclusion

The cURL 28 and missing header errors are almost always a connectivity problem. The solution path involves checking for temporary outages, investigating local security blocks, and understanding the limitations of localhost environments. By systematically working through these steps, you can identify the root cause and get your image compression back on track.

Related Support Threads Support