Support » Plugin: All In One WP Security & Firewall » Some codes not running perfectly in a subsite of a multisite install

  • Hi. I was trying to remove this tag from my HTML code:

    <link rel="EditURI" type="application/rsd+xml" title="RSD" href="https://www.localdomain/xmlrpc.php?rsd" />

    Because it points to a broken link, when Completely Block Access To XMLRPC is set.

    I included the following code inside the script wp-security-general-init-tasks.php
    :

    // Do init time tasks
    global $aio_wp_security;
    // +++++ added code +++++
    if ($aio_wp_security->configs->get_value('aiowps_enable_pingback_firewall') == '1') {
    remove_action( 'wp_head', 'rsd_link' );
    }

    However, I noticed that it works only in the root site of my multisite install. In a subsite, the variables:

    $aio_wp_security->configs->get_value('aiowps_enable_pingback_firewall')
    ($aio_wp_security->configs->get_value('aiowps_disable_xmlrpc_pingback_methods')

    are always empty! Not only my added code will not run; your code below does not run either in a subsite:

    // your code
    if ($aio_wp_security->configs->get_value('aiowps_disable_xmlrpc_pingback_methods') == '1') {
        add_filter( 'xmlrpc_methods', array(&$this, 'aiowps_disable_xmlrpc_pingback_methods') );
        add_filter( 'wp_headers', array(&$this, 'aiowps_remove_x_pingback_header') );
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, please check the following documentation to learn how our plugin works in a multisite environment.

    https://mbrsolution.com/wordpress/securing-wordpress-multisite-with-aiowps-plugin.php

    Let me know if the above helps you.

    Thank you

    Thread Starter aldemarcalazans

    (@aldemarcalazans)

    Hi. I solved the problem doing that:

    //remove xmlrpc.php? link from the head of the page, in any site, when Completely Block Access To XMLRPC is set
    // +++++ added code ++++
    $configs = get_blog_option( 1, 'aio_wp_security_configs' );
    if ( $configs['aiowps_enable_pingback_firewall'] == '1') {
        remove_action( 'wp_head', 'rsd_link' );
    }
    // +++++

    This is because the Firewall configuration I needed is stored only in the main site of the install (it is not a per site config).
    I suggest you using in all network wide configs:
    get_blog_option(1, 'xxxx')
    instead of:
    get_option('xxxx')
    to turn the plugin more multisite compatible

    Plugin Contributor mbrsolution

    (@mbrsolution)

    Hi, thank you for sharing your solution. I have submitted a message to the developers to further investigate your findings/solution.

    Kind regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Some codes not running perfectly in a subsite of a multisite install’ is closed to new replies.