• Resolved reziliant

    (@reziliant)


    I could not view all the users, see link below and the error logs.

    View post on imgur.com


    WordPress version 5.9.3
    Current plugin: Defender (version 3.2.0)
    PHP version 7.3.33-4+0~20220627.98+debian10~1.gbp40b3e4

    Error Details ============= An error of type E_ERROR was caused in line 242 of the file
    /home/xxxxx/public_html/wp-content/plugins/defender-security/src/controller/two-factor.php.
    Error message: Uncaught TypeError: Argument 1 passed to WP_Defender\Controller\Two_Factor::alter_user_table_row() must be of the type string, null given, called in
    /home/xxxxx/public_html/wp-includes/class-wp-hook.php on line 307 and defined in
    /home/xxxxx/public_html/wp-content/plugins/defender-security/src/controller/two-factor.php:242 Stack trace:
    #0 /home/xxxxx/public_html/wp-includes/class-wp-hook.php(307): WP_Defender\Controller\Two_Factor->alter_user_table_row(NULL, ‘wwlc_rejection_…’, 3738)
    #1 /home/xxxxx/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters(NULL, Array)
    #2 /home/xxxxx/public_html/wp-admin/includes/class-wp-users-list-table.php(592): apply_filters(‘manage_users_cu…’, ”, ‘wwlc_rejection_…’, 3738)
    #3 /home/xxxxx/public_html/wp-admin/includes/class-wp-users-list-table.php(403): WP_Users_List_Table->single_row

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @reziliant,

    Sorry to hear about the issue noticed. However, we have noticed this seems to have occurred if the “Simple Restrict” plugin is installed.

    Do you have the Simple Restrict plugin enabled on your website? Does it work fine if you temporarily disable the Simple Restrict plugin?

    If you are still looking to keep the mentioned plugin active, then please try this snippet as a workaround.

    https://gist.github.com/wpmudev-sls/5efe70d886f7bdb301379f8eb184a3ec

    The above snippet can be added as a mu-plugins. Please check this link on how to implement the above code as a mu-plugins:
    https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Please do let us know how that goes.

    Kind Regards,
    Nithin

    Thread Starter reziliant

    (@reziliant)

    No I dont have “Simple Restrict” just found out it is conflicting with my other plugin
    “WooCommerce Wholesale Lead Capture v1.17.2”.

    Thanks, I will check this with the author.

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @reziliant

    Thank you for the update.

    We have this reported and our developers are looking further and in touch with the WooCommerce Wholesale Lead Capture team too, so far, we found the Wholesale Lead Capture plugin is converting the output of a hook into null and by default, this hook expects a string and it is causing the problem, however, we are already looking into this problem.

    Please, keep both plugins updated.
    Best Regards
    Patrick Freitas

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @reziliant

    I hope you are doing well.

    Just an update here.

    Our developer found the problem is happening in:

    File path /woocommerce-wholesale-lead-capture/includes/class-wwlc-user-custom-fields.php ,
    method wwlc_add_user_listing_custom_column_content
    condition:

    
    } elseif ( $column_name == 'wwlc_rejection_date' ) {
    
       if ( in_array( WWLC_REJECTED_ROLE , $user->roles ) ) {
    
          $rejection_date = get_user_meta( $user->ID , 'wwlc_rejection_date' , true );
    
          return "<span class='wwlc_rejection_date'>" . $rejection_date . "</span>";
    
       }
    
    }

    it does not contain a condition if a user role is not equal to WWLC_REJECTED_ROLE so they must apply an else there too:

    } elseif ( $column_name == 'wwlc_rejection_date' ) {
    
       if ( in_array( WWLC_REJECTED_ROLE , $user->roles ) ) {
    
          $rejection_date = get_user_meta( $user->ID , 'wwlc_rejection_date' , true );
    
          return "<span class='wwlc_rejection_date'>" . $rejection_date . "</span>";
    
       } else {
            // New code:
    		return  $val;
    	}
    
    }

    Then the page will work as expected:

    https://monosnap.com/file/usOi6U6XQMaoMTn9UfPRdYYKffhFI7

    I suggest forwarding this report to WooCommerce Wholesale Lead Capture support so they can apply the necessary fixes.

    Best Regards
    Patrick Freitas

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @reziliant

    I hope you are doing well and safe!

    We haven’t heard from you in a while, I’ll mark this thread as resolved.

    Feel free to let us know if you have any additional questions or problems.

    Best Regards
    Patrick Freitas

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Defender 3.2.0 broke my site, unable to view user list’ is closed to new replies.