← All changes
|
includes/integrations/class-google-search-analytics-client.php
+2
-9
2.14.1
→
2.14.0
View file →
| @@ -42,16 +42,13 @@ | ||
| 42 | 42 | * @param string $site_url The URL of the property in search console. |
| 43 | 43 | * @param string $start_date Start date in YYYY-MM-DD format. |
| 44 | 44 | * @param string $end_date End date in YYYY-MM-DD format. |
| 45 | 45 | * @param array $dimensions Dimensions to group by (e.g., 'query', 'page', 'country', 'device'). |
| 46 | - * @param int $row_limit Maximum number of rows to return (the API | |
| 47 | - * accepts up to 25,000). | |
| 48 | - * @param int $start_row Zero-based offset of the first row, for | |
| 49 | - * paging past $row_limit. @since 2.15.0 | |
| 46 | + * @param int $row_limit Maximum number of rows to return. | |
| 50 | 47 | * @return array Analytical data including rows and totals. |
| 51 | 48 | * @throws \Exception If the API request fails. |
| 52 | 49 | */ |
| 53 | - public function get_search_analytics_data(string $site_url, string $start_date, string $end_date, array $dimensions = [], int $row_limit = 1000, int $start_row = 0): array { | |
| 50 | + public function get_search_analytics_data(string $site_url, string $start_date, string $end_date, array $dimensions = [], int $row_limit = 1000): array { | |
| 54 | 51 | $endpoint = '/sites/' . rawurlencode($site_url) . '/searchAnalytics/query'; |
| 55 | 52 | |
| 56 | 53 | $request_body = [ |
| 57 | 54 | 'startDate' => $start_date, |
| @@ -61,12 +58,8 @@ | ||
| 61 | 58 | // Include fresh (still-processing) data so the most recent days |
| 62 | 59 | // aren't missing — matches the GSC web UI default. |
| 63 | 60 | 'dataState' => 'all', |
| 64 | 61 | ]; |
| 65 | - | |
| 66 | - if ($start_row > 0) { | |
| 67 | - $request_body['startRow'] = $start_row; | |
| 68 | - } | |
| 69 | 62 | |
| 70 | 63 | // Construct full URL. The API key is sent by make_request() in the |
| 71 | 64 | // x-goog-api-key header, not the query string (which proxies/logs capture). |
| 72 | 65 | $full_url = self::API_BASE_URL . $endpoint; |