html_meta_tags, og:image

Hello to everyone. Sorry for my bad English.

I'm trying to use OpenGraph, but og:image doesn't work. According to source of html_meta_tags, $thumb variable is aways empty (on any pages of gallery). I'm using Zenphoto 1.4.14 [f5b47da52f] (Official build) with html_meta_tags and Graphics support: PHP GD library bundled (2.1.0 compatible). Other OG tags working perfectly.


  • acrylian Administrator, Translator

    You only get an og:image automatically if you are on an image page, album page or single image. For all other pages the "site logo" if set on the plugin option of the same name is used. We use it that way on our own site as you can see if you view the source.

  • Thanks for answer. og:image doesn't work on image page, index page and on album page. How to enable debug mode for the plugin? I'm not programmer, and dirty hacks like "echo $var" doesn't work for plugin debug.

  • acrylian Administrator, Translator

    As you can see on our own site it does work. So I suggest to review your error logs (Zenphoto's debuglog and the server PHP log)

  • Anyway, thanks.

    And special thanks for Zenphoto script. 8 years Zenphoto works on my site. Fast, reliable, simple. Thanks alot.

  • acrylian Administrator, Translator

    Thanks. Sorry that I can't help more right now as it seems to work for me. Let us know if you find out anything further.

  • Working here too, but I have a question. I checked my site's meta tags, and when I first view the page source, I see the following for og:image:!&check=57250ae6980eeec9a59158a47a4c7a72cce356a5

    However if I hit reload for the page source, I get a more typical:

    What's this all about? Is it just the browser doing this?

  • acrylian Administrator, Translator
    edited October 2017

    Just cached image versus uncached image, should appear only once. Also please review the user guide entry on caching about this.

  • I found error. In html_meta_tags code row 192:

    if (getOption('htmlmeta_og-image') || getOption('htmlmeta_twittercard')) {

    In my configuration, Opengraph was enabled, twitter-card was not. After enabling twitter-card, og:image working fine.

    Also, I noticed that the plugin settings are not saved options property=og:*. When i save, the checkbox is only on option "OpenGraph (og:)". Options property='og:*' even being marked, after saving remains unchecked. Apparently, this affects the selection at row 192. At the same time, if twitter-card enabled, everything starts to work. Why not save the status of the options when saving, I don't know, maybe it's a problem of my system. But keep this in mind.

  • acrylian Administrator, Translator

    Thanks for insisting on this issue. This is indeed a bug respectively omission from an earlier change.

    There should be only one OpenGraph option - except the image width/height ones - as most of these are required for the meta tags to be valid (og:image without all others would be).

    FIx will be in the support build soon.

  • If you're making changes then can I suggest one other? I ran some pages through the Facebook debugger and the only error message that I got was that
    meta property="fb:app_id" content="xxxxxxxxxxx"
    was missing, so I edited the plugin so that I could enter this in the plugin settings and have it included. This is not a serious omission, but I was trying to eliminate all FB error messages.

  • acrylian Administrator, Translator

    Sure, I can add that.

  • Reminds me, I need to make some changes in mine. I made my own plugin out of html_meta_tags.php to keep updates from wiping out my changes to it. I modified the code to use my normal image for the og:image.

  • acrylian Administrator, Translator

    Sometime in the future we probably will provide a filter so you can modify the output without customizing the plugin itself.

  • i have some questions:

    • what is the FB app id ?
    • what the use of Open graph image - height / width ?
  • acrylian Administrator, Translator
    edited November 2017

    The Facebook app id is a means for Facebook to identify your site for metrics. Similar to the Google site verification id (which I will incorporate into html_meta_tags as well).

    Open Graph allows setting a size, that's it for. Social networks have recommendation for the size that change constantly. So you can never match all but you can at least set the lowest common denomator size here. The size is uncropped as the networks do what they think anyway…

  • vincent3569 Member
    edited November 2017

    googleVerify is a core plugin. You will incorporate it into html_meta_tags?

    btw, I am not sure:
    for <meta property="og:image" [...]> and <script type="text/javascript"> var caches = [...]</script>
    the cache url for the image is never used and stays with the /zp-core/i.php?a=album_name&i=image_name&[...] structure.

  • acrylian Administrator, Translator
    edited November 2017

    googleVerify is a core plugin. You will incorporate it into html_meta_tags?

    Yes, as I wrote above. Does not make sense to have a separate plugin for just one meta item.

    I have to look at that cache urls. Actually it should be used only once as always unless you cache the page before it is cached. If you look into the source of our site (album or image page) you see it is the cached url. That js for the uncached urls is rather a workaround anyway…

Sign In or Register to comment.