• Resolved vikrampalesha

    (@vikrampalesha)


    Hello

    I am using your plugin for user login history display in the front end as well as send a login review mail and SMS.
    In order to get the data into the SMS I am using the following code in my functions.php

    if($mobile != ''){
            $newDate = date("Y-m-d", strtotime($data['time_login']));
            $message = "Hello ".$first_name."\nYour Asimi Jewels account was logged in to from a new browser or device. was this you?\n".$newDate.",\n".$data['city'].", ".$data['region_name'].", ".$data['country_name'].",\n" .$data['operating_system']." ". $data['browser']." ". $data['browser_version']."\nIf it wasnt you report to us immedietely! else Ignore the SMS.\nTeam Asimi!";

    However, the country is sent in the same and also seen in the front end and backend the other two are blank everywhere.
    I am using User Login History 2.1.0 (Basic Version) on WordPress 5.7.1

    Thanks in advance for a prompt and detailed response.
    Regards
    Vikram P.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • @vikrampalesha Can you share the output of the variable $data?

    Thread Starter vikrampalesha

    (@vikrampalesha)

    @extendmate Thsnk you for the response.
    The user end message sent is this
    “Hello Vikram
    Your Asimi Jewels account was logged in to from a new browser or device. was this you?
    2021-04-20,
    , , India,
    Windows Chrome 89.0.4389.128
    If it wasnt you report to us immedietely! else Ignore the SMS.
    Team Asimi!”

    for ".$data['city']." result blank
    for ".$data['region_name']." result blank
    for ".$data['country_name']." result India
    for " .$data['operating_system']." result Windows
    for ". $data['browser']." result Chrome
    for ". $data['browser_version']result 89.0.4389.128

    • This reply was modified 3 years, 10 months ago by vikrampalesha. Reason: Incorrect format
    Plugin Author Faiyaz Alam

    (@faiyazalam)

    @vikrampalesha It seems that the API is not giving city and region_name. You can verify the same by using this curl command.

    $ curl -H "User-Agent: keycdn-tools:https://www.google.com" "https://tools.keycdn.com/geo.json?host=your-ip"

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not getting User City and Region when Geo Tracking is on’ is closed to new replies.