lucid-fox / social-magick

An Open Graph Image generator plugin for Joomla 3 and 4
GNU General Public License v3.0
15 stars 1 forks source link

Just by refreshing the Facebook debugger, the og:image (which was right) changes #27

Closed woluweb closed 3 years ago

woluweb commented 3 years ago

Steps to reproduce the issue

Hi,

I have been trying to play and understand this issue for a couple of hours but I'm becoming crazy :) Same issue applies on two websites (one with OVH and the other one with PlanetHoster).

Actually you can see what's happening in this very short video: https://www.loom.com/share/3c48f27096ca44d99f99c6d71e2cd04f

Social Magick is installed. I enable the plugin, I use Cutout but I have customized the transparent cutout image. I enable Social Magick on a menu item and choose Cutout, I select "intro image".

Then going to Facebook Debugger, it first works. Then I refresh the Facebook Debugger and the og:image changes :

Troubleshooting already performed

But then I have finally discovered something: if I clear the Joomla cache (in my case using Cache Cleaner by Regular Labs), then

Do you have any clue of what could cause this issue?

(I had first thought it was caused by the fact that I had created a new profile in the plugin and also changed order. But even uninstalling and then only editing the default profiles would lead to the same issue)

System information

Mandatory information

nikosdion commented 3 years ago

This sounds like a Joomla caching issue. I suspect that onContentBeforeDisplay may not be fired for your cached article which would cause the plugin's main event (onBeforeDisplay) to fall back to the default Social Magick profile.

So, let's try to get some more information to reproduce this issue.

Are you using progressive or conservative caching?

Is it file caching or something else? if so, please specify.

Do you have the System - Cache plugin enabled and, if so, what are its settings?

Are you using a CDN or anything similar which could also be applying its own caching? (Shouldn't be relevant but I want to have all my bases covered)

woluweb commented 3 years ago

Txs for the very quick follow-up, Nicholas!

Note: I also tried to put the Social Magick first and then last of the System plugins, just in case it would have played a role. But same issue.

Here is the configuration

In the meantime I have tested further now that you gave that idea of some interference with Caching. Interesting conclusion: on both websites:

Does this help you to figure out what the issue can be? I can of course give you (super user) access to the website(s) if it makes it faster/easier for you to reproduce/check.

Txs again

woluweb commented 3 years ago

(btw, is it normal that Facebook debugger says (I translate): "The following required properties are missing : og:url, og:type, og:title, og:description, fb:app_id"?

nikosdion commented 3 years ago

Hm, I can't reproduce it with the current code. I'm also a bit confused as to why it happens. The workaround for the caching issue is already in beta 2. My guess is that one of the changes I made after beta 2 may have fixed whatever issue you are hitting. I will issue a beta 3 in a short while.

Regarding your other question, yes, these OpenGraph properties are missing. Beta 3 adds options to generate them for you :) Facebook will still complain because you don't have a fb:app_id (you really don't need to set it unless you have a Facebook application linked to your site). It will work regardless.

I am leaving this issue open until you can test with beta 3.

woluweb commented 3 years ago

Txs again Nicholas,

Fine, I'll be happy to test this with Beta 3!

As to fb:app_id: indeed we don't care about that one. But happy to know that the other OpenGraph properties will be there :)

Looking forward to Beta 3 then ;)

nikosdion commented 3 years ago

Already released :)

woluweb commented 3 years ago

That was quick! Txs a lot.

I have tested but that does not solve the issue: whith caching off (or when cache is cleaned),

nikosdion commented 3 years ago

This is really weird. I need a backup of that site so I can test this locally. There seems to be more than just the Joomla caching in play.

Here's the problem: how can you give me the connection information I need when GitHub only allows public issues. I have a solution for that.

Go to https://keybase.io/encrypt and in the recipient field type nikosdion. You should see my face and my info. Click on that. In the “Message to Encrypt” field type in the following information:

Note: If possible, make sure that the Joomla and (S)FTP credentials you are sending me are temporary and you can revoke them when I tell you I'm done.

Click on Encrypt. Copy the scrambled (encrypted) text, paste it into a text file with an extension .asc and attach that file to your next reply to the GitHub issue. I am the only one who can decrypt this using my private GPG key in my YubiKey hardware. I will log into your site, install Akeeba Backup (if it's not already installed), take a backup and download it locally so I can do further testing. After I am done testing I destroy the restored site and the backup copy and will let you know so you can revoke my access to your site.

I've tried the Keybase encryption thing in the past and it should work fine. It's far more secure than sending credentials by email and has the added benefit that the credentials are on the same issue I am working on so I don't have to try and correlate emails and GitHub issues.

woluweb commented 3 years ago

Hi Nicholas,

This reminds me of Pretty Good Privacy which I used in the early nineties with Eudora or Pegasus as mail client :)

I went to https://keybase.io/encrypt, chose your profile, saw your face... but when I click on the Encrypt button I get the following error msg: Error: Recipient does not have any active encryption keys.

nikosdion commented 3 years ago

About a year ago (June 2020) my then current GPG key was expiring. I updated they key in Keybase following their instructions on doing it over their web interface. The same key material is also on my site and definitely works — I've received GPG-encrypted emails. Guess what? Keybase didn't like me following their instructions. I had to use their command line client to update my key... I did it just now so you should be able to give it another go and this time it will work (I checked).

woluweb commented 3 years ago

:D txs for the hassle ;)

Here is the file: nikosdion-marc.txt

Note: Github does not accept .asc so I choose .txt :)

nikosdion commented 3 years ago

Thank you for the info! I was able to reproduce and fix this issue. Please find a development version attached so you can test it yourself.

socialmagick-rev97FBCA7.zip

woluweb commented 3 years ago

Txs @nikosdion! I have installed that dev version on my two sites where I had the issue and everything seems to go fine so far :)

Txs a lot for the fix. (btw, was it linked to the way I configure Joomla or was it a more general issue?)

nikosdion commented 3 years ago

It was actually a typo. I had typed ?? instead of ?:. Whether it triggered a different behaviour or not depended on the category options and menu item type. You had an article menu item, I had only tested with category menu items.

It was one of those things that take you an hour to set up the debugging, 5 minutes to realise what's going on and 5 second to fix...