joshuadavidnelson / disable-blog

All the power of WordPress, without a blog. This plugin removes blog related functionality.
https://wordpress.org/plugins/disable-blog/
GNU General Public License v2.0
52 stars 6 forks source link

Problems with the WordPress-app #50

Closed z1tr0t3c closed 2 years ago

z1tr0t3c commented 3 years ago

Hello,

I like your plugin and used it on a wp-install without the need for a blog, than I wanted to edit some pages with the WordPress-app and the login failed. Is there a possibility to get the wp-app back working again and using the plugin. I really only want to edit some pages on the go with the app ;)

Thank you and best regards, Falk

z1tr0t3c commented 3 years ago

image

joshuadavidnelson commented 3 years ago

Hey there, thanks for reaching out! Sorry you're experiencing this issue. The issue is related to the xmlrpc methods being used by that app, which are disabled by the plugin. I'll take a look as soon as possible and follow up sometime this week.

z1tr0t3c commented 3 years ago

Hi, can you provide me any new information?

joshuadavidnelson commented 3 years ago

Hey there - apologies for the delay here. I confirmed that this is not something in the plugin we can change without updating some code. I'm going to add a new filter in the next release that will give some options for changing this functionality.

In the meantime you may have to disable the plugin or, if you're comfortable editing the plugin code, you can comment out line 337 in includes/class-disable-blog.php from:

$this->loader->add_filter( 'xmlrpc_methods', $plugin_public, 'xmlrpc_methods', 10, 1 );

to

// $this->loader->add_filter( 'xmlrpc_methods', $plugin_public, 'xmlrpc_methods', 10, 1 );

This will stop the plugin from removing the wp.getPosts option and you should be set to use the app.

z1tr0t3c commented 3 years ago

Thank you for the update.

joshuadavidnelson commented 2 years ago

Hey @z1tr0t3c - version 0.5.0 now supports disabling and modifying the methods via a filter:

To stop the plugin from removing any xmlrpc methods from WordPress, drop add_filter( 'dwpb_disabled_xmlrpc_methods', '__return_false' ); into your functions file or a custom plugin file.

You can also use this filter to modify the methods being removed:

add_filter( 'dwpb_disabled_xmlrpc_methods', 'issue_50_example_filter_methods', 10, 1 );
/**
 * Filter the methods being disabled by the plugin.
 *
 * Return false to disable this functionality entirely and keep all methods in place.
 *
 * @since 0.5.0
 * @param array $methods_to_remove an array of all the XMLRPC methods to disable.
 * @return array|bool
 */
function issue_50_example_filter_methods( $methods_to_remove ) {

    // custom logic here to modify the array

    return $methods_to_remove;

}
z1tr0t3c commented 2 years ago

Thank you!