Changeset 2559
- Timestamp:
- 02/23/2016 03:21:23 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-qbo/wordcamp-qbo.php
r2533 r2559 5 5 6 6 class WordCamp_QBO { 7 const REMOTE_REQUEST_TIMEOUT = 10; // seconds 8 7 9 private static $app_token; 8 10 private static $consumer_key; … … 166 168 $oauth_header = $oauth->get_oauth_header( 'GET', $request_url ); 167 169 $response = wp_remote_get( $request_url, array( 170 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 168 171 'headers' => array( 169 172 'Authorization' => $oauth_header, … … 189 192 $oauth_header = $oauth->get_oauth_header( 'POST', $request_url, $payload ); 190 193 $response = wp_remote_post( $request_url, array( 194 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 191 195 'headers' => array( 192 196 'Authorization' => $oauth_header, … … 248 252 249 253 $oauth_header = $oauth->get_oauth_header( 'GET', $request_url, $args ); 250 $response = wp_remote_get( esc_url_raw( add_query_arg( $args, $request_url ) ), array( 'headers' => array( 251 'Authorization' => $oauth_header, 252 'Accept' => 'application/json', 253 ) ) ); 254 $response = wp_remote_get( 255 esc_url_raw( add_query_arg( $args, $request_url ) ), 256 array( 257 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 258 'headers' => array( 259 'Authorization' => $oauth_header, 260 'Accept' => 'application/json', 261 ) 262 ) 263 ); 254 264 255 265 if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) { … … 501 511 502 512 $args = array( 513 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 503 514 'headers' => array( 504 515 'Authorization' => $oauth->get_oauth_header( 'POST', $request_url, $payload ), … … 563 574 564 575 $args = array( 576 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 565 577 'headers' => array( 566 578 'Authorization' => $oauth->get_oauth_header( 'POST', $request_url ), … … 687 699 688 700 $args = array( 701 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 689 702 'headers' => array( 690 703 'Authorization' => $oauth->get_oauth_header( 'GET', $request_url, $request_url_query ), … … 824 837 825 838 $args = array( 839 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 826 840 'headers' => array( 827 841 'Authorization' => $oauth->get_oauth_header( 'POST', $request_url, $payload ), … … 921 935 922 936 $args = array( 937 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 923 938 'headers' => array( 924 939 'Authorization' => $oauth->get_oauth_header( 'GET', $request_url, $request_url_query ), … … 1031 1046 1032 1047 $oauth_header = $oauth->get_oauth_header( 'GET', $request_url ); 1033 $response = wp_remote_get( $request_url, array( 'headers' => array( 1034 'Authorization' => $oauth_header, 1035 'Accept' => 'application/json', 1036 ) ) ); 1048 $response = wp_remote_get( $request_url, array( 1049 'timeout' => self::REMOTE_REQUEST_TIMEOUT, 1050 'headers' => array( 1051 'Authorization' => $oauth_header, 1052 'Accept' => 'application/json', 1053 ) 1054 ) ); 1037 1055 1038 1056 if ( is_wp_error( $response ) ) {
Note: See TracChangeset
for help on using the changeset viewer.