Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter doughamlin

    (@doughamlin)

    So, I don’t know why DNS is taking so long, but I was able to fix this by adjusting the timeout in wp-includes/class-http.php

    Line 84:
    $defaults = array(
    ‘method’ => ‘GET’,
    ‘timeout’ => apply_filters( ‘http_request_timeout’, 5),
    ‘redirection’ => apply_filters( ‘http_request_redirection_count’, 5),
    ‘httpversion’ => apply_filters( ‘http_request_version’, ‘1.0’),
    ‘user-agent’ => apply_filters( ‘http_headers_useragent’, ‘WordPress/’ . $wp_version . ‘; ‘ . get_bloginfo( ‘url’ ) ),
    ‘blocking’ => true,
    ‘headers’ => array(),
    ‘cookies’ => array(),
    ‘body’ => null,
    ‘compress’ => false,
    ‘decompress’ => true,
    ‘sslverify’ => true,
    ‘stream’ => false,
    ‘filename’ => null
    );

    Change ‘timeout’ => apply_filters( ‘http_request_timeout’, 5) to ‘timeout’ => apply_filters( ‘http_request_timeout’, 30)

    Thread Starter doughamlin

    (@doughamlin)

    I believe I have tracked the problem down wp_remote_get used by media_sideload_image in the plug-in.

    wp_remote_get seems to fail with whatever URI I pass in. I’m getting the following error from it.

    WP_Error Object ( [errors] => Array ( [http_request_failed] => Array ( [0] => name lookup timed out ) ) [error_data] => Array ( ) )

    Now I just need to figure out why DNS lookup is not working.

Viewing 2 replies - 1 through 2 (of 2 total)