Skip to content

CMM-1221 add remaining most viewed endpoints#1151

Draft
adalpari wants to merge 30 commits intotrunkfrom
task/CMM-1221-Add-renaming-Most-Viewed-endpoints
Draft

CMM-1221 add remaining most viewed endpoints#1151
adalpari wants to merge 30 commits intotrunkfrom
task/CMM-1221-Add-renaming-Most-Viewed-endpoints

Conversation

@adalpari
Copy link
Contributor

@adalpari adalpari commented Feb 5, 2026

Summary

  • Add stats region views endpoint for regional/state/province level analytics
  • Add stats city views endpoint for city-level analytics with coordinates
  • Add stats top authors endpoint for author traffic analytics
  • Update stats visits endpoint to use WPComLanguage for locale parameter

Changes

New Location Stats Endpoints

  • Region Views (/sites/{id}/stats/location-views/region): Regional/state/province level stats within countries
  • City Views (/sites/{id}/stats/location-views/city): City-level stats with latitude/longitude coordinates for map markers

New Content Stats Endpoint

  • Top Authors (/sites/{id}/stats/top-authors): Author traffic analytics with post-level breakdowns, follow data, and view counts

Improvements

  • Stats visits endpoint now uses WPComLanguage enum instead of String for the locale parameter
  • All new endpoints follow the same patterns as stats_country_views:
    • summarize: bool defaulting to true
    • Support for summary (aggregated) and days (per-day breakdown) response formats
    • Comprehensive param serialization and response deserialization tests

adalpari and others added 17 commits January 29, 2026 11:44
…-the-stats-country-endpoint

# Conflicts:
#	wp_api/src/wp_com/client.rs
#	wp_api/src/wp_com/endpoint.rs
#	wp_api/src/wp_com/mod.rs
Create a new endpoint for stats region views following the
stats_country_views pattern. This provides location analytics
at the region/state/province level within countries.

- Add StatsRegionViewsParams with period, date, summarize, etc.
- Add StatsRegionViewsResponse with summary and days fields
- Add endpoint at /sites/{id}/stats/location-views/region
- Add comprehensive unit tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Create a new endpoint for stats city views following the
stats_country_views pattern. This provides location analytics
at the city level with coordinate-based map markers.

- Add StatsCityViewsParams with period, date, summarize, etc.
- Add StatsCityViewsResponse with summary and days fields
- Add StatsCityCoordinates for latitude/longitude data
- Add endpoint at /sites/{id}/stats/location-views/city
- Add comprehensive unit tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@adalpari adalpari changed the title CMM-1221 add renaming most viewed endpoints CMM-1221 add remaining most viewed endpoints Feb 5, 2026
@jkmassel jkmassel force-pushed the task/CMM-1202-create-the-stats-country-endpoint branch from 4aa8913 to 9208e76 Compare February 5, 2026 19:04
Base automatically changed from task/CMM-1202-create-the-stats-country-endpoint to trunk February 5, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants