[wp-trac] [WordPress Trac] #17251: Determine if any WP_HTTP transport can be used before making the request

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 28 05:02:24 UTC 2011


#17251: Determine if any WP_HTTP transport can be used before making the request
-------------------------+-----------------------
 Reporter:  mdawaffe     |       Owner:  dd32
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  3.2
Component:  HTTP         |     Version:  3.2
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |
-------------------------+-----------------------

Comment (by mdawaffe):

 Replying to [comment:6 dd32]:
 > Also, It's only the $args passed to the test filters, the test filters
 are mainly there to disable the transport, not to do crazy things with it
 (that being said, I'm sure there are some out there)

 Wow.  I would have sworn the test filters had a URL as an argument :)
 Since they don't, your suggestion works fine for me.

 > The ::test() classes are reasonably simple beasts, running them multiple
 times is going to be a heck of a lot faster than most http requests. That
 might be a worthwhile 2nd ticket, caching of the ::test results for a
 certain $args+$url combination.

 Yes - they are very fast, I'm not worried about caching - that seems like
 over optimization to me.

 My concern was back-compat with these hypothetical crazy plugins, but
 that's much less of a concern for me now that I know the filters don't
 have a URL argument; the craziness of these hypothetical plugins is
 limited.  Note that truly crazy plugins can unlimit the crazy with the
 http_request_args filter :)

 PS: Perhaps http://core.trac.wordpress.org/browser/trunk/wp-includes
 /class-http.php?rev=17692#L229 is why I was thinking the filters had a URL
 parameter; the {{{::test()}}} functions are called with {{{$url}}} as a
 second (but unused) parameter

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17251#comment:7>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list