Language that does not complain -> confusing bugs

Today I had to debug a clients site.

You see, the slider was broken.

Why?

The slider javascript wasn’t being loaded.

Why?

The entire lower portion of the html is non-existent.

Even the caching plugin’s status information is missing.

The html’s last words were “<!– mfunc”, a harmless comment. Let’s pay attention to where the comment was.

It was where the sidebar should have been.

Let’s look in the sidebar template file.

That’s odd, the template uses a special php function that stops php from sending the html to the browser until you call a second special function.

Maybe a bug is stopping this second function from being called.

Let’s add other random comments to see if they show up.

They do. Thus it cannot be the special function.

So what is it? Lets see what the supposedly harmless comment is.

It’s magic.

Or that is to say, it is way for a plugin to run code indirectly if the site is being cached.

All added with a wordpress hook, a way for a plugin to indirectly run code during html generation.

Yes! A plugin is indirectly-indirectly running code, and this code is crashing.

And that is the real bug.

I just wish finding it was quicker.

Leave a Reply

Your email address will not be published. Required fields are marked *