@@ 153-165 (lines=13) @@ | ||
150 | * |
|
151 | * @return array Test results. |
|
152 | */ |
|
153 | protected function test__outbound_http() { |
|
154 | $name = __FUNCTION__; |
|
155 | $request = wp_remote_get( preg_replace( '/^https:/', 'http:', JETPACK__API_BASE ) . 'test/1/' ); |
|
156 | $code = wp_remote_retrieve_response_code( $request ); |
|
157 | ||
158 | if ( 200 === intval( $code ) ) { |
|
159 | $result = self::passing_test( $name ); |
|
160 | } else { |
|
161 | $result = self::failing_test( $name, __( 'Your server did not successfully connect to the Jetpack server using HTTP', 'jetpack' ), 'outbound_requests' ); |
|
162 | } |
|
163 | ||
164 | return $result; |
|
165 | } |
|
166 | ||
167 | /** |
|
168 | * Test that the server is able to send an outbound https communication. |
|
@@ 172-184 (lines=13) @@ | ||
169 | * |
|
170 | * @return array Test results. |
|
171 | */ |
|
172 | protected function test__outbound_https() { |
|
173 | $name = __FUNCTION__; |
|
174 | $request = wp_remote_get( preg_replace( '/^http:/', 'https:', JETPACK__API_BASE ) . 'test/1/' ); |
|
175 | $code = wp_remote_retrieve_response_code( $request ); |
|
176 | ||
177 | if ( 200 === intval( $code ) ) { |
|
178 | $result = self::passing_test( $name ); |
|
179 | } else { |
|
180 | $result = self::failing_test( $name, __( 'Your server did not successfully connect to the Jetpack server using HTTPS', 'jetpack' ), 'outbound_requests' ); |
|
181 | } |
|
182 | ||
183 | return $result; |
|
184 | } |
|
185 | ||
186 | /** |
|
187 | * Check for an IDC. |