| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function get($url) |
||
| 32 | { |
||
| 33 | $headers = array( |
||
| 34 | 'Accept' => 'application/json', |
||
| 35 | ); |
||
| 36 | if ($this->apiKey) { |
||
| 37 | $headers['Api-Key'] = $this->apiKey; |
||
| 38 | } |
||
| 39 | $response = wp_remote_get($url, array( |
||
| 40 | 'headers' => $headers, |
||
| 41 | 'timeout' => $this->timeout, |
||
| 42 | )); |
||
| 43 | if (is_array($response)) { |
||
| 44 | $response = json_decode($response['body'], true); |
||
| 45 | return $response; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 70 |