• Resolved sebazz

    (@sebazz)


    Hey, I noticed that the plugin has a compatibility issue with user roles when using the Ultimate Membership plugin. The main reason is $user->roles return array without 0 index. And in code, you very often retrieve a role like this $user->roles[0]
    eg:

    includes/classes/Authenticator/Login.php:549
    if ( 'backup_codes' !== $provider && SettingsPage::are_backup_codes_enabled( $user->roles[0] ) && isset( $codes_remaining ) && $codes_remaining > 0 ) {

    includes/classes/Admin/Controllers/class-settings.php:177

    if ( null === $role ) {
        $role = $user->roles[0];
    }

    I temporarily fixed the problem at my site by replacing $user->roles[0] into array_pop($user->roles) but that doesn’t solve the problem globally. I think you should add an util that will get the role regardless of indexes

Viewing 1 replies (of 1 total)
  • Plugin Contributor robertabela

    (@robert681)

    Hello @sebazz

    Indeed, there is a compatibility issue.

    We have prepared a version of the plugin with the fix. Can you please download this version update and install it? This will solve the problem and the fix will be included in the following up, which is to be released within a few weeks.

    Can you please confirm that it is working for you as well? Thanks a lot.

Viewing 1 replies (of 1 total)
  • The topic ‘Issue with Ultimate membership plugin’ is closed to new replies.