'application/json; charset=UTF-8','x-api-key'=> $apikey,'x-e-mail'=>$email,'x-hostname'=>$hostname,'x-lang'=>'tr','x-timezone'=>'180'); $path = WP_CONTENT_DIR . '/plugins/appsila-wooquote/logs.txt'; $handle = fopen($path,"a"); fwrite ($handle , "Data String: " . $data_string . date("D j M Y H:i:s", time()) . PHP_EOL); $response = wp_remote_post( $url, array( 'method' => 'POST', 'headers' => $header, 'body' => $data_string ) ); $result=$response["body"]; fwrite ($handle , "Result " . $result . date("D j M Y H:i:s", time()) . PHP_EOL); fclose ($handle); if ($result == 1) {//successful $returnid = '1'; } elseif($result == 2){ //expire date $returnid = '2'; } elseif($result == 0){//apikey or email $returnid = '0'; } elseif($result == 4){//apikey or email $returnid = '4'; } else { //http code; $returnid = '-1'; } return $returnid; } ?>