XMLRPC failure string should convey disabled status for GET requests, too
|Reported by:||redsweater||Owned by:||josephscott|
Currently if you issues a plain GET request (e.g. by trying to load an xmlrpc.php URL in a browser), you get the error string provided by wp-includes/class-IXR.php:
XML-RPC server accepts POST requests only.
This is not indicative of any configuration problem when XMLRPC has not been enabled for the blog. Compare to wp-app.php which, in a comparable situation, at least indicates the configuration problem:
AtomPub services are disabled on this blog. An admin user can enable them at http://192.168.1.20/wptrunk/wp-admin/options-writing.php
The attached patch changes xmlrpc.php so that it will provide the same type of verbose message as wp-app.php does, allowing clients to see immediately upon trying to access the xmlrpc endpoint URL, that service is disabled:
XML-RPC services are disabled on this blog. An admin user can enable them at http://192.168.1.20/wptrunk/wp-admin/options-writing.php
I think this will have a positive impact on providing support e.g. to users of applications that depend on the API. It's a shortcut when debugging functionality to type in the xmlrpc URL into the browser to make sure it's configured correctly, and not spewing any errors.
While I was at it I factored the generation of the string for disabled XMLRPC into a new method errorStringForDisabledXMLRPC().