$cvalue ) { if ( ! preg_match( '/^(wp-|wordpress_)/', $cname ) ) { continue; } // Only WP cookies, pl0x. $cookies[] = new WP_Http_Cookie( array( 'name' => $cname, 'value' => $cvalue, ) ); } // Post password cookie. $post = $is_post_revision ? get_post( $post_parent ) : get_post( $post_id ); if ( ! empty( $post->post_password ) ) { if ( ! class_exists( 'PasswordHash' ) ) { require_once ABSPATH . WPINC . '/class-phpass.php'; } $hasher = new PasswordHash( 8, true ); $cookies[] = new WP_Http_Cookie( array( 'name' => 'wp-postpass_' . COOKIEHASH, 'value' => $hasher->HashPassword( $post->post_password ), ) ); } if ( ! empty( $cookies ) ) { $params['cookies'] = $cookies; } $params['timeout'] = $this->get_timeout(); $response = wp_remote_get( $url, $params ); if ( is_wp_error( $response ) ) { return $response; } if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { return new WP_Error( __CLASS__, 'Non-200 response' ); } $content = wp_remote_retrieve_body( $response ); $bits = Smartcrawl_Html::find( 'body', $content ); return apply_filters( 'wds-analysis-content', (string) trim( join( "\n", $bits ) ), $post_id ); } private function get_timeout() { return defined( 'SMARTCRAWL_ANALYSIS_REQUEST_TIMEOUT' ) ? SMARTCRAWL_ANALYSIS_REQUEST_TIMEOUT : 5; } }