• When I clear cookies in my browser and open my page I get the error:
    Trying to get property of non-object in wp-content/plugins/lively-chat-support/chatbox/includes/functions.php on line 316
    and 317, 318, 319, 320, 321, 322

    It is probably because I’m running form my Intranet an Free GEO IP service fail.

    How can workaround this ?

    See the code below
    $result= $request->request(“http://freegeoip.net/json/” . $_SERVER[“REMOTE_ADDR”]);
    . . .
    $geo = json_decode($result[“body”]);

    https://wordpress.org/plugins/lively-chat-support/

Viewing 1 replies (of 1 total)
  • Anonymous User 9782929

    (@anonymized-9782929)

    You could be right – it could have to do with the intranet.

    Try replacing lines 304 – 327 on chatbox/includes/functions.php with this (only commented out a couple lines and if (true)):

    //$request = new WP_Http;
    //$result = $request->request( "http://freegeoip.net/json/" . $_SERVER["REMOTE_ADDR"] );
    
        if (true) {
          // $geo = json_decode($result["body"]);
        	$args = array(
            "agent_id" => LivelyChatSupport_agent()->id,
            "token" => $_COOKIE["livelychatsupport_convo_token"],
            "mini_token" => strtolower(substr($_COOKIE["livelychatsupport_convo_token"], 0, 3)),
            "referrers" => json_encode($referrers),
            "ip" => $_SERVER["REMOTE_ADDR"],
            "user_agent" => $_SERVER['HTTP_USER_AGENT'],
            //"city" => $geo->city,
            //"province" => $geo->region_name,
            //"country" => $geo->country_name,
            //"country_code" => $geo->country_code,
            //"province_code" => $geo->region_code,
            //"latitude" => $geo->latitude,
            //"longitude" => $geo->longitude,
            "created_at" => date("Y-m-d H:i:s", current_time("timestamp")),
            "updated_at" => date("Y-m-d H:i:s", current_time("timestamp")),
            "last_seen" => date("Y-m-d H:i:s", current_time("timestamp"))
        	);
        }
Viewing 1 replies (of 1 total)
  • The topic ‘Error: First time after cleaning cookies and chat list’ is closed to new replies.