Photonic Version 2.23 – Minor Release to Work Around RetinaJS

A common malaise I have seen with multiple themes (particularly those obtained from beyond https://wordpress.org/themes, such as Divi, Avada and a bunch of ThemeForest themes) is the inclusion of buggy scripts from other sources. Such scripts often cause unintended conflicts with well-coded plugins for no fault of the plugins’.

One issue that had dogged Photonic in the past for several months (while version 1.64 was active) was that of third party themes including Bootstrap tooltips. Bootstrap tooltips conflict with jQuery Tooltips, and the latter ships with every copy of WordPress by default. So a plugin using a native WP script would get caught in the crossfire if it was used with a theme that went rogue. If you think this doesn’t happen, most of the common paid themes in the market include Bootstrap tooltips.

Recently I discovered another such conflict, resulting from the RetinaJS script. This script is included by multiple themes to supposedly help display images at Retina resolutions for Apple devices, though the concept is applicable to any high resolution device. To be quite honest, native support across devices for multiple high resolutions is now quite good, so the script is rather pointless. But as luck would have it, themes have this grandfathered in, and apart from adding more bloat to your page, the script also has an unresolved bug that has been out in the open since 2016. What is worse is that this bug has been reported multiple times but closed by the developer.

Such things generally end up happening to me, and when I introduced the optimization features in 2.21 and 2.22, I pushed the JS for Photonic to the footer. And if the theme has RetinaJS in play, sometimes Photonic’s scripts get loaded after the RetinaJS file, resulting in errors.

I released version 2.23 solely to counter this bug in RetinaJS. As a part of this fix Photonic now has a new option, Photonic → Settings → Generic Options → Generic Settings → Force JS in header when possible. If you select this option in conjunction with the option to Include Photonic JS for non-Photonic Images / Videos, Photonic will effectively get rid of any sort of JS loading optimization and load the JS in the header.

Version 2.23 was made available in the repository last evening.