Solving Plugin Problems

Posted: 5th Apr 2008, in: plugins - Older Post - Newer Post

Since releasing the first version of my Fun with Sidebar Tabs plugin I have learned a great deal about resolving plugin problems, so I thought I would share a few of the techniques that have proved valuable. I hope this will be as useful to people with problems on their blog as for authors that release their own plugins.

Figuring out why a plugin isn’t working when you don’t have access to the backend, i.e. it is a problem on someone else blog, or if you don’t really understand the code anyway, can be difficult but there are a few good indicators of what might be going wrong.

In many cases the only obvious indication you get is that it just doesn’t work, so where do you look?

I want to specify in no uncertain terms the necessity of reading, in full, the instructions before making assumptions about whether it works or not. I know I have downloaded things assuming they would work in a certain way and had to go back and re-read the instructions when they didn’t, and it was almost always my fault. Make sure it is intended for your version of WordPress as well.

But having done that, and there is still a problem, what now?

The first thing to check is the source of the page that is produced. Plugins that output content using PHP often do it inside other tags that aren’t immediately visible, so check the source code for warnings or errors that seem out of place. They should be fairly obvious if they are there.

If you find that error there probably isn’t much you can do so contacting the author is probably best first step. If you are the author you should know what to do from here.

If the plugin uses Javascript this can be harder to resolve. In that instance check whether there are any Javascript errors showing. Check the error console in Firefox, or the bottom left of the status bar in IE to see if there are errors.

One of the chief causes of my plugin breaking was Javascript errors being triggered before the page was loaded, or before my Javascript was loaded which just stopped mine running. The first indication that there was a problem was that my plugin didn’t work, even though it wasn’t the cause of the problem.

Another thing to check is for plugins that load their own versions of frameworks. WordPress has a system of registering and loading scripts that can be plugged into but some plugins just insert a link to the framework themselves. With the release of WordPress 2.5, which uses Prototype version 1.6, there may be errors where plugins load their own copy of Prototype 1.5, thereby overriding functionality that is expected. I have come across at least one since the release of 2.5

Finally, there is the problem of CSS. CSS priority, i.e. more specific rules, or IDs rather than classes overide other rules, can be a real problem with so many different bits of CSS being loaded and no knowledge of the theme that is being used. Firebug, the firefox development plugin, is essential to figure this stuff out in my opinion. It shows what rules apply and what have been overruled.

Finally, of course, you can turn off all your plugins and turn them on one by one to find out where the conflict lies.

I will add more to this post as and when things occur; however, in the meantime, if you have any tips or suggestions for finding out what is wrong with a plugin or what may be conflicting with it please let us know.

 

Comments

Leave a Reply

I am currently testing a comment link policy which means commenters do not get a link. There is a poll, and open comments for feedback on the comment policy page.

Please note. I am currently using an experimental antispam technique on this blog. If you run into problems please let me know using the Get in Touch link at the top of the page. Thanks, Andy.

Subscribe without commenting

Feed Icon - Get fed with RSS