I am developing a wordpress wordpress plugin and I am getting trouble obtaining a cURL call to operate properly.

Allows say I've got a page www.domain.com/wordpress-admin/admin.php?page=orders

Inside the orders page I've got a function that appears to ascertain if a control button was clicked on and when so it must perform a cURL call towards the same page (www.domain.com/wordpress-admin/admin.php?page=orders&dosomething=true) to start another function. The main reason I am doing the work by doing this is in order to have this cURL call be async.

I am not receiving any errors, but I am also not receiving any response back. Basically change my hyperlink to google.com or example.com I will receive a response. Can there be an authentication problem or something like that of this character possibly?

My code looks something similar to this.. I am using will get, echos, and never doing async only for the simplicity of testing.

Also, sorry for that bad question title, for those who have an indicator tell me in order to edit it.


if($_GET['dosomething'] == "true")
     echo("do something");

function curlRequest($url) {
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
    curl_setopt($ch, CURLOPT_TIMEOUT, 15);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $response = curl_exec($ch);

The admin portion of the blog is password-protected, obviously. You will need to pass authentication data. Lookup http authentication for particulars. Look particularly here:


You will want to set the CURLOPT_USERPWD option and perhaps CURLOPT_HTTPAUTH.