• Resolved Oleksiy

    (@evinak)


    There is an exception thrown for multisite setup due to incorrect count function closing bracket location:

    if ( is_multisite() && ( 1 < count( get_blogs_of_user( $user_id ) || is_super_admin() >>>)<<< ) ) {

    should be

    if ( is_multisite() && ( 1 < count( get_blogs_of_user( $user_id ) >>>)<<< || is_super_admin() ) ) {

    Could you please update?

    Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, bool given in /mnt/efs/wp-content/plugins/google-authenticator/google-authenticator.php:711
    Stack trace:
    #0 /mnt/efs/wp-content/plugins/google-authenticator/google-authenticator.php(365): GoogleAuthenticator->profile_personal_options(Array)
    #1 /mnt/efs/wp-includes/class-wp-hook.php(307): GoogleAuthenticator->user_setup_page('')
    #2 /mnt/efs/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #3 /mnt/efs/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #4 /mnt/efs/wp-admin/admin.php(259): do_action('admin_page_goog...')
    #5 {main}
      thrown
    • This topic was modified 2 years, 7 months ago by Oleksiy.
Viewing 2 replies - 1 through 2 (of 2 total)
  • This fatal error caused all dashboard links to redirect to the plugin settings page after activating it, so the dashboard was completely unusable. I could only deactivate the plugin using WP-CLI.

    Updating line 711 in /wp-content/plugins/google-authenticator/google-authenticator.php with a similar fix as @evinak’s solved the problem:

    if ( is_multisite() && ( is_super_admin() || ( 1 < count( get_blogs_of_user( $user_id ) ) ) ) ) {

    Hope to see an update soon!

    Plugin Author Ivan

    (@ivankk)

    Thanks for reporting @evinak and confirming @priscillamc.

    I’ve pushed a new version 0.54 with a fix.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘BUG: Exception thrown for multisite due to incorrect count function bracket’ is closed to new replies.