Using file_get_contents within admin but keep logged in
Using file_get_contents within admin but keep logged in
Using file_get_contents within admin but keep logged in
Simulating timeout is not working
Thanks to the WordPress forums someone answered that this only works via PHP if you set the UserAgent to a browser. $ua=”Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13″; curl_setopt( $cd, CURLOPT_USERAGENT, $ua);
Does your server know its own name and/or have loopback connections allowed? Like, if you do a remote get on just the main blog page, does that work? If the server doesn’t know its own name because the DNS doesn’t resolve, or loopback connections are disabled at the server level (these are common “security” measures … Read more
I had to change the plugin file to make it work. I think it can help someone and even the plugin’s author should consider making these changes. on class-admin.php, create this function at the beggining (can be line 9): function loadXmlByCurl($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $xml = … Read more
There are a few things going on with your functions.php file that may be the issue. You should be using wp_enqueue_scripts action to enqueue your script. The first parameter of wp_localize_script() should match the id of the file you’ve enqueued. You also need to add a no_priv version for your Ajax call if it needs … Read more
Yeah, you can do that. From curl –help or man curl: -k, –insecure (SSL) This option explicitly allows curl to perform “insecure” SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered “insecure” fail unless -k, –insecure is … Read more
If your main concern is using your WordPress database for user authentication, I’d look into the WP OAuth Server plugin. We use this for authentication with a 3rd party mobile app: app users type their username and password into the app which then – thanks to the plugin – authenticates them against their credentials in … Read more
I finally managed to accomplish the task using XML-RPC as suggested by denis.stoyanov. If xmlrpc is installed on your Server simply use the wpPostXMLRPC function from stackoverflow. But keep in mind that the used xmlrpc_encode_request() is an experimental function you usually would try to avoid.
It seems the difference has to do with the Content-Length header and how it is treated by both commands. But before going into that, curl -X HEAD does not give any output because, by default, curl does not print headers if switch -i is not provided (not needed on -I though). In any case, curl … Read more