Viewing 13 replies - 1 through 13 (of 13 total)
  • Hello,
    Thank you very much for your contribution to make this product more useful.

    Thanks

    Thank you so much!

    I just downloaded this plugin today and I’m getting the same error.

    Warning: A non-numeric value encountered in /<path-to-wp-install>/wp-includes/media.php on line 647 Warning

    Hi, please can I have the solution to this problem? I did not understand where I have to correct the code

    Anonymous User 9269003

    (@anonymized-9269003)

    This error is shown on profile page in WP Admin on my installation.

    WPChina

    (@wordpresschina)

    Hello, I too am facing this same error. I saw the github fix but I’m unclear how to add it or where to add it and what to add?

    Open the file

    /wp-content/plugins/wp-user-avatar/includes/class-wp-user-avatar-functions.php

    Then look for the function

    public function wpua_get_avatar_original($id_or_email=””, $size=””, $default=””, $alt=””)

    and exchange the code with this:

    public function wpua_get_avatar_original($id_or_email="", $size="", $default="", $alt="") {
        global $avatar_default, $mustache_avatar, $wpua_avatar_default, $wpua_disable_gravatar, $wpua_functions;
        // Remove get_avatar filter
        remove_filter('get_avatar', array($wpua_functions, 'wpua_get_avatar_filter'));
        if((bool) $wpua_disable_gravatar != 1) {
          // User doesn't have Gravatar and Default Avatar is wp_user_avatar, show custom Default Avatar
          if(!$wpua_functions->wpua_has_gravatar($id_or_email) && $avatar_default == 'wp_user_avatar') {
            // Show custom Default Avatar
            if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
             // $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
    			$size_numeric_w_x_h = array( get_option( $size . '_size_w' ), get_option( $size . '_size_h' ) );	
    			$wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, $size_numeric_w_x_h);	
    	 
              $default = $wpua_avatar_default_image[0];
            } else {
              $default = $mustache_avatar;
            }
          } else {
            // Get image from Gravatar, whether it's the user's image or default image
            $wpua_image = get_avatar($id_or_email, $size);
            // Takes the img tag, extracts the src
            $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $wpua_image, $matches, PREG_SET_ORDER);
            $default = !empty($matches) ? $matches [0] [1] : "";
          }
        } else {
          if(!empty($wpua_avatar_default) && $wpua_functions->wpua_attachment_is_image($wpua_avatar_default)) {
    //      $wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, array($size,$size));
    				$size_numeric_w_x_h = array( get_option( $size . '_size_w' ), get_option( $size . '_size_h' ) );
    				$wpua_avatar_default_image = $wpua_functions->wpua_get_attachment_image_src($wpua_avatar_default, $size_numeric_w_x_h);
    
            $default = $wpua_avatar_default_image[0];
          } else {
            $default = $mustache_avatar;
          }
        }
        // Enable get_avatar filter
        add_filter('get_avatar', array($wpua_functions, 'wpua_get_avatar_filter'), 10, 5);
        /**
         * Filter original avatar src
         * @since 1.9
         * @param string $default
         */
        return apply_filters('wpua_get_avatar_original', $default);
      }
    WPChina

    (@wordpresschina)

    Works! Thank you very much.

    This bug is still not fixed, even though a solution was provided?

    Is that bugfix only included in the Pro version?

    WPChina

    (@wordpresschina)

    The plugin developer just issued an update to 2.1.6. However, after upgrading to 2.1.6 I still see the error. So I needed to patch the file again.

    Maybe the developer is not reading this forum?

    it is still not fixed!

    lastminutesocialmedia

    (@lastminutesocialmedia)

    I’ve tried everything y’all have said to fix this. There are MANY errors on my page https://www.thetruekungfu.com. And I have no idea how to fix it!!! Ive searched all the codes. I have looked at the debug file. It says False. Can I get some help??

    Warning: A non-numeric value encountered in /home/trueadmin/public_html/wp-includes/media.php on line 648…there are many like this!!!

    Thread Starter BrianHenryIE

    (@bbrian)

    The publicly visible errors can be hidden. Edit your wp-config.php, find the line define( 'WP_DEBUG_DISPLAY', true ); and change true to false (without quotation marks). If that isn’t found, add it. If that doesn’t work find define( 'WP_DEBUG', true ); and set it to false.

    https://codex.www.ads-software.com/WP_DEBUG

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘FIX: media.php on line 647 – non-numeric value’ is closed to new replies.