Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Marcus Campbell

    (@scronide)

    Hey @lucianwpwhite

    Here’s the full error output that gets generated using the patched version. They are the same warnings in my original post, really, but there are more of them now that the fatal error has been fixed:

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    Warning: Undefined array key "manage_options" in /var/www/origins/htdocs/wp-content/plugins/wp-2fa/includes/classes/Admin/Helpers/class-user-helper.php on line 934

    This is on a site that has 3 roles, none of which have the manage_options capability. So I assume get_user_role() gets called 4 times per page for me. The warnings are generated on pretty much every admin page on the affected site.

    Thread Starter Marcus Campbell

    (@scronide)

    Hey @robert681

    Thanks for looking into this! To answer your earlier question: yep, without the patch I’m still able to use the 2FA plugin across other sites ok.

    I was able to confirm that the patch fixes the fatal error. Thanks!

    Less of a problem, but I noticed that the code still produces multiple “undefined array key” warnings for me on PHP 8 because of this line:
    if ( $admin_role_set['manage_options'] ) {

    These could be avoided by doing an isset() check or maybe an array_key_exists() instead:
    if ( isset( $admin_role_set['manage_options'] ) ) {

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