I have been battling a directory plugin author over his use

I have been battling a directory plugin author over his use of the google maps api for quite some time now.

He never included the ability to TURN OFF loading the api if it is already loaded elsewhere in the site, therefore every other plugin that uses the api was breaking.

I finally got him to release an update that included the ability not to load the api within the plugin and viola, all my other plugins that render maps work flawlessly!

but theres a new issue. now his directory will not load maps unless I re enable the api within the plugin....

I am clueless when it comes to programming, so forgive me if my assumption is off.

If someone creates a plugin that uses the maps api, and they include the ability to switch the api off if loaded elsewhere, do they then also have to include code that uses the already loaded api?

I ask this because when i brought to the developers attention that now his plugin will not render maps, he insisted that it must have something to do with the way my site includes it elsewhere, incorrectly.

I thought about what he said but it makes no sense. if that was the case why does every other plugin now load maps correctly but his does not?
does he also have to change his plugin so that is uses the already loaded api, or should it just automatically work?

  • Vaughan
    • Support/SLS MockingJay

    Hi Phil,

    Hope you're well?

    Is this the wpmudev directory plugin you are talking about or a different directory plugin?

    I would assume though, it should check first to see if the API is loaded, if it is, it uses the already loaded API, if not, then the plugin will load it. Well that's how I think it should work.


  • PhilMay
    • Site Builder, Child of Zeus

    it is not your directory plugin. I would have used yours but you do not have geolocation abilities or other features that would make your plugin work for a business directory. I think your plugin is fantastic for non location based directories or simple staff directories though :slight_smile:

  • Ash
    • WordPress Hacker

    Hello @PhilMay

    I hope you are well today.

    About your main query, it depends. There are several versions of the google map API. Maybe he is a self modified version, or maybe he has some custom code in the same file where google map API is on.

    The standard procedure is to check, if the same library is included already, then don't load the library. The plugin itself can't check if the same library already included, so normally the developer provides an option to load or not-load.

    There might be another issue, if the developer's custom code load before the google API, then the custom code won't work. It normally happens, if the code is pushed into the header using wp_head instead of enqueueing.

    So, you need to ask the developer why it doesn't work when the same library loads from other plugin or theme.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.