← All changes
|
includes/integrations/class-google-search-analytics-client.php
+3
-1
1.28.0
→
2.9.0
View file →
| @@ -47,9 +47,9 @@ | ||
| 47 | 47 | * @return array Analytical data including rows and totals. |
| 48 | 48 | * @throws \Exception If the API request fails. |
| 49 | 49 | */ |
| 50 | 50 | public function get_search_analytics_data(string $site_url, string $start_date, string $end_date, array $dimensions = [], int $row_limit = 1000): array { |
| 51 | - $endpoint = '/sites/' . urlencode($site_url) . '/searchAnalytics/query'; | |
| 51 | + $endpoint = '/sites/' . rawurlencode($site_url) . '/searchAnalytics/query'; | |
| 52 | 52 | |
| 53 | 53 | $request_body = [ |
| 54 | 54 | 'startDate' => $start_date, |
| 55 | 55 | 'endDate' => $end_date, |
| @@ -76,8 +76,10 @@ | ||
| 76 | 76 | /** |
| 77 | 77 | * Test the connection to the API |
| 78 | 78 | * |
| 79 | 79 | * @return array Connection test result |
| 80 | + * | |
| 81 | + * @throws \Exception On failure. | |
| 80 | 82 | */ |
| 81 | 83 | public function test_connection(): array { |
| 82 | 84 | try { |
| 83 | 85 | // We can't easily test without a site URL, but we can check if credentials are present |