Tag Archives: debug

WordPress XML-RPC Endpoint Validator

WordPress uses the XML-RPC remote publishing interface in order to provide a standardized way to transfer data between 3rd party clients, like mobile/desktop apps, and the core of the CMS. These 3rd party clients may ask for something like an XML-RPC (or API) endpoint, which will usually is your blog domain followed by “xmlrpc.php". So, for example, if your site was at daniloercoli.wordpress.com, your endpoint would be:

https://daniloercoli.wordpress.com/xmlrpc.php or https://daniloercoli.wordpress.com/xmlrpc.php

The Endpoint requires username/password, this is the same username and password that you use to login to WordPress, and it’s secure like the browser login.

Themes and Plugins can interact and change the behavior of the XML-RPC Endpoint, by adding new methods, or modifying the response document. There are actually a lot of plugins that interact with it in some way, but unfortunately, plugins and themes could break the XML-RPC endpoint,  or invalidate the XML response document. When I need to reply to a question about the EndPoint that’s not working on a self-hosted installation of WordPress I usually reply with the following words:

Did you try with the default theme and with no active plugins?

Trying it with the default theme and plugins disabled will help pin down where the problem is. If everything works then you go back and enable your theme and then try it again. If everything still works then you go back and activate each plugin one at a time until you find the one that is causing the breakage.

The Validator
Since my team and I usually spend a lot of time replying to questions on issues on the XML-RPC endpoint of WordPress sites, I’ve decided to write a web tool that can be used to easily test the Endpoint. This tool should speed up our work, and will give to users a simple way to test the endpoint of their sites. I wrote this tool in PHP (https://github.com/daniloercoli/WordPress-XML-RPC-Validator), by using WordPress as framework, and for simplicity in this first release it’s a plugin that adds a page to your site. That page embeds the XML-RPC validator. It does some XML-RPC calls to your blog, checks the response documents, and in case of errors gives back hints on how to fix the issue. At this moment it’s just an experiment, no fancy UI there, but I will probably improve it over the time. A live version of the validator is available here.  Please, contribute to the project 🙂

 

Resources

Setup the BlackBerry simulator for testing and debugging web sites

Debugging mobile web applications and sites could be a painful process on the BlackBerrry Java platform, since BlackBerry simulators don’t look up the system host file, and do not offer any mechanism to route HTTP traffic over a web proxy.  Those things are necessary when:

  • You need to spoof the IP of the remote host.
  • You are running a local copy of the web site on your dev machine.
  • You are behind a proxy.

The solution is to use the MDS-CS Simulator, that is available in the JDE folder as well in the Eclipse plugin folder, but  the setup/configuration could be a little tricky and it could take a lot of time.  That’s said, I wrote the followings “how-to” hoping it could help other developers.

  •  Make sure your port 8080 is not binded by any process. If that port is already in use you need to change the MDS configuration, by editing the file at plugins\net.rim.eide.componentpack#.#.#_#.#.#.##\components\MDS\confing\rimpublic.property and changing the WebServer.listen.port entry to something else.
  • Enable HTTP and HTML logging in the BlackBerry MDS Simulator by following the instructions here.
    Log files will be written at the following path ..\plugins\net.rim.eide.componentpack#.#.#_#.#.#.##\components\MDS\logs\
  • Modify the batch file and/or command used to start the BlackBerry smartphone simulator, appending the following command:
    /app-param=MdsIP=127.0.0.1
  • Start the MDS-CS Simulator. Wait until it is fully started.
  • Launch the BlackBerry smartphone simulator.
  • Open the connection settings in the BlackBerry smartphone simulator and turn off the WiFi radio.
  • In the BlackBerry smartphone simulator go to Options -> Device -> Advanced System Settings -> Service Book.
  • Delete the TCP service books listed (highlight them and choose Delete from the menu). You may need to delete those entries each time the simulator is started.
  • Open the browser and load the page. You should see the a lot of entries in the log of the MDS-CS server.

If you are behind a proxy, in addition to the instructions above, you should follow the steps published here.

You can also install Charles or fiddler2,  run one of them locally, and sniff the HTTP traffic, even for the HTTPS protocol.  I found a good article about sniffing the web traffic on the BlackBerry simulator here.

Debugging the PhotoChooserTask and other media related tasks on WinPhone 7

Some choosers, such as the PhotoChooserTask, can’t be accessed while the Zune software is running because it locks the local media database. Fortunately there is a tool that solves the problem by removing the need to have “Zune” running during the debug session. It’s called the Windows Phone Connect Tool. Details and instructions here.