• Resolved Carret

    (@carret)


    Hi all.

    On wp 4.6+ wp_remote_get() seem not get a valid data response to check the country.

    Looking for, I maked this fix and made it work again for me.

    I hope it helps someone.

    $referer = site_url();
    
    $args = array(
        'headers' => array('referer' => $referer )
    );
    
    $userTmp = wp_remote_get( 'https://www.geoplugin.net/json.gp?ip=' . $user_ip, $args );
    
    //$userTmp = wp_remote_get( 'https://www.geoplugin.net/json.gp?ip=' . $user_ip );
  • The topic ‘Fix to get country name’ is closed to new replies.