Make WordPress Core

Ticket #8622: 8622.debug.diff

File 8622.debug.diff, 1.2 KB (added by DD32, 14 years ago)

(hey, i just realised i didnt need that var_dump() of transports in the debug, its late :))

  • wp-includes/http.php

     
    256262                        $transports = WP_Http::_postTransport($r);
    257263                }
    258264
     265                if(is_admin()) echo " transports: " . implode(', ', $c = array_map('get_class', $transports)) . "<br>";
    259266                $response = array( 'headers' => array(), 'body' => '', 'response' => array('code', 'message') );
    260267                foreach( (array) $transports as $transport ) {
     268                        if (is_admin()) echo "Requesting $url using " . get_class($transport);
     269                        $timer_http = timer_start();
    261270                        $response = $transport->request($url, $r);
    262 
     271                        if(is_admin()) echo ' took ' . timer_stop(0) . 's';
    263272                        if( !is_wp_error($response) )
    264273                                return $response;
     274                        if(is_admin()) echo get_class($transport) . ' has failed with error:' . $response->get_error_message() . "<br>";
    265275                }
    266276
    267277                return $response;
     
    971981                        'blocking' => true,
    972982                        'headers' => array(), 'body' => null
    973983                );
    974 
     984return new wp_error('test', 'test');
    975985                $r = wp_parse_args( $args, $defaults );
    976986
    977987                if ( isset($r['headers']['User-Agent']) ) {