Tag Info

Hot answers tagged

5

TL;DR: Yes, remove that setting as of WordPress 3.7 or later. In the past, many people added the sslverify=false parameter specifically because their installation of PHP was unable to properly verify the certificate. Typically, this was because the PHP install had not been updated with the latest copy of the CA Root Certificates. The root certs change ...


4

To answer my own question, when you use WP_Http, the transport used is selected, in this order, from this array: $request_order = array( 'curl', 'streams', 'fsockopen' ); If your PHP supports curl, WP_Http_Curl is used. Curl doesn't support adding the body array parameters when the method is GET WP_Http_Streams and WP_Http_Fsockopen on the other hand, add ...


4

The proxy settings work just like a regular HTTP requests but in this case obviously routed through a proxy. In terms of WordPress the API's transport layers all support proxy connections(fsockopen, fopen, cURL, ). The things about proxy configurations are they come in several flavors and each setup is different so it makes answering this difficult, it ...


3

body argument is used for POST requests and set in headers. For GET request encode request arguments into URL (as in your second snippet).


3

There are tons of reasons that can let a SSL verification fail. Starting from too many redirects to wrong .ini files/setups or simply missing certificates or sub domains. In any case, you will need to search the reason for that and fix it. There is no way around it. But to temporarily work around that problem (let's say you need to develop your code further ...


2

There is no filter named "http_response_timeout" in the WordPress core. Where are you finding this filter name from? The timeout parameter as passed to a wp_remote call has a default of five seconds, and that default can be changed using the "http_request_timeout" filter, which is a different name than you used. Maybe you're just using the wrong word?


2

Simply use template_redirect filter to perform check on request you get in wordpress. add_filter('template_redirect', 'my_404_override' ); function my_404_override() { global $wp_query; if (!$wp_query->post) { // Check if any post is found. If not its 404. status_header( 200 ); $wp_query->is_404=false; // ...


2

WordPress can rely on underlying server software (typically cURL) to perform network request. In a nutshell because it's what that software is good and is there for. On some servers due to various reasons (I had never bothered looking into myself) it is quite typical for server software to not be able to "verify" secure connections, producing said errors. ...


2

From quick look at source mechanics seem very similar, my first suggestion for WP would be to try and bump HTTP transport to curl (I do it with plugin in WP so no idea about specific code). curl seems to be considerably more robust for corner cases and it's not WP's first choice.


1

Taking a look at the WordPress HTTP API, it seems there ain't no simple way to do this. In fact, it might even be a calling for a trac ticket. See, although it allows you to specify the maximum number of redirects, there's no abstract option to control if redirects should even be followed. So setting a max redirect count of 0, the HTTP API will simply fail ...


1

Its nonsensical to lock activation, unless the functional part of your code remains on your site. You essentially can make a service that you hide behind a login or apikey (like akismet) which may or may not make sense for your plugin. Calling home for permission to activate is a terrible idea, because idealistically, it's a violation of the GPL (won't earn ...


1

AFAIK URL encoding the cookie value is still kind of a defacto standard, it's an ancient relict based on the old, ugly Netscape cookie specs, that basically says that semicolons, commas and whitespaces are disallowed, and should be encoded, for example using URL encoding. Neither does it does it require enocding, nor does it force the use or URL encoding, ...


1

If you want to add this logic after WP churns through the query and concludes it's 404, but before it output 404 error page then you likely need to be working in range of logic contained in template-loader.php file. Most of it is about determining template file for the conditionals fitting current request. You will likely need both to adjust template file ...



Only top voted, non community-wiki answers of a minimum length are eligible