• Resolved afterthebreak

    (@afterthebreak)


    Redirect URL when someone tries to access the wp-login.php page and the wp-admin directory while not logged in.

    I’ve set the redirect URL to /blog.

    When visiting [Site URL] /wp-login.php while logged out I get a Fatal Error message: There has been a critical error on this website.

    When visiting [Site URL] /wp-admin while logged out I get redirected to the blog.

    When visiting /wp-admin.php while logged out I get my sites 404 page (Elementor template).

    That’s three different outcomes with two of them expected. Why the Fatal Error though??

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

    (@seinomedia)

    Hello,

    Thanks for using WPS Hide Login.

    Did you check your error logs to know why there is a fatal error ?

    Thread Starter afterthebreak

    (@afterthebreak)

    Hi thank you for getting back. I’ve now investigated further and here’s a summary of what I’ve discovered about WPS Hide Login’s behaviour and the issue:

    As above, the core issue occurs when someone tries to access wp-login.php directly:

    • WPS Hide Login intercepts this request (as it should)
    • However, instead of just redirecting, it tries to load a full template page through its wp_template_loader() method
    • I believe this template loading is happening in plugin.php, specifically in the Plugin->wp_loaded() method

    The problematic code flow:

    • WPS Hide Login catches wp-login.php access
    • Instead of a simple redirect, it calls wp_template_loader()
    • This forces WordPress to load a full theme template
    • This triggers BuddyBoss theme’s header and menu system
    • The menu system then fails because a required class (Menu_Icons_Settings) isn’t available

    Key point: I suppose you could say the error isn’t entirely about WPS Hide Login malfunctioning – in some sense it’s working as coded. However, its approach of loading a full template for wp-login.php access is causing unexpected interactions with BuddyBoss, more directly the theme’s menu system. (And I note that similar issues have been mentioned in the support forum?)

    Suggestion? Perhaps rather than loading a full template for wp-login.php access, WPS Hide Login could simply perform a redirect or return a customisable basic 403/404 response? This would avoid the template loading that’s triggering the BuddyBoss theme’s menu system and causing the error.

    PHP Fatal error: Uncaught Error: Class "Menu_Icons_Settings" not found in /mnt/data/wp-content/themes/buddyboss-theme/inc/plugins/buddyboss-menu-icons/includes/front.php:60

    Stack trace:
    #24 /wp-content/plugins/wps-hide-login/classes/plugin.php(600): WPS\WPS_Hide_Login\Plugin->wp_loaded()
    #23 /wp-content/plugins/wps-hide-login/classes/plugin.php(134): WPS\WPS_Hide_Login\Plugin->wp_template_loader()
    #22 /wp-includes/template-loader.php(106): include(‘…’)
    #21 /wp-content/themes/buddyboss-theme-child/404.php(13): get_header()

    Thread Starter afterthebreak

    (@afterthebreak)

    BTW, even with our child theme’s 404.php disabled, WordPress falls back to BuddyBoss parent theme’s 404.php file (notice line #21 in stack trace changed from buddyboss-theme-child to buddyboss-theme):Copy

    #21 /wp-content/themes/buddyboss-theme/404.php(9): get_header()

    This confirms I believe the earlier analysis that the issue isn’t with the 404 template itself, but rather with WPS Hide Login’s approach of loading the full template system. Looking at the new stack trace, the sequence remains the same:

    1. WPS Hide Login catches the request
    2. Forces template loading
    3. Which loads the 404 template
    4. Which loads the header
    5. Which triggers BuddyBoss’s menu system and fails

    This test reinforces that the issue is WPS Hide Login’s template loading behaviour…
    I look forward to your comment/suggestion.
    Thank you

    Plugin Support MaximeWPS

    (@seinomedia)

    Re @afterthebreak,

    The log message indicates the error is due to BuddyBoss theme. Then, you should contact them to fix it.

    Thread Starter afterthebreak

    (@afterthebreak)

    I carefully explained to you why it has to do with your plugin but you don’t seem to care or respect my time, you just take the easy option of saying it’s an SEP. Shame.

    Plugin Support MaximeWPS

    (@seinomedia)

    I don’t have these issues on my tests and when I ask for any errors in your logs, you share an issue from BuddyBoss :
    PHP Fatal error: Uncaught Error: Class "Menu_Icons_Settings" not found in /mnt/data/wp-content/themes/buddyboss-theme/inc/plugins/buddyboss-menu-icons/includes/front.php:60

    Maybe the third issue you noticed is due to WPS Hide Login but it can also be fixed bye BuddyBoss corrections.

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

The topic ‘Redirection URL doesn’t work’ is closed to new replies.