Support » Plugin: Simple Facebook Connect » [Plugin: Simple Facebook Connect] Bug in the way Like and Share plugins handle images

  • Jen Montes


    I’ve been having trouble with the thumbnails on the Share previews of some of my articles: articles with assigned post thumbnails didn’t show a thumbnail in the Share preview, but articles that didn’t have a thumbnail assigned worked just fine.

    After looking around in the plugin I noticed that for images that have an assigned post thumbnail, the sfc-like.php and sfc-share.php both grab the image like this:

    $att = wp_get_attachment_image_src($thumbid, 'full');

    I’m thinking that this might be causing me problems because my full-sized images are huge and the Facebook code just decides to quit after a while. So I changed the line above to this in both files:

    $att = wp_get_attachment_image_src($thumbid, 'thumbnail');

    And now my thumbnails work fine! If you think thumbnail is too extreme, I think medium would work too.

    Also, there’s another bug in the sfc-like.php code that I wanted to point out… After grabbing the assigned post thumbnail, the code inserts it into the header like this:

    <link rel="image_src" href="<?php echo $att[0]; ?>" />

    When I think you actually meant to do this:

    <meta property="og:image" content="<?php echo $att[0]; ?>" />

    Why am I posting here if I already solved my problem? The truth is that I love this plugin and I’d like to see these fixes integrated so that I don’t have to keep hacking at it whenever there’s a plugin update.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Samuel Wood (Otto)


    I use the full size because Facebook resizes the image themselves. If your full sized images are too big, then maybe you should resize them before uploading. The plugin can’t use anything but full because only the full image is guaranteed to be there. Not everybody does resizing. Not every image gets resized.

    And yes, that code in like is slightly off there. It was copied from the share, which uses the image_src link tag.

    Otto – Even if the original uploaded image is a lower resolution than the large or other image settings, you should still have an image returned. It doesn’t quite make sense to have to resize original images for the sake of Facebook when one of the other image sizes should serve just as well.

    Plugin Author Samuel Wood (Otto)


    I’ll switch it to use ‘large’ for those, but that’s as far as I’m willing to go with it. It doesn’t make any sense to me to send Facebook a lower quality image when you have a higher quality one available. And sending them the thumbnail is just weird, especially since the thumbnail in a lot of setups is a cropped image.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Simple Facebook Connect] Bug in the way Like and Share plugins handle images’ is closed to new replies.