In this particular case:
Thumbnail not being locked in the first case but being locked when you click on it points to the earlier version of the thumbnail having been cached – likely by your browser. Trying a CTRL+F5 (or your os/browser equivalent) to force a refresh on the initial page may force the image to be refreshed, therefore showing the gated image.
As for unlocking the image – when you directly view an image in your browser, its the bare image without anything else, including the JS code that allows unlocking an image. This is why you cant unlock an image when you are viewing it from the source.
But, when displayed inside the page/post itself, the image should be unlockable properly when you click on it – because the JS code to unlock the image should be loaded with the page.
…
The plugin normally sends caching headers to prevent gated pages from being cached by browsers or CDNs. But if you are just embedding images in an unlocked page, these caching headers will not be sent. Hence leading to gated images being cached.
If you gate the page/post the images are in, and also gate the images inside, this could prevent the problem that you are experiencing.
Also checking your caching plugin to see if any caching headers are being sent to cache images for long duration. This may be in your web server config as well.
Thank you very much, you were correct about the caching of my browser. So that fixes that.
However, for my other problem, your solution is for me to make the page exclusive for Patron users AND make the images exclusive for Patron users?
In my case, that’s not a workable solution. I need non-Patrons to see some free images, so they get interested in seeing the locked stuff.
So I deduct from your answer that linking to a mediafile, instead of to the attachment page, is indeed the problem?
Users directly viewing a media file is the problem since it does not allow serving the JS that enables users to click on the image to unlock it.
If the large version of the image appears in a post, then the users should be able to click on the image to unlock it. It doesnt need to be attachment page, it can be inside the very post.
So any solution other than directly linking an image to have users directly view the images in their browser outside a web page, should work.
Thank you for the reply, I really appreciate your time. Unfortunately, if I understand correctly, I would need to create a seperate post for every image then. I would have about 20 galleries, each containing 30 images. That would mean creating 600 posts. :-/
What I wanted to do is create a post, add an image gallery, lock every image to their own Patron level and if you are a Patron, you can click it and see the media file (so not in a post). If you are not a Patron, your would see a Patron login page. Like in my example (mix of gated and ungated content)
But thanks anyway, great support! I will still try and use this plugin in another way. Just need to rethink my pricing strategy and website structure then. 🙂
It should work with an image gallery – except the large version of the image should appear inside the same page where relevant JS can act. If users click on the image in gallery and get taken to the image itself directly appearing in the browser, that wont work.
You can embed a gallery into a page or post, for example.