Please contact the support team for the commercial plugins you use. I would recommend contacting the support of the plugin that uses the older version. They should make an update here. Also describe your problem with compatibility. They may also offer a way to deactivate the integration.
Please note that we cannot help you with commercial products here in the forum.
Thread Starter
mc001
(@mc001)
Thanks for replying. I understand that you can’t help with specific plugins, but I was interested in the general problem of having to support two versions of the same JS library, immaterial of their origin.
In general, it can of course be said that the double integration of the same libraries is totally unfavorable. The effect of this depends on the library itself and cannot be answered in general terms. In the worst case, it leads to a general JavaScript error that affects the output of the website in the frontend. As I said, this is not so easy to solve if the cause is 2 different plugins.
Thread Starter
mc001
(@mc001)
In case anyone runs into the same issue, we’ve solved the problem by using something like:
function dte_selective_js_loading() {
$allowed_pages = [ 'page1', 'page2' ] ;
if ( is_page( $allowed_pages ) ) {
wp_register_script('cri_DTE_1', '/path/to/datatables.min.js'), array('jquery'), '1.0.0', true);
wp_enqueue_script('cri_DTE_1');
}
}
add_action( 'wp_enqueue_scripts', 'dte_selective_js_loading' );
That $allowed_pages is a list of slugs of pages where we want the newer JS library (that datatables.min.js being registered) to be used, with the older version being used elsewhere by default. So far it’s passed all our tests, and though we realise that this solution is not ideal since we have to keep that list up to date, we deem it a reasonable cost for the constraints placed on us. Furthermore, we expect to eventually replace the use of the older library, whence we would then be able to dispense with this approach anyway.
-
This reply was modified 8 months, 1 week ago by
mc001.