wp_remote_get – cURL error 28 – only on same domain

By default, WordPress set the timeout value for cURL in wp-includes/class-wp-http-curl.php to 5 seconds and the same value is also set to HTTP requests in wp-includes/class-http.php that is a newer class for making HTTP requests that can use also cURL if it’s present in the server. In your case, 5 seconds was not enough to … Read more

Passing .pem and .key files in cURL doesn’t work in WordPress

Based on @Mamaduka comment; the following changes resolve it: Use plugin_dir_path() to get the filesystem directory path: $certfile = plugin_dir_path(__FILE__) . ‘/clientcert.pem’; $keyfile = plugin_dir_path(__FILE__) . ‘/clientkey.key’; Then remove getcwd(). If you want to use it in your theme use TEMPLATEPATH I also want to mention that using the following paths previously did not work: … Read more

Uploading media with the REST API

This is not possible via the API; you need to fetch the image yourself, and send the data to the API yourself. Blockquote – This quotes Ryan on the GitHub–issue mentioned in @Dan (deleted) answer. How to side load images Note that the media_sideload_image() return value can be an instance of \WP_Error as well. You … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)