Automattic / Automattic/jetpack
VideoPress: videopress/v1/stats endpoint fails when the Jetpack plugin is not active
- Dominant language
- PHP
- Stars
- 1.8k
- Forks
- 898
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 774
Description
The `videopress/v1/stats` endpoint relies on the `sites/%d/stats/video-plays` WPCOM endpoint, that is only available if the Jetpack Stats module is active.
Currently, the Jetpack Stats module is only active if the Jetpack plugin is active, and therefore the `videopress/v1/stats` will not work properly without the Jetpack plugin active.
In this scenario, the response from `sites/%d/stats/video-plays` is as follow:
```
{
"code": 404,
"headers": [
{
"name": "Content-Type",
"value": "application\/json"
}
],
"body": {
"error": "invalid_blog",
"message": "This blog does not have the Stats module enabled"
}
}
```
We need to find a way to have the stats available when only the standalone VideoPress plugin is active.
Contributor guide
Research direction
Start by tracing the videopress/v1/stats endpoint and its request to sites/%d/stats/video-plays, then inspect how the standalone VideoPress plugin enables or accesses the Jetpack Stats module. Done means videopress/v1/stats returns video statistics when only the standalone VideoPress plugin is active, rather than the invalid_blog response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100