-
Notifications
You must be signed in to change notification settings - Fork 4
Indirect access to plugin file #2
base: master
Are you sure you want to change the base?
Conversation
I was planning to change the way the plugin works to use the default Wordpress XMLRPC implementarion. This way will make all the URL to be always known ("/xmlrpc.php"). But about including or not wp-load.php, I need to think about this. Maybe this can solve some compatibility issues I'm having with some plugins, or maybe it can be worst. |
I think the point is wp-load is already called, so no need to go looking
|
I was just alerted to the fact that the client needs to know the location of the php file in order to connect to the service - since the plugin directory could be anything, this makes it harder for the user to set up. Also, as per this post:
http://ottopress.com/2010/dont-include-wp-load-please/
including wp-load.php is a bad idea...
So, here is a proposed change that solves both issues - it accesses the plugin file from bp-xmlrpc-loader.php directly, which eliminates the need for calling wp-load.php. It does this by checking for a GET parameter of "bp_xmlrpc=true", as follows:
http://www.mysite.com/index.php?bp_xmlrpc=true
If this url is accessed, it will include the bp-xmlrpc.php file and exit();
The best part from my end is I can still hardcode the location and have the user only input the base site url. Please let me know what you think.