Map is not displaying correctly due to CDN

Our google maps on the homepage is not showing with Smush CDN. We have disabled lazyload as we initially thought it was the cause, but the issue is still present.

  • Sanowar Prince
    • FLS

    Hi web_unlimited,

    I had a closer look on your issue and after a little investigation I found the issue is on Autoptimize plugin CDN settings.

    You used https://*****.smushcdn.com on wp-admin > Settings > Autoptimize > CDN Options > CDN Base URL. So compressed JS file was trying to load from Smush CDN and was showing 404 not found error on my browser console as it didn’t exist there really. Please note, Smush CDN is only for image and it doesn’t serve assets like CSS and JS. To fix the issue I removed https://*****.smushcdn.com from CDN Base URL so compressed JS file was loading from your site locally.

    Then another error $ is not a function appeared on my browser console which was coming from some custom JS code. After a little investigation I found the following custom code block on wp-admin > Appearance > Theme Options > Header > Tracking Code which was causing the error.

    $('.no-select').hide().attr('src', 'https://www.9*****t.com/wp-content/uploads/2019/08/howdy-icon.jpg').show();

    To fix the error I replaced the above code with the following.

    jQuery('.no-select').hide().attr('src', 'https://www.9*****t.com/wp-content/uploads/2019/08/howdy-icon.jpg').show();

    Now map is loading fine on homepage. Please check your site and let us know if it works for you as well.

    Best regards,
    Sanowar