• Resolved Robin Labadie

    (@robin-labadie)


    Hello mates,

    With Local Avatars feature enabled, Using Query Monitor and visiting /wp-admin/, I notice a warning:

    Undefined variable $user
    Location: wp-content/plugins/wpmastertoolkit/admin/modules/core/class-local-avatars.php:167

    Error also shows in server logs:

    AH01071: Got error 'PHP message: PHP Warning: Undefined variable $user in /var/www/vhosts/HIDDEN.fr/httpdocs/wp-content/plugins/wpmastertoolkit/admin/modules/core/class-local-avatars.php on line 167; PHP message: PHP Warning: Undefined variable $user in /var/www/vhosts/HIDDEN.fr/httpdocs/wp-content/plugins/wpmastertoolkit/admin/modules/core/class-local-avatars.php on line 167; PHP message: PHP Warning: Undefined variable $user in /var/www/vhosts/HIDDEN.fr/httpdocs/wp-content/plugins/wpmastertoolkit/admin/modules/core/class-local-avatars.php on line 167; PHP message: PHP Warning: Undefined variable $user in /var/www/vhosts/HIDDEN.fr/httpdocs/wp-content/plugins/wpmastertoolkit/admin/modules/core/class-local-avatars.php on line 167', referer: https://www.HIDDEN.fr/

    Lines 167-169:

    167                         if ( ( ! $user || is_wp_error( $user ) ) && ! empty( $id_or_email->comment_author_email ) ) {
    168 $user = get_user_by( 'email', $id_or_email->comment_author_email );
    169 }

    It seems like $user is referenced before it’s defined. Should be an easy fix for you, talented mates!

    All the best

Viewing 1 replies (of 1 total)
  • Plugin Author Ludwig You

    (@ludwigyou)

    Hello,

    Thank you for reporting this! 👏
    You were absolutely right — the $user variable was being referenced before initialization in the Local Avatars module.

    This issue has just been patched, and the fix will be included in the next update (>2.11.0) of WPMasterToolKit.

    Thanks again for your attention to detail and for helping us improve the plugin! 🙌

Viewing 1 replies (of 1 total)

The topic ‘Undefined variable $user class-local-avatars.php:167’ is closed to new replies.