Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
15 | 2 | public function make_request( $url ) { |
|
16 | |||
17 | 2 | $return = new \WP_Error( 1, 'Invalid URL', $url ); |
|
18 | |||
19 | 2 | if ( wp_http_validate_url( $url ) ) { |
|
20 | 1 | $request = $this->_get_data( $url ); |
|
21 | |||
22 | 1 | $return = new \WP_Error( $request['response']['code'], $request['response']['message'] ); |
|
23 | |||
24 | 1 | if ( 200 == $request['response']['code'] ) { |
|
25 | 1 | $return = $request; |
|
26 | } |
||
27 | |||
28 | } |
||
29 | |||
30 | 2 | return $return; |
|
31 | |||
32 | } |
||
33 | |||
51 | } |