• Resolved Maxime Jobin

    (@maximejobin)


    First, awesome plugin!

    We’ve used the plugin on our website for 2 year… never had an issue.

    A couple of days ago, we updated the following plugins:
    WooCommerce => 5.3 to 5.4.1
    Admin Columns Pro => 5.5.2
    Storefront => 3.7.0

    Since then, clicking on “Switch to” produces 404 not every time… but really often.

    I’ve noticed that when the 404s happen, the plugin did not create the cookies (wordpress_user_sw_*).

    There are absolutely no errors in debug.log.

    I’ve created a dev website but cannot reproduce, at this point, the error.

    Any tips or suggestions about that problem? Are we the only ones?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Is the 404 shown for the wp-login.php page or for the page you get redirected to afterwards?

    Not sure what the problem could be but the best advise is to try deactivating your other plugins one by one to see if you can identify the culprit.

    Thread Starter Maxime Jobin

    (@maximejobin)

    I see this link in the address bar:
    https://xxxxxx/wp-login.php?action=switch_to_user&user_id=1145&nr=1&_wpnonce=d6b4fb8b2

    … and the 404 page is displayed.

    When it works, we are redirected to WooCommerce account page.

    Thread Starter Maxime Jobin

    (@maximejobin)

    The function get_redirect(…) sometimes returned a URL and sometimes an empty string. That was the issue causing the plugin to fail.

    For some reason, one plugin was outdated and did not show that an update was available (WooCommerce Subscriptions).

    I manually updated the plugin and it seems like everything is back to normal.

    I want to thank you for your time and your great plugin!

    Thread Starter Maxime Jobin

    (@maximejobin)

    Thread Starter Maxime Jobin

    (@maximejobin)

    I’m closing this.

    This had nothing to do with the latest update. Around the same date, the web hosting provider added rules to their firewall which blocked 95-98% of requests made by User Switching.

    As it’s a shared host, I don’t know exactly what was added to affect “only” user switching. After rules modification, everything went back to normal.

    Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    That’s good to hear, thanks for letting me know.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Getting 404 when clicking on “Switch to”’ is closed to new replies.