Map not loading with Autoptimize

This topic contains 16 replies, has 3 voices, and was last updated by  adyp 6 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #424627

    adyp
    Expired Member
    Post count: 496

    Hello,
    I am trying to set up Autoptimize to work with WP Super Cache. I have followed the instructions for Autoptimize settings in the documentation (including js to exclude), but something is stopping the maps loading and the ‘near me’ button working.

    login to follow …

    #424629

    adyp
    Expired Member
    Post count: 496
    This reply has been marked as private.
    #424672

    Guust
    Moderator
    Post count: 29970

    I de-activated Autoptimize, I’ll get Stiofan to have a closer look.

    It also seems you changed to HTTPS without changing your authorized URL in your Google API settings, see step 11 of https://wpgeodirectory.com/docs/add-google-api-key/

    Thanks

    #424696

    adyp
    Expired Member
    Post count: 496

    Having just been about to start to work on my site I been left with a mess this morning! 🙁

    No contact forms, no social shares, widgets in the wrong place because I have lost widget visibility controls – and that is what I have noticed in the first 5 minutes. I guess you turned all plugins off and then back on. Unfortunately I have lost a whole load of configuration – most probably in Jetpack, which has lost all settings and some functionality (even when Jectpack re-connected) – but not sure that explains my loss of contact forms. Unfortunately, also, I see my last automated database backup was approximately 20 minutes AFTER all this was done – meaning if I want to go back a further 24 hours to get my site functioning as it was then I will have to work out what work I did yesterday so that I can copy pages/arrange to reconstruct work (media file uploads etc). It is depressing that I know I will have to spend some time (hours maybe) on this right now when I already had a busy day lined up! To say I am not happy this morning is an understatement!!!

    Moral of the story: regular backups are not enough, I will have to remember to run a back up every time I ask for support to insure against this sort of thing happening. I had thought that all was required was an indication of a script or two to add to the ignore options in Autoptimize setup – not this 🙁

    Now, you said:

    It also seems you changed to HTTPS without changing your authorized URL in your Google API settings, see step 11 of https://wpgeodirectory.com/docs/add-google-api-key/

    I can see nothing in the link you provided – step 11 or otherwise – that mentions https. Do I need to set it up again? I am not even sure of the significance of what you said: the site was functioning fine to my knowledge.

    #424698

    adyp
    Expired Member
    Post count: 496

    ok – panic over – I managed to get it all back 🙂 – not a nice way to start the day though! I realise “turn all the other plugins off” is the stock advice given. But maybe not the first option to be tried in the case of Jetpack!

    I’d still like some direction about the https/Google API issue. Is it significant? What do I do to remedy it – does it even need a remedy if google map appears to be working ok (except in case of Autoptimize)? (the link does not mention https)

    Thanks,
    Adrian

    #424699

    Guust
    Moderator
    Post count: 29970

    This is the warning you get on every page:
    Google Maps API warning: InvalidKey https://developers.google.com/maps/documentation/javascript/error-messages#invalid-key

    So I am guessing the site is authorized for the HTTP URL and not the HTTPS URL. Step 11 shows you were to change the authorized URLs.

    I will leave the rest with Stiofan.

    #424707

    adyp
    Expired Member
    Post count: 496

    Looking at the API as per step 11 in the guide you linked to, I had the key restriction set to ‘none’ – so it should have been authorised for http and https. I have now set the key restriction to ‘http referrers’ (there is no option for httpS referrers) for my website as suggested in the documentation step (i.e., *.loopyfood.net/*). The * at the front should cover http and https?

    Is this what you mean? I don’t know how to see if there are still errors. Or I need to generate a new API key after changing to https and delete the previous keys?

    #424708

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Am i still needed?

    Stiofan

    #424709

    adyp
    Expired Member
    Post count: 496

    Hi Stiofan,

    I am not sure – see my previous message which crossed with yours.

    Also, there is the outstanding issue of autoptimise issues set out in my initial post (a case of scripts that need to be included in the autoptimise settings?)

    Adrian

    #424714

    adyp
    Expired Member
    Post count: 496

    … and now my maps aren’t loading!

    #424730

    Guust
    Moderator
    Post count: 29970

    Now the Google API is definitely wrong, see https://wpgeodirectory.com/this-page-didnt-load-google-maps-correctly-see-the-javascript-console-for-technical-details-fix/
    I checked how you entered the key and it had a space in front and the back, but that is not the issue.
    The error you now have is

    Google Maps API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error
    Your site URL to be authorized: https://loopyfood.net/the-organic-food-directory/me/

    I suggest you create a new one.

    #424741

    adyp
    Expired Member
    Post count: 496

    ok – I have created and set new API and all appears well – I am just now checking if this removes the issue with Autoptimize not loading maps …

    #424743

    adyp
    Expired Member
    Post count: 496

    The problem remains as with my original post: setting up Autoptimize (following GD documentation) means that the maps do not load.

    Also, there are formatting changes introduced (larger font in text, menu, sidebars and funny symbol above ‘st’ in text) – though that appears to be a different problem.

    #424769

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I unticked the “Add try-catch wrapping?” and it now seems to work.

    Stiofan

    #424780

    adyp
    Expired Member
    Post count: 496

    There is still something funny going on.

    The fonts all seem to be a bit bigger in main text, on menu and in sidebar, with the funny symbol above ‘st’ in the text. Strangely, the gd home (directory) page seems to correct itself after a second or two:

    If you go to the home page, look at the words ‘listing’ and ‘lifestyle’ in the first paragraph (and observe the size of the menu writing). Then navigate to ‘Directory/Map’ on the main menu – the font size will be initially the same and the funny symbol will be above the st in the word ‘Just’ in the first para below the search bar. After a second or two the fonts get smaller in text and menu – and the word ‘Just’ and other st’s in text lose their funny symbols! – Then navigate to ‘Community’ on the main menu and the fonts get bigger again, with loads of funny marks – see the bottom half of the first paragraph. The problem doesn’t right itself on this page.

    Something weird going on.

    Interestingly, the st symbol does not appear in page headings.

Viewing 15 posts - 1 through 15 (of 17 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket