• Resolved notright

    (@notright)


    This is one of my favorite plugins and is a must-have for any buddypress website owner!

    One thing I have noticed is that under the ‘additional information’ column it stopped showing the City on top of the User’s IP. This is really important to me as it’s one of the easiest ways for me to detect Spam sign-ups.

    Is there a way to fix it so it will show the city that the user’s IP belongs to as well?

Viewing 15 replies - 1 through 15 (of 18 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    At least from what I can see, https://freegeoip.app/json/ which is the tool we’re using to retrieve the information, is still running and not charging.

    If you visit that url yourself directly, you should see your own data based on your current IP address. That said, it’s possible that either you don’t have an IP address provided for the user, perhaps something is blocking the communication between the your site and the service, or something else.

    What’s it saying in place of where the geolocation data was originally saying?

    Thread Starter notright

    (@notright)

    It just shows their IP Address. It doesn’t have the city on top of it anymore. Before it would have the city as well as the IP.

    Here is a screenshot

    View post on imgur.com

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    If it’s just showing the IP address, that means that there’s an error occurring when trying to fetch the results of wp_remote_get( 'https://freegeoip.app/json/' . $userip ); with $userip being the actual IP address saved for the pending user. Something is going on with your attempts to fetch the data, and it’s not returning what we’d expect.

    Thread Starter notright

    (@notright)

    And how would we go about fixing that?

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    I don’t have any immediate answer for that outside of trying to get the error message for the occurring error. If you’re willing to manually edit the plugin’s code temporarily, I can provide some things to add to see what’s going on.

    We would very likely make use of the wp_remote_retrieve_response_message function to help debug this case.

    Thread Starter notright

    (@notright)

    Okay I’m willing to edit the plugin’s code. Just tell me what to do please.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Inside your includes/admin.php file, you should see a function declaration for bp_registration_options_ip_data around line 1059. Further down on line 1084, there’s a line of code that should be echo wpautop( $userip );.

    either above or below that, it doesn’t matter, add in this line:

    echo wp_remote_retrieve_response_message( $response );

    It should look something like this overall:

    } else {
    	echo wp_remote_retrieve_response_message( $response );
    	echo wpautop( $userip );
    } ?>
    

    Once done and saved, refresh the pending users page, and the response message should be getting shown alongside the IP address. Provide that error text, and I can provide more information.

    Edit: used the wrong function. Please make sure you refresh and have latest version of response

    Thread Starter notright

    (@notright)

    Okay I added the function but it’s still not working

    View post on imgur.com

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    What do you see when you go to the admin page that lists the pending members?

    Thread Starter notright

    (@notright)

    No response message

    View post on imgur.com

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    alright, we’ll go the more aggressive route for this one.

    } else {
    	var_dump( $response );
    	echo wpautop( $userip );
    } ?>
    

    then refresh the admin page and screenshot or copy/paste the text.

    Thread Starter notright

    (@notright)

    That did something. Here’s what I got

    View post on imgur.com

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Much better, this is the relevant part:

    cURL error 35: openSSL SSL_connect: SSL_ERROR_SYSCALL in connection to freegeoip.app:443

    Sounds like issues with SSL and cURL on the server for your hosting.

    Not guaranteed to provide a solution, but it is a link I found from searching “cURL error 35: openSSL SSL_connect: SSL_ERROR_SYSCALL”

    https://stackoverflow.com/questions/31183297/ssl-connect-fails-with-ssl-error-syscall-error/31183611#31183611

    May be worth reaching out to your hosting as well to see what they have to say on the topic.

    Thread Starter notright

    (@notright)

    I checked with my host and they are saying the issue is with freeoip.app.

    From them:

    “Thank you for contacting us. We have checked your server and could not find any issues. when tried to check curl connection to freegeoip.app we received below error:

    curl freegeoip.app:443
    curl: (56) Recv failure: Connection reset by peer

    Looks like there is an issue with freegeoip.app”

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Hmm…some aspect of the communication between your server and theirs isn’t liking each other. There’s not really anything I’m going to be able to do on my end from the plugin perspective.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘IP Address Not Showing City Anymore’ is closed to new replies.