<?php
/*
Plugin Name: List HTTP Transports
Plugin URI: http://wordpress.org/#
Description: List available HTTP and HTTPS transports for both GET and POST
Author: Ryan Boren, Matt Martz
Version: 1.1
Author URI: http://boren.nu/, http://sivel.net/
*/

function list_transports() {

	$types = array('get', 'getssl', 'post', 'postssl');

	foreach ( $types as $type ) {
		switch ($type) {
			case 'get':
			case 'post':
				$r = array('ssl' => false);
				break;
			case 'getssl':
			case 'postssl':
				$r = array('sslverify' => apply_filters('https_local_ssl_verify', true), 'ssl' => true, 'local' => true);
				break;
		}
		$$type = '';
	        if ( true === WP_Http_ExtHttp::test($r) )
	                $$type .= 'ExtHttp';
        	if ( true === WP_Http_Curl::test($r) )
	                $$type .= ' Curl';
	        if ( true === WP_Http_Streams::test($r) )
	                $$type .= ' Streams';
	        if ( true === WP_Http_Fopen::test($r) && !strstr($type, 'post') )
	                $$type .= ' Fopen';
	        if ( true === WP_Http_Fsockopen::test($r) )
	                $$type .= ' Fsockopen';
	}

	echo "<span style='font-family: monospace;'>";
	echo "Available HTTP GET transports:&nbsp;&nbsp;&nbsp;$get<br />\n";
	echo "Available HTTPS GET transports:&nbsp;&nbsp;$getssl<br />\n";
        echo "Available HTTP POST transports:&nbsp;&nbsp;$post<br />\n";
	echo "Available HTTPS POST transports:&nbsp;$postssl<br />\n";
	echo "</span>";
}

function return_false() { return false; }

add_action('admin_footer', 'list_transports');

//add_action('use_http_extension_transport', 'return_false');
//add_action('use_curl_transport', 'return_false');
//add_action('use_streams_transport', 'return_false');
//add_action('use_fopen_transport', 'return_false');
//add_action('use_fsockopen_transport', 'return_false');

//add_action('https_local_ssl_verify', 'return_false');
?>
