Make WordPress Core

Ticket #18738: testing-script.php

File testing-script.php, 796 bytes (added by dd32, 15 years ago)
Line 
1<?php
2$transports = array( 'curl', 'fsockopen', 'streams' );
3delete_option( 'disable_fsockopen' ); /// just in case
4
5foreach ( $transports as $t ) {
6 echo "Using $t <br />";
7 foreach ( $transports as $tt ) {
8 remove_filter( "use_{$tt}_transport", '__return_false' );
9 if ( $tt != $t )
10 add_filter( "use_{$tt}_transport", '__return_false' );
11 }
12
13 $url = 'http://test.dd32.id.au/sleep.php';
14 $url = "http://ctftw.com/sleep.php";
15
16
17 timer_start();
18 $result = wp_remote_get( $url . '?block', array( 'blocking' => true, 'timeout' => 10 ) );
19 timer_stop(true);
20
21 echo '<br />';
22
23 timer_start();
24 $result = wp_remote_get( $url . '?noblock', array( 'blocking' => false, 'timeout' => 10 ) );
25 timer_stop(true);
26
27 echo "<br /><br />";
28}