• Resolved brunosette

    (@brunosette)


    Hello everyone,

    I am hoping someone can help me troubleshoot an issue I am experiencing with my WordPress website that is using the Ultimate Member plugin.

    Some of my users are being redirected to the login area when they try to open specific posts, even though these posts should be accessible to all users. The strange thing is that this issue is only occurring for some users and there seems to be no rhyme or reason for it.

    I have tried to identify any commonalities between the users experiencing the issue, but so far, I have been unable to find any. I have also checked the plugin settings and the post permissions, and everything seems to be in order.

    If anyone has experienced a similar issue or has any suggestions for what I can do to fix this, I would greatly appreciate your input.

    Thank you in advance for your help!

    Best regards,

    Bruno

    Screen capture of the problem: https://drive.google.com/file/d/1q8E51fjQgc_xl1r66n2ydMcXAWEATDjl/view?usp=share_link

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter brunosette

    (@brunosette)

    2023-05-03 19:22:46 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:22:47 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:25:35 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace:
    2023-05-03 19:25:36 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace:
    2023-05-03 19:29:43 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/wp-admin/post.php?post=1426&action=edit&message=4, stack trace:
    2023-05-03 19:40:30 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:41:18 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:41:19 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace:
    2023-05-03 19:41:35 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace:
    2023-05-03 19:42:20 redirect by WordPress, 302, /nefroupdates/wp-login.php?action=rp&wp_lang=pt_BR, stack trace:
    2023-05-03 19:43:03 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates, stack trace:
    2023-05-03 19:49:29 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:49:30 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace:
    2023-05-03 19:49:56 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace:
    2023-05-03 19:54:42 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:56:13 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:28:43 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:29:08 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:29:09 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:29:10 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace:
    2023-05-03 20:30:08 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace:
    2023-05-03 20:31:17 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/wp-admin/post.php?post=1409&action=edit&message=4, stack trace:
    2023-05-03 20:44:28 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:44:28 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace:
    2023-05-03 22:10:50 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414

    Thread Starter brunosette

    (@brunosette)

    2023-05-03 19:22:46 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:22:47 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:25:35 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace: 
    2023-05-03 19:25:36 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace: 
    2023-05-03 19:29:43 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/wp-admin/post.php?post=1426&action=edit&message=4, stack trace: 
    2023-05-03 19:40:30 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:41:18 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:41:19 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: 
    2023-05-03 19:41:35 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace: 
    2023-05-03 19:42:20 redirect by WordPress, 302, /nefroupdates/wp-login.php?action=rp&wp_lang=pt_BR, stack trace: 
    2023-05-03 19:43:03 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates, stack trace: 
    2023-05-03 19:49:29 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:49:30 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: 
    2023-05-03 19:49:56 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace: 
    2023-05-03 19:54:42 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 19:56:13 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:28:43 redirect by WordPress, 302, https://www.nefroatual.com.br/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:29:08 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:29:09 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:29:10 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: 
    2023-05-03 20:30:08 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace: 
    2023-05-03 20:31:17 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/wp-admin/post.php?post=1409&action=edit&message=4, stack trace: 
    2023-05-03 20:44:28 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414
    2023-05-03 20:44:28 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: 
    2023-05-03 22:10:50 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: ultimate-member/includes/core/class-access.php:1414

    @brunosette

    Thanks.
    No PHP errors in the Debug log.
    I have updated the code snippet writing your redirects to get more details.
    Replace your current code snippet with this code snippet.

    add_filter( 'x_redirect_by', 'wp_redirect_custom_log', 10, 3 );
    
    function wp_redirect_custom_log( $x_redirect_by, $location, $status ) {
    
        global $current_user;
    
        $traces = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT );
        $plugin_trace = array();
    
        foreach ( $traces as $trace ) {
            if( isset( $trace['file'] )) {
    
                if ( strpos( $trace['file'], '/plugins/' ) > 0 ) {
                    $file = explode( '/plugins/', $trace['file'] );
                    if( substr( $file[1], 0, 22 ) != 'wp_redirect_custom_log' ) {
                        $plugin_trace[] = $file[1] . ':' . $trace['line'];
                    }
                } 
    
                if ( strpos( $trace['file'], '/themes/' ) > 0 ) {
                    $file = explode( '/themes/', $trace['file'] );
                    $plugin_trace[] = 'T: ' . $file[1] . ':' . $trace['line'];
                }
    
                if ( strpos( $trace['file'], '/wp-includes/' ) > 0 ) {
                    $file = explode( '/wp-includes/', $trace['file'] );
                    $plugin_trace[] = 'WP: ' . $file[1] . ':' . $trace['line'];
                }
            }
        }
    
        $trace = date_i18n( 'Y-m-d H:i:s ', current_time( 'timestamp' )) . 'user_id ' . $current_user->ID;
        $trace .= ' redirect by ' . $x_redirect_by . ', ' . $location . ', ' .  $status . ', ';
        $trace .= 'stack trace: ' . implode( ', ', $plugin_trace );
    
        file_put_contents( WP_CONTENT_DIR . '/debug.log', $trace . chr(13), FILE_APPEND  );
    
        return $x_redirect_by;
    }
    Thread Starter brunosette

    (@brunosette)

    2023-05-04 01:38:56 user_id 0 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/wp-admin/, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425
    2023-05-04 01:43:49 user_id 0 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/planos, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, ultimate-member/includes/core/class-access.php:1414, WP: class-wp-hook.php:308, WP: plugin.php:256, WP: class-wp-query.php:3505, WP: class-wp-query.php:3787, WP: class-wp.php:663, WP: class-wp.php:783, WP: functions.php:1334
    2023-05-04 01:43:50 user_id 0 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, WP: canonical.php:801, WP: class-wp-hook.php:308, WP: class-wp-hook.php:332, WP: plugin.php:517, WP: template-loader.php:13
    2023-05-04 01:43:57 user_id 0 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, WP: pluggable.php:1537
    2023-05-04 01:45:33 user_id 1 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, WP: pluggable.php:1537
    2023-05-04 01:48:36 user_id 0 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/wp-login.php?redirect_to=https%3A%2F%2Fwww.nefroatual.com.br%2Fnefroupdates%2Fwp-admin%2F&reauth=1, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, WP: pluggable.php:1240
    • This reply was modified 1 year, 6 months ago by brunosette.
    Thread Starter brunosette

    (@brunosette)

    2023-05-04 01:51:47 user_id 0 redirect by WordPress, 301, https://www.nefroatual.com.br/nefroupdates/planos/, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, WP: canonical.php:801, WP: class-wp-hook.php:308, WP: class-wp-hook.php:332, WP: plugin.php:517, WP: template-loader.php:13
    2023-05-04 01:51:48 user_id 0 redirect by WordPress, 302, https://www.nefroatual.com.br/nefroupdates/wp-login.php?redirect_to=https%3A%2F%2Fwww.nefroatual.com.br%2Fnefroupdates%2Fwp-admin%2F&reauth=1, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, WP: pluggable.php:1240

    @brunosette

    WP is doing the redirect because of “The cookie is no good, so force login.”

    If you have any security plugin active try to deactivate the plugin.

    Thread Starter brunosette

    (@brunosette)

    I don’t have any security plugin but I’m using cloudflare. Could that be the problem? They have their own security system.

    @brunosette

    My interpretation of your log:

    The last two redirect log entries you posted from 2023-05-04 01:51:47 where you first had a redirect to your site’s /planos/ page which was changed to wp-login by the WP function auth_redirect() in the file pluggable.php at line 1240 with the comment “The cookie is no good, so force login.”

    Thread Starter brunosette

    (@brunosette)

    What do I do to correct tis problem?

    @brunosette

    https://developer.www.ads-software.com/reference/functions/auth_redirect/

    WP expects the user to be logged in when this function auth_redirect is called.
    Your user was not logged in.

    After logging in WP will redirect this user to and now login is required for this page
    https://www.nefroatual.com.br/nefroupdates/wp-admin/&reauth=1
    because WP consider the user going to this page.

    Your comments?

    Plugin Support andrewshu

    (@andrewshu)

    Hi @brunosette

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. ??

    Regards

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘User redirect to login in some specific posts’ is closed to new replies.