Plugin Directory

Changeset 1921035


Ignore:
Timestamp:
08/07/2018 02:06:57 PM (8 years ago)
Author:
dvlasearch
Message:

Updated to 1.1.3. Increase curl request timeout.

Location:
dvla-search
Files:
3 edited
7 copied

Legend:

Unmodified
Added
Removed
  • dvla-search/trunk/dvla-search.php

    r1753055 r1921035  
    44 * Plugin URI: https://dvlasearch.co.uk/
    55 * Description: Easily add results from the DVLA Search API to your site. Requires a DVLA Search subscription.
    6  * Version: 1.1.2
     6 * Version: 1.1.3
    77 */
    88
  • dvla-search/trunk/endpoint/dvla_search_query.php

    r1745273 r1921035  
    3434      $dvla_search_registration = safe_input($wp_query->query_vars['dvla_search_registration']);
    3535      $dvla_search_type = safe_input($wp_query->query_vars['dvla_search_type']);
     36       
    3637      $result = wp_remote_get('https://dvlasearch.appspot.com/DvlaSearch?licencePlate='.$dvla_search_registration.'&apikey='.$api_key);
     38 
    3739      $dvla_search_result_data = json_decode( $result['body'], true );
    3840
     
    5961
    6062add_action( 'template_redirect', 'dvla_search_query_results' );
     63
     64add_filter('http_request_args', 'dvla_http_request_args', 100, 1);
     65function dvla_http_request_args($r)
     66{
     67    $r['timeout'] = 10;
     68    return $r;
     69}
     70 
     71add_action('http_api_curl', 'dvla_http_api_curl', 100, 1);
     72function dvla_http_api_curl($handle)
     73{
     74    curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, 10 );
     75    curl_setopt( $handle, CURLOPT_TIMEOUT, 10 );
     76}
  • dvla-search/trunk/readme.txt

    r1753055 r1921035  
    120120== Changelog ==
    121121
     122= 1.1.3 =
     123 * Increase timeout of curl requests for slow connections
     124
    122125= 1.1.2 =
    123126 * Fixed an issue where widget options would not display in admin menu.
Note: See TracChangeset for help on using the changeset viewer.