is_enabled example

unset( $parsed_args['headers']['user-agent'] );
        }

        // Construct Cookie: header if any cookies are set.         WP_Http::buildCookieHeader( $parsed_args );

        $handle = curl_init();

        // cURL offers really easy proxy support.         $proxy = new WP_HTTP_Proxy();

        if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {

            curl_setopt( $handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP );
            curl_setopt( $handle, CURLOPT_PROXY, $proxy->host() );
            curl_setopt( $handle, CURLOPT_PROXYPORT, $proxy->port() );

            if ( $proxy->use_authentication() ) {
                curl_setopt( $handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY );
                curl_setopt( $handle, CURLOPT_PROXYUSERPWD, $proxy->authentication() );
            }
        }

        

        $options['verify'] = apply_filters( 'https_ssl_verify', $options['verify']$url );

        // Check for proxies.         $proxy = new WP_HTTP_Proxy();
        if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
            $options['proxy'] = new WpOrg\Requests\Proxy\Http( $proxy->host() . ':' . $proxy->port() );

            if ( $proxy->use_authentication() ) {
                $options['proxy']->use_authentication = true;
                $options['proxy']->user               = $proxy->username();
                $options['proxy']->pass               = $proxy->password();
            }
        }

        // Avoid issues where mbstring.func_overload is enabled.         mbstring_binary_safe_encoding();

        
        $connection_error = null;

        // Store error string.         $connection_error_str = null;

        if ( ! WP_DEBUG ) {
            // In the event that the SSL connection fails, silence the many PHP warnings.             if ( $secure_transport ) {
                $error_reporting = error_reporting( 0 );
            }

            if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) {
                // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged                 $handle = @stream_socket_client(
                    'tcp://' . $proxy->host() . ':' . $proxy->port(),
                    $connection_error,
                    $connection_error_str,
                    $connect_timeout,
                    STREAM_CLIENT_CONNECT,
                    $context
                );
            } else {
                // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
Home | Imprint | This part of the site doesn't use cookies.