Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | public function geolocateReview(Review $review): void |
||
26 | { |
||
27 | if (defined('WP_IMPORTING')) { |
||
28 | return; |
||
29 | } |
||
30 | if (Helper::isLocalIpAddress($review->ip_address)) { |
||
31 | return; |
||
32 | } |
||
33 | $response = glsr(Geolocation::class)->lookup($review->ip_address); |
||
34 | if ($response->failed()) { |
||
35 | return; |
||
36 | } |
||
37 | glsr(StatsManager::class)->store($review, $response->body()); |
||
38 | } |
||
40 |