WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#7292 closed defect (bug) (invalid)

XMLRPC not working with plugins

Reported by: Lokarabia Owned by: Lokarabia
Milestone: Priority: normal
Severity: major Version:
Component: XML-RPC Keywords: xmlrpc
Focuses: Cc:

Description

Test-Case:
Trying to post via a program and the xmlrpc interface results in no output.

Reason:
Seems one of the plugins installed crashes the way xmlrpc.php works. Because you can track to settings.php and there until:

if ( get_option('active_plugins') ) {
$current_plugins = get_option('active_plugins');
if ( is_array($current_plugins) ) {
	foreach ($current_plugins as $plugin) {
		if ('' != $plugin && file_exists(ABSPATH . PLUGINDIR . '/' . $plugin))
					include_once(ABSPATH . PLUGINDIR . '/' . $plugin);
		}
	}
}

FIX:
Put into xmlrpc.php before include('./wp-config.php');: $no_plugins = 1;
Replace the function from settings.php with:

if(!$no_plugins){
  if ( get_option('active_plugins') ) {
	$current_plugins = get_option('active_plugins');
	if ( is_array($current_plugins) ) {
		foreach ($current_plugins as $plugin) {
			if ('' != $plugin && file_exists(ABSPATH . PLUGINDIR . '/' . $plugin))
				include_once(ABSPATH . PLUGINDIR . '/' . $plugin);
		}
	}
  }
}

Guess that should do the trick, because xmlrpc doesn't need any plugins and so it could be prevented that other plugins causing this issue, too.

Cheers,
Thomas

Change History (7)

comment:1 Lokarabia6 years ago

  • Owner changed from anonymous to Lokarabia

comment:2 Lokarabia6 years ago

  • Keywords xmlrpc added

comment:3 DD326 years ago

Then the plugin at fault needs to be fixed.

Plugins can be used to provide extra XML-RPC methods and/or modify the way the API's work, If a plugin is interfering with the standard API, Then the plugin needs to be modified to suit.

Disable them one-by-one until you locate the problem plugin and notify the plugin author, See what they've got to say.

comment:4 redsweater6 years ago

  • Cc redsweater added

Glad to see DD32 already chimed in here. Certainly XMLRPC can benefit from plugins!

Lokarabia, hope you can track down the offending plugin and get the author to fix it up. In general plugins work great with XMLRPC.

Daniel

comment:5 josephscott6 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Absolutely agree with DD32. I'm closing this as invalid.

comment:6 josephscott6 years ago

  • Milestone 2.7 deleted

comment:7 josephscott6 years ago

  • Version 2.5.1 deleted
Note: See TracTickets for help on using tickets.