Support » Plugin: International Telephone Input for Contact Form 7 » freegeoip.net moved to ipstack.com

  • Hi,
    seems you need to change the API Endpoint to ipstack.com
    Plugin doesn’t work anymore so it doesn’t pull the ip and can’t locate the country.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Fix:
    you need to use ipinfo.io not ipstack.com

    I’ve changed this code on script.js

    var IPINFO_TOKEN = ‘<YOUR_API_KEY>’;

    var intl_tel_default_setting={
    initialCountry: “auto”,
    utilsScript: wpcf7_utils_url,
    geoIpLookup: function(callback) {

    jQuery.get(‘//ipinfo.io?token=’+IPINFO_TOKEN, function() {}, “jsonp”).always(function(resp) {
    var countryCode = (resp && resp.country) ? resp.country : “”;
    callback(countryCode);
    });

    // jQuery.get(‘//freegeoip.net/json’, function() {}, “jsonp”).always(function(resp) {
    // var countryCode = (resp && resp.country_code) ? resp.country_code : “”;
    // callback(countryCode);
    // });

    }
    };

    This looks like a good fix but I’m getting some errors on the js when I try to minify it. Have you got an update to the code?

    OC2PS

    (@sooskriszta)

    Looks like you are still using ipinfo, instead of ipstack.

    Also, IPStack’s JSON callback is like this:

    http://api.ipstack.com/IP_ADDRESS
        ? access_key = YOUR_ACCESS_KEY
        & callback = MY_FUNCTION

    Also, folks should note that the free API provides a response on http. For https, IPStack requires premium subscription.

    gstar

    (@gstar)

    Where do we make this change?

    In both /script.js and /script.min.js, just search and replace //freegeoip.net/json with //reallyfreegeoip.org/json.

    No key is needed. After https://freegeoip.net was deprecated, https://reallyfreegeoip.org was launch to replace it. It is fully compatible with the same parameters.

    They also have a neat bulk IP lookup tool too if your looking to parse your logs’ IP addresses.

    • This reply was modified 1 month, 2 weeks ago by  joserolles.
Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.