Support » Plugin: IP2Location Variables » Variables Not Working

  • Resolved jonbrockett

    (@jonbrockett)


    I’m getting a long list of errors when enabling this plugin. I manually uploaded the DB11LITEBIN file then tried to use the variables. I get no returned results from anything related to the functions:
    <?php
    $data = ip2location_get_vars();
    $data = json_decode($data);
    ?>

    Notice: Trying to get property ‘ipAddress’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 77

    Notice: Trying to get property ‘countryCode’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 78

    Notice: Trying to get property ‘countryName’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 79

    Notice: Trying to get property ‘regionName’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 80

    Notice: Trying to get property ‘cityName’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 81

    Notice: Trying to get property ‘isp’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 82

    Notice: Trying to get property ‘latitude’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 83

    Notice: Trying to get property ‘longitude’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 84

    Notice: Trying to get property ‘domainName’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 85

    Notice: Trying to get property ‘zipCode’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 86

    Notice: Trying to get property ‘timeZone’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 87

    Notice: Trying to get property ‘netSpeed’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 88

    Notice: Trying to get property ‘iddCode’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 89

    Notice: Trying to get property ‘areaCode’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 90

    Notice: Trying to get property ‘weatherStationCode’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 91

    Notice: Trying to get property ‘weatherStationName’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 92

    Notice: Trying to get property ‘mcc’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 93

    Notice: Trying to get property ‘mnc’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 94

    Notice: Trying to get property ‘mobileCarrierName’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 95

    Notice: Trying to get property ‘elevation’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 96

    Notice: Trying to get property ‘usageType’ of non-object in /wp-content/plugins/ip2location-variables/ip2location-variables.php on line 97

    • This topic was modified 2 years, 3 months ago by jonbrockett.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ip2location

    (@ip2location)

    Hi,

    Please update to version 2.5.11. This has been solved.

    Thread Starter jonbrockett

    (@jonbrockett)

    Great! Those errors are gone. But I’m still not able to use the variables. I get an error when using this code:

    $data = ip2location_get_vars();
    $data = json_decode($data);
    echo $data->countryCode;

    Notice: Trying to get property 'countryCode' of non-object

    or when I call anything from the $data object.

    Also if I try to use a server variable I get this error:

    Notice: Undefined index: IP2LOCATION_IP_ADDRESS

    Again for any variable.

    @jonbrockett i was trying too to setup and use the object that ip2location_get_vars creates , but it seems that it simply returns an empty object as you said

    • This reply was modified 2 years, 3 months ago by agkapo.
    Plugin Author ip2location

    (@ip2location)

    Please enable the debugging log and check the debug.log for issues. It seems like the BIN database is not readable.

    Thread Starter jonbrockett

    (@jonbrockett)

    I enabled debugging and no errors seem to be showing. All that shows is:

    2020-04-22 02:11:34 Debug log enabled.

    I’ve redownloaded the .bin, this time through the admin screen. I’m still getting the same issues.

    Plugin Author ip2location

    (@ip2location)

    We cannot reproduce the issue from our side. Please try remove the plugin and install again.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Variables Not Working’ is closed to new replies.