WordPress xmlrpc error 200

We wrote some days ago about a problem with xmlrpc.php in WordPress due to having WP_DEBUG active. Today I have discovered another issue that may prevent xmlrpc.php from working correctly.

This time the problem is that when trying to write with xmlrpc protocol, the response is an error 200. The issue discovered today had to do with the theme being used. This theme had a function defined that was causing some type of return that affected the usage of xmlrpc.

The result was that when loading the page /xmlrpc.php there was a redirection to one post. This was very strange. The normal response has to be:

XML-RPC server accepts POST requests only.

I could identify the problem when I compared the theme I was using with another one (take twentyten for example) where I was getting the correct response.

Since I knew that WordPress loads functions.php every time you load a page, I looked at it and, by trial and error, found that there was a function causing the problem. I wish there was more debugging information about it… but I have not been capable of having access to it.

Now I have put among my to-dos, the task of learning more about how to debug in PHP. I have quickly read through this promising post by IBM: http://www.ibm.com/developerworks/library/os-debug/