← All changes
|
includes/integrations/class-google-search-console-client.php
+1
-10
2.14.1
→
2.14.0
View file →
| @@ -248,15 +248,12 @@ | ||
| 248 | 248 | * @param string $site_url Site URL to get data for |
| 249 | 249 | * @param string $start_date Start date (Y-m-d) |
| 250 | 250 | * @param string $end_date End date (Y-m-d) |
| 251 | 251 | * @param int $row_limit Maximum rows to return |
| 252 | - * @param array $dimensions Dimensions to group by | |
| 253 | - * @param array $filters Optional dimension filters (ANDed), each | |
| 254 | - * {dimension, operator, expression}. @since 2.15.0 | |
| 255 | 252 | * @return array Raw rows from GSC API |
| 256 | 253 | * @throws \Exception If API request fails |
| 257 | 254 | */ |
| 258 | - public function get_search_performance_by_dates(string $site_url, string $start_date, string $end_date, int $row_limit = 500, array $dimensions = ['query'], array $filters = []): array { | |
| 255 | + public function get_search_performance_by_dates(string $site_url, string $start_date, string $end_date, int $row_limit = 500, array $dimensions = ['query']): array { | |
| 259 | 256 | $endpoint = '/sites/' . rawurlencode($site_url) . '/searchAnalytics/query'; |
| 260 | 257 | |
| 261 | 258 | $request_body = [ |
| 262 | 259 | 'startDate' => $start_date, |
| @@ -267,14 +264,8 @@ | ||
| 267 | 264 | // data — matches what the Search Console web UI displays, so the |
| 268 | 265 | // last 2-4 days aren't missing. |
| 269 | 266 | 'dataState' => 'all', |
| 270 | 267 | ]; |
| 271 | - | |
| 272 | - // Optional dimension filters, ANDed, e.g. one page's queries: | |
| 273 | - // [['dimension' => 'page', 'operator' => 'equals', 'expression' => $url]]. | |
| 274 | - if (!empty($filters)) { | |
| 275 | - $request_body['dimensionFilterGroups'] = [['filters' => array_values($filters)]]; | |
| 276 | - } | |
| 277 | 268 | |
| 278 | 269 | $full_url = self::API_BASE_URL . $endpoint; |
| 279 | 270 | $response = $this->make_request($full_url, $request_body, 'POST'); |
| 280 | 271 | |