Subscribe via

How to Troubleshoot WP Minify

Thaya Kareeson

WP Minify is supposed to work out of the box for many cases. That being said, there will always be plugins that conflict with WP Minify because of the nature of this plugin. In this post, I will show you how to troubleshoot these issues for yourself before you have to hit the plugin support forum.

How does WP Minify Work?

When activated, the plugin does the following:

  1. WP Minify intercepts theme rendering at the get_header WordPress hook and puts everything that is echoed/outputted from the PHP code into an output buffer.
  2. WP Minify then intercepts theme rendering again at the get_footer WordPress hook to stop the output buffer.
  3. The plugin then evaluates the page content to extract all JavaScripts and stylesheets out.
  4. The minified version of these JavaScripts and stylesheets are then re-injected into the content.
  5. The page content is echoed/outputted as normal.

General Debugging Tips

There’s an easier way to debug broken scripts now, see Troubleshooting WP Minify with FirePHP

Almost all issues can be resolved using the following debugging technique.

Here is what you will need

Here are the steps you need to take

  1. Load your site with the following Firebug options enabled.
    Firebug Enabled
  2. Go to the “Net” tab in Firebug and you will probably see a URL that is highlight in red and returning 400.
    Broken WP Minify Call
  3. Copy this broken URL and drop it address bar in a new browser window and make sure that it really does return a 400 error code.
  4. The minify URL is in the form of “http://example.com/wp-content/plugins/wp-minify/min/?f=” followed by a comma delimited list of files. You should try removing each file one by one from this list until the Minify call works (returns the minified version of all of these files).
  5. Once you find the JavaScript or CSS file that is causing minification to break, you can exclude that file in WP Minify options.

Why do some JavaScript/CSS files conflict with WP Minify?

The authors of the Minify engine were nice enough to draft a wiki listing common problems when running JavaScript and CSS files through Minify. I suggest that you take a look at that document if you are planning to troubleshoot your JavaScript and CSS files instead of just excluding them in WP Minify options.

I still can’t get it to work!

If all else fails, there is always the plugin support forums.

Save and Share
StumbleUpon
Reddit

Leave a Reply