Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Plugin does not work if other plugins change wp_login_url

$
0
0

Replies: 0

I’ve been trying to get the plugin to work in such a scenario where other plugins such as the WP Cerber Security would change the wp_login_url(). Such plugins that do not create custom login pages, but rather creates custom redirect rules, by changing the login/register urls might be the cause I suppose.

In this case, all checks towards the ordinary wp-login.php on my theme is useless as long as there are other plugin blocking any access to it…

The issue I’m facing is that while authorizing an app, the plugin completely fails to display its UI, I mean the authorize screen is the same as the login one, although all url actions are properly set by the plugin.

On my theme I’d generally use something like the following to detect the login/register pages, so I believe a few plugins would use similar checks:

if ( $GLOBALS['pagenow'] === 'wp-login.php' && ! empty( $_REQUEST['action'] ) && $_REQUEST['action'] === 'register' ) {
    // We're registering
}

However, the above does not work at all if I’m blocking access to wp-login.php while setting up a custom url for the login/register pages, so I have to rely on custom checks in order to confirm I’m on those pages, and later on I’d perform more checks to verify if the right action is set…


    // No matter which url is set for the login/register pages this works!
    if(stripos($_SERVER['SCRIPT_NAME'], strrchr( wp_login_url(), '/' ) ) !== false ) {
	require_once( 'custom_login.php' );

        if( isset($_GET['action']) && $_GET['action'] === 'oauth1_authorize' ) {
          // additional stuff
        }
    }

Viewing all articles
Browse latest Browse all 59525

Trending Articles