Forum: WP Users Geolocation

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support related to the WP Users Geolocation premium extension please open a new premium support ticket.

[Resolved]gmw_update_user_location() not working

Forums WP Users Geolocation gmw_update_user_location() not working

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #47191
    Dan Wist
    Member

    I have the WP Users Geolocation add on activated and working. I can update the users’ location by logging in as them and modifying it. Everything seems to be working from the UI.

    I’m having issues with the gmw_update_user_location() function. In fact, when I call it I get a function not defined fatal error. I went ahead and pasted the function itself (found in the geo-my-wp-user-update-location.php file which seems to be included nowhere in the actual plugin) and ran it.

    I’ve checked all of my input variables in my array (the ID of the user is correct, the address string that I am inputting is complete) and I’ve also checked that the address is being broken out correctly by the function, inside of the function (it is, the street, city, state, zip are being broken out into their respective variables).

    But nothing happens when this function has completed. The user’s location in the wp-admin panel doesn’t change at all.

    Please let me know what I’m missing here. Am on a deadline and some rapid help would be realllly appreciated.

    #47197

    HI Dan,
    The file is not included because it is there for custom use, like in your case. You can just simply include the file before executing the function.

    How exactly do you use this function? Using a hook? custom form?

    #47221
    Dan Wist
    Member

    I’m currently just testing to verify that it works – once I’ve tested and verified its function it will be used in a custom import script as well as possibly through a custom script.

    For my previous test I ran the function from my author.php page to manually update the address feeding from custom user fields. This is what didn’t do anything.

    #47223
    Dan Wist
    Member

    Earlier today I didn’t have time to really look into the function but I have now. You had two extra columns on your wpdb->replace() call which was causing the database query to fail (street_number and street_name). Remove those two arguments and we have a working update function.

    #47224
    Dan Wist
    Member

    Also wanted to mention that so far the plugin is great – thanks for making such a nice product. Will check back with any suggestions I might have along the way but this should save me quite a bit of time.

    #47259

    Earlier today I didn’t have time to really look into the function but I have now. You had two extra columns on your wpdb->replace() call which was causing the database query to fail (street_number and street_name).

    Ah, good catch! I think few other users had issues with the function and I guess now I know the reason. Thank you for providing this information.

    I’m currently just testing to verify that it works – once I’ve tested and verified its function it will be used in a custom import script as well as possibly through a custom script.

    FYI,
    To prevent your IP address banned by Google which will prevent you from using their Google Maps API you should:
    1) Geocode ( that is what the function you are using does ) no more than 2000 ( I always recommend event for 1500 ) locations per 24 hours.

    2) Have a delay of 2 to 3 seconds between each location in the loop of the importing script. You can simply use sleep(2) somewhere in your script.

    Also wanted to mention that so far the plugin is great – thanks for making such a nice product.

    You are very welcome. I am glad you find my work useful 🙂

    Let me know if you have any other questions.

    #47711

    Hi Dan,
    Checking back on this topic.

    You mentioned that the two columns street_number and street_name caused the conflict above. Are these two columns don’t exist in the database table of your site?

    #47768
    Dan Wist
    Member

    No, they don’t exist in my wppl_friends_locator database table.

    #47776

    Thanks.
    Few updates of, of GEO my WP, did you see a message that GEO my WP need to update its Members database table ?

    #48769

    This topic marked “Resolved” due to inactivity. If you wish to reply to this topic please change its status to “Not resolved”  before replying.

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.