Giter Site home page Giter Site logo

XML/RPC about lean-wp HOT 4 CLOSED

senlin avatar senlin commented on August 20, 2024
XML/RPC

from lean-wp.

Comments (4)

 avatar commented on August 20, 2024 1

I guess I wouldn't mind paying for it.
The mu-plugin I mentioned earlier is one that I wrote myself already years ago to do part of what now "Lean WP" does better.

Another plugin I use that relies on the Rest API for some of its functionality is "Contact Form 7"

from lean-wp.

senlin avatar senlin commented on August 20, 2024

@mikele3 thanks or your message.

I am not sure if it works to add the filter where Lean WP disables the function back in?

In https://github.com/senlin/lean-wp/blob/master/includes/class-lean-wp.php#L93-L96:

// Disable XML-RPC - //plugins.svn.wordpress.org/disable-xml-rpc/tags/1.0.1/disable-xml-rpc.php
add_filter( 'xmlrpc_enabled', '__return_false' );
// Remove call for XML-RPC from HEAD - @ZenPress //wordpress.stackexchange.com/questions/219643/best-way-to-eliminate-xmlrpc-php#comment350490_219666
add_filter( 'pings_open', '__return_false', PHP_INT_MAX );

Perhaps add a function that triggers later and adds XML-RPC back in?

If that doesn't work, then I will have to add something that you can enable it again, which could either be a settings page or a pluggable function.

Please let me know if it works.

from lean-wp.

 avatar commented on August 20, 2024

@senlin thank you for the quick reply and support.

As I was attempting to re-enable XML-PRC, I eventually realized WP/LR Sync doesn't use that method anymore, but the Rest API.

I tried adding this:
remove_filter('rest_authentication_errors', 'lwp_disable_wp_rest_api', PHP_INT_MAX);
to a mu-plugin I wrote for that site, but with no success.

I resorted to commenting out :
require_once( 'includes/lib/class-lean-wp-disable-rest-api.php' );
https://github.com/senlin/lean-wp/blob/master/lean-wp.php#L38

is there a cleaner way to re-enable the Rest API?

from lean-wp.

senlin avatar senlin commented on August 20, 2024

Glad you found a solution, albeit very temporary @mikele3

is there a cleaner way to re-enable the Rest API?

There could be, but that would involve rewriting the plugin either placing the required files in an init action or by adding a settings page. The latter I have been contemplating, but if I go that way, it will most definitely be a premium version of the plugin.

from lean-wp.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.