• Resolved inovagora

    (@inovagora)


    Hi WPServeur team and thanks for this great plugin !

    We found two bugs on multisite installs :

    • On the Network “Sites” page, the dashboard links are not replaced (like they are in the “My sites” menu)
      You can use the filter “manage_sites_action_links” to achieve that
    • On multisite where settings for WPS Hide Login are registered on the network but NOT on subsites, the modify_mysites_menu fails to modify the menu, not checking the settings on the network

    Thank you !

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support MaximeWPS

    (@seinomedia)

    Hello,

    Thanks for using WPS Hide Login.

    Why do these elements would be replaced as you’re already logged in ?

    Thread Starter inovagora

    (@inovagora)

    Hello Maxime,

    The reason is a user is not necessarily connected to all the network sites at once (typically if they use different domain names with different cookies).

    A user can be connected to the main site and the network, seeing the other multisite’s sites in the “My sites” menu and on the network “Sites” page, but without being connected to those sites.

    The plugin already fixes this by replacing the links in the “My sites” menu, for coherence it should also replace the dashboard links on the network “Sites” page.

    This can be done with the filter “manage_sites_action_links”.

    For the second point I raised, did you find the bug ?

    Thank you and have a great day

    • This reply was modified 7 months, 2 weeks ago by inovagora.
    Plugin Support MaximeWPS

    (@seinomedia)

    A super-admin user can reach every website on the network in the menu –> Sites but only see the subsites he is admin for in the top bar “My Sites”.

    If a user isn’t super admin, he only see and is able to reach subsites he is admin for by the top bar “My Sites”. But he can’t reach any other subsite.

    Then, WPS Hide Login replaces wp-admin slug for non-logged-in users. If a user is logged in and has the good rights to reach a subsite, this replacement doesn’t apply.

    Thread Starter inovagora

    (@inovagora)

    Maxime,

    Thank you for your answer, here is an example :

    I am super admin on the multisite A. This multisite has WPS Hide Login enabled for all sites. I am logged in on site A.

    This multisite has a subsite B, on which I am admin. I am NOT logged in on site B.

    In the site A admin, I see the site B in the “My Sites” menu, which slug is modified by WPS Hide Login (your plugin function modify_mysites_menu). All good : if I click on the site B link here I will get to the connexion page.

    In the network admin, I see the site B listed on the Sites page with its “Dashboard” link. Problem : this link slug is not replaced by WPS Hide Login (like this is done in the “My Sites” menu), so if I click on it I will get on a 404 page.

    I hope this can lead you to understand the bug I described.

    Plugin Support MaximeWPS

    (@seinomedia)

    Hello,

    The slug in this area is wp-admin. Then, it doesn’t need to be replaced.

    What the issue you encounter ?

    Thread Starter inovagora

    (@inovagora)

    Hello Maxime,

    The issue is just as described in my latest post, if you click on the “Dashboard” link for the B site (which you are NOT connected to) on the Sites page, you get a 404, because “wp-admin” is unreachable when not logged in as it is hidden by WPS Hide Login.

    The slug needs to be replaced on the Dashboard link on the Sites page, exactly just like WPS Hide Login does it in the “My Sites” menu > subsite B > Dashboard.

    In order to fix this you can use the “manage_sites_action_links” filter, and apply the same logic you do for the “My sites” slug replacement.

    Hope you will now understand the bug ??

    This snippet of code should be integrated at the plugin so a super admin can reach the login pages at every site on the multisite without get any 404 when clicking the dashboard link at the site listing page of a multisite


    function modificar_enlace_dashboard( $actions, $blog_id ) {
    $custom_login_slug = ‘YOUR-CUSTOM-LOGIN-SLUG’;
    $dashboard_url = get_site_url( $blog_id ) . ‘/’ . $custom_login_slug . ‘/’;

    if ( isset( $actions['backend'] ) ) {
        $actions['backend'] = '<a href="' . esc_url( $dashboard_url ) . '">' . __( 'Dashboard' ) . '</a>';
    }
    
    return $actions;

    }
    add_filter( ‘manage_sites_action_links’, ‘modificar_enlace_dashboard’, 10, 2 );

    • This reply was modified 1 month, 3 weeks ago by danidorad0.
    • This reply was modified 1 month, 3 weeks ago by danidorad0.
    • This reply was modified 1 month, 3 weeks ago by danidorad0.
    Plugin Support MaximeWPS

    (@seinomedia)

    Hello,

    This has been fixed in the new release.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.