The first problem may be due to caching at your end. Note that I optimized quite a few things in JavaScript, and maybe your caching plugin needs to regenerate the cache. I say this because even on your current site I am seeing a JavaScript error showing up (unrelated to Photonic) when I browse through your site.
For changing the color on SwipeBox add this via your WP dashboard under Appearance → Customize → Additional CSS:
#swipebox-title a, #swipebox-title a:hover, #swipebox-title a:focus {
color: #0000ff; /* Use any color that you require */
}
I see. Thanks for your reply.
Could you tell me where do you see the JS error?
Sure. This is what I am seeing:
Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
at HTMLHeadElement.Element.appendChild (eval at xhr.onprogress (www.alessiomesiano.com/:1), <anonymous>:1:644)
at HTMLDocument.fire (eval at xhr.onprogress (www.alessiomesiano.com/:1), <anonymous>:2:1116)
at HTMLDocument.c (rocket-loader.min.js:1)
It seems to be coming from the rocket-loader script in your footer.
Would you be kind to send me a screenshot? π I don’t have any error here.
Rocket-loader is from Cloudflare CDN.
BTW, concerning your plugin: I tried to disable the cache and nothing changed so now I’m still using Swipebox
-
This reply was modified 7 years, 7 months ago by
Alessio.
Here you go: https://imgur.com/a/s8TOdsQ.
If you want you can leave PhotoSwipe on for about an hour or so – I should be able to troubleshoot the issue in that timeframe.
Oh, I didn’t check in the console. I have the same error too!
Yes, sure. I can leave PhotoSwipe and disable the cache so you can test it every time you require
OK – leave it on for a bit, please. I am online for the next few hours at least, so I can start looking immediately.
Hey, PhotoSwipe is working fine now! I really don’t understand why!
And the cache plugin is enabled
-
This reply was modified 7 years, 7 months ago by
Alessio.
I suspect this might have had something to do with caching. E.g. when I loaded up your website on Chrome now, PhotoSwipe was not working correctly – I was being directed to the image on Instagram instead of it showing up in PhotoSwipe. However, when I opened your page on Chrome in incognito mode, it started working fine as it didn’t use any of my existing caches.
mmm, what a strange behaviour. So what do you suggest?
This is a bit tricky to handle, and the short answer is: I don’t know what the best solution for you is.
The long answer is: multiple factors might be at play here.
Typically the way I serve JS and CSS files at my end is by appending the timestamp to the end of the file name. So you will see something like https://aquoid.com/news/wp-content/plugins/photonic/include/scripts/front-end/build/photonic-swipebox.min.js?ver=20190228-03934 in my code, where the ver=20190228-03934 is the file timestamp. This way, even though I have a good cache policy on my website (365 days for most types of content), it will still serve up the latest files. So if a user visits my site now and 30 minutes later, and if my files have changed in this time, the user will see new files though the cache policy says that CSS should be cached for 365 days. But if my files have not changed in 2 weeks and the user visits the site twice in those two weeks, both the times the same file will be served.
Note that in the above I am talking about Apache’s cache policy. For you all the caching policies etc. are probably set up on CloudFlare, and I am not sure how much control you have there. For all you know, CloudFlare might be stripping out the ver=20190228-03934 information from the URL and then generating a file on its CDN (I don’t think that is happening, but this is hypothetical). What is more likely to be happening in your case is that CloudFlare is probably not changing the names of its generated files each time it rebuilds the files. As a result, when you revisit your site from the same browser, the server’s cache policy may be serving an old copy of the file, but if you visit from a new browser you get the correct copy.
At the end of the day, site caches have to be thought through in depth to account for things like post changes, theme changes and plugin changes.