Simple php page that decides card contents depending on a GET parameter. If I take GET parameter off, it uses my default values for everything and renders the card correctly. But if I use the GET parameter, the card wont have image, it only has the text contents that are related to this parameter.

    <meta name="twitter:card" content="summary_large_image" />
    <meta name="twitter:title" content="<?php echo $ogtitle; ?>" />
    <meta name="twitter:description" content="<?php echo $ogdesc; ?>" />
    <meta name="twitter:image" content="<?php echo $ogimage; ?>" />
    <meta name="twitter:image:alt" content="<?php echo $ogdesc; ?>" />

Even my default values are rendered by php and fetched from the very same database before rendering.
Only difference is the GET parameter, and the fact that when it’s set, php will fetch another image name from database before rendering anything.
But, without the parameter, it will anyways fetch the default image name from same database. And all images are in very same folder, so they surely are available (also by robots.txt).

Php structure goes like this:

  1. pdo->fetch image name and strings for meta data
  2. if(isset($_GET[‘p’])){ pdo->fetch another image name and strings
  3. render

And as said, this works well on other social medias.

I’ve tried every solution I’ve found, but nothing helps. I even got a real domain as I ended up thinking the cause was straight server address, and after that the only thing missing was SSL. But now when I got https set up, even it wont solve the issue.

Unfortunately I can’t provide url to this, but I hope someone might be able to tell me what can cause this. Only solution I now have, is to ditch the get parameter and instead of having a dynamic php page, breaking it into multiple individual pages. But that shouldn’t be the solution.

Edit:
To be add, it’s a bit depressing to see that even the example of summary_large_image at developer.twitter.com has only the image placeholder.

Huh, and now after posting this here I finally solved the issue… So after all this was a simple issue, or actually combination of two issues.

First, my images were too big! Not by filesize, but resolution! They were around 0.6MB, but resolution for all of them - except the default image - was around 8000x6000.

Secondly, as I first thought I needed to have https for everything, it seems that images must use http for some reason. Which is kinda odd, as one of these images works fine with https, but others dont!

So, it was just bad luck that I didn’t have small resolution images with http-url’s at the same time!
It would be cool if Card Validator could see things like these, as I didn’t find these from troubleshoot page (it might have these, but I didn’t spot them).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.