XF 2.1 Open Graph image not working on Facebook anymore...

Sal Collaziano

Well-known member
Hey anything changed that might have caused the Open Graph image to not work anymore? I haven't made any changes other than upgrading to the latest version of the software. If nobody else is having a problem then I'll assume it's just something to do with my installation...
 
from my understanding, xenforo has not supported images from forum threads as open graph images out of the box. did they work for you before without using third party addon or manual template changes?
 
By default XF will use the "Metadata Logo URL" as defined in your style properties; out of the box it has never supported using image attachments as the opengraph image.

If you aren't using an add-on to use attachments for the opengraph image and if the logo isn't showing on your FB shares then check your Style Properties to make sure a valid value is provided for the logo (remember to check all of your styles if you are using multiple styles).

If you are using an add-on then you'll need to check with that add-on to see what might be going on. If you've manually done template edits or are using CinVin Style Tweaks to automatically use an attachment image for the opengraph image then the most common issue is that image attachments need to be visible to guests.
 
By default XF will use the "Metadata Logo URL" as defined in your style properties; out of the box it has never supported using image attachments as the opengraph image.

If you aren't using an add-on to use attachments for the opengraph image and if the logo isn't showing on your FB shares then check your Style Properties to make sure a valid value is provided for the logo (remember to check all of your styles if you are using multiple styles).

If you are using an add-on then you'll need to check with that add-on to see what might be going on. If you've manually done template edits or are using CinVin Style Tweaks to automatically use an attachment image for the opengraph image then the most common issue is that image attachments need to be visible to guests.
I only have one style and I do have the Metadata Logo URL set... For some odd reason it has recently stopped working... I guess it's only me.
 
That error is not displayed for this site so it must be something to do with your set up.

If it's happening for all sites and they are all on the same server, then that could be something to look into.
 
I just noticed another error (there was a link to see more)

Missing Properties
The following required properties are missing: og:url, og:type, og:title, og:image, og:description, fb:app_id
 
Okay, here's what my server admin/host said:

We confirmed all the files associated with the request are resolving without issue. Further investigation including internet searching we found [ https://developers.facebook.com/docs/sharing/webmasters ], which specifies the server must enable [ gzip ] and [ deflate ] encodings.

After reading those requests, we confirmed that the domain indeed is not using the requested compressions. With the image being rather large and the server not using any compressions, it would be safe to say this may be the cause of the FaceBook crawler not incorporating the requested image into your post. Moving forward, we would recommend your web developer enables these requests on the server and confirm if the issue has resolved.

I know I've always had GZIP installed on the server since I needed it way back when I started using vBulletin. Is there somewhere in XenForo that I need to set it? Not sure what has changed on my end... I'm not aware of what DEFLATE is...
 
Does your server environment report show gzip is enabled?
It seems gzip is not enabled on my server... This is very strange as I haven't made any change like that... I HAVE upgraded PHP lately. I wonder if while I did the upgrade, I forgot to check a box that had something to do with gzip...
 
I don't really understand your host's response.

Instead of just telling you gzip and deflate are required, why didn't they just check and enable it?
Unless you're on self managed hosting.

Even then, suggesting that it's the XF software which is somehow responsible for those modules is just wrong.

I HAVE upgraded PHP lately.
That is most likely the reason - the build you used has some functions disabled out of the box.
 
I don't really understand your host's response.

Instead of just telling you gzip and deflate are required, why didn't they just check and enable it?
Unless you're on self managed hosting.

Even then, suggesting that it's the XF software which is somehow responsible for those modules is just wrong.


That is most likely the reason - the build you used has some functions disabled out of the box.
It's managed hosting but it seems more and more tasks are requiring extra charges......

In any event, they're working with me on this, at least somewhat, and lead me to a link where I added the following code to my .htaccess file:

Code:
<IfModule mod_deflate.c>
  # Compress HTML, CSS, JavaScript, Text, XML and fonts
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
  AddOutputFilterByType DEFLATE application/x-font
  AddOutputFilterByType DEFLATE application/x-font-opentype
  AddOutputFilterByType DEFLATE application/x-font-otf
  AddOutputFilterByType DEFLATE application/x-font-truetype
  AddOutputFilterByType DEFLATE application/x-font-ttf
  AddOutputFilterByType DEFLATE application/x-javascript
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE font/opentype
  AddOutputFilterByType DEFLATE font/otf
  AddOutputFilterByType DEFLATE font/ttf
  AddOutputFilterByType DEFLATE image/svg+xml
  AddOutputFilterByType DEFLATE image/x-icon
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/javascript
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/xml

  # Remove browser bugs (only needed for really old browsers)
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
  Header append Vary User-Agent
</IfModule>

...but that didn't change anything... That's was for gzip. Maybe I need DEFLATE as well? Man, this stuff used to be so simple...
 
Top Bottom