Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats/visits endpoint no longer supports quantity parameter #35414

Closed
staskus opened this issue Feb 2, 2024 · 3 comments
Closed

stats/visits endpoint no longer supports quantity parameter #35414

staskus opened this issue Feb 2, 2024 · 3 comments
Assignees
Labels
[Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Feature] WPCOM API [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] High [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended

Comments

@staskus
Copy link

staskus commented Feb 2, 2024

Impacted plugin

Jetpack

Quick summary

stats/visits started ignoring quantity parameter when returning pieces of data. It directly affects API users such as Jetpack app.

Expected behavior (before)

WP.COM API GET v1.1/sites/3584907/stats/visits/?period=week&quantity=1

Response
  {
  "date": "2024-02-02",
  "unit": "day",
  "fields": [
    "period",
    "views",
    "visitors",
    "likes",
    "reblogs",
    "comments",
    "posts"
  ],
  "data": [
    [
      "2024-02-02",
      1299,
      961,
      50,
      0,
      4,
      0
    ]
  ]
}

Current behavior (now)

WP.COM API GET v1.1/sites/3584907/stats/visits/?period=week&quantity=1

Response
 {
  "date": "2024-02-02",
  "unit": "day",
  "fields": [
    "period",
    "views",
    "visitors",
    "likes",
    "reblogs",
    "comments",
    "posts"
  ],
  "data": [
    [
      "2024-01-04",
      2857,
      2160,
      74,
      0,
      3,
      0
    ],
    [
      "2024-01-05",
      4235,
      2901,
      176,
      0,
      8,
      1
    ],
    [
      "2024-01-06",
      4652,
      3517,
      171,
      0,
      6,
      0
    ],
    [
      "2024-01-07",
      4035,
      3117,
      95,
      0,
      9,
      0
    ],
    [
      "2024-01-08",
      3908,
      2782,
      333,
      0,
      12,
      1
    ],
    [
      "2024-01-09",
      3531,
      2462,
      208,
      0,
      18,
      0
    ],
    [
      "2024-01-10",
      4386,
      2210,
      127,
      0,
      18,
      6
    ],
    [
      "2024-01-11",
      4451,
      2832,
      303,
      0,
      5,
      1
    ],
    [
      "2024-01-12",
      3163,
      2142,
      237,
      0,
      14,
      0
    ],
    [
      "2024-01-13",
      2545,
      1677,
      114,
      0,
      10,
      0
    ],
    [
      "2024-01-14",
      2163,
      1427,
      76,
      0,
      12,
      0
    ],
    [
      "2024-01-15",
      5751,
      3479,
      373,
      0,
      9,
      1
    ],
    [
      "2024-01-16",
      2812,
      2037,
      237,
      0,
      4,
      0
    ],
    [
      "2024-01-17",
      2200,
      1675,
      103,
      0,
      7,
      0
    ],
    [
      "2024-01-18",
      2189,
      1564,
      98,
      0,
      8,
      0
    ],
    [
      "2024-01-19",
      1982,
      1447,
      85,
      0,
      8,
      0
    ],
    [
      "2024-01-20",
      1739,
      1231,
      100,
      0,
      7,
      0
    ],
    [
      "2024-01-21",
      1908,
      1293,
      57,
      0,
      15,
      0
    ],
    [
      "2024-01-22",
      2999,
      2026,
      276,
      0,
      13,
      1
    ],
    [
      "2024-01-23",
      3832,
      2411,
      191,
      0,
      24,
      0
    ],
    [
      "2024-01-24",
      3621,
      2510,
      193,
      0,
      14,
      1
    ],
    [
      "2024-01-25",
      2828,
      2014,
      163,
      0,
      18,
      0
    ],
    [
      "2024-01-26",
      2413,
      1655,
      151,
      0,
      9,
      0
    ],
    [
      "2024-01-27",
      1798,
      1308,
      71,
      0,
      1,
      0
    ],
    [
      "2024-01-28",
      1895,
      1293,
      136,
      0,
      5,
      0
    ],
    [
      "2024-01-29",
      2667,
      1652,
      65,
      0,
      7,
      0
    ],
    [
      "2024-01-30",
      2430,
      1587,
      57,
      0,
      6,
      0
    ],
    [
      "2024-01-31",
      2637,
      1984,
      344,
      0,
      8,
      1
    ],
    [
      "2024-02-01",
      3555,
      2311,
      143,
      0,
      2,
      0
    ],
    [
      "2024-02-02",
      1306,
      961,
      50,
      0,
      4,
      0
    ]
  ]
}

Test details

I sandboxed and tested ~one week old API which doesn't have this issue, so that caused this issue was made recently.

Steps to reproduce

  1. https://developer.wordpress.com/docs/api/console/
  2. WP.COM API GET `v1.1/sites/$site/stats/visits/?period=week&quantity=1

Expected: 1 piece of data
Actual: 30 pieces of data

A clear and concise description of what you expected to happen.

No response

What actually happened

No response

Impact

Most (> 50%)

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

No response

Logs or notes

No response

@staskus staskus added [Type] Bug When a feature is broken and / or not performing as intended [Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Needs triage Ticket needs to be triaged labels Feb 2, 2024
@github-actions github-actions bot added [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack [Pri] High labels Feb 2, 2024
@jeherve
Copy link
Member

jeherve commented Feb 2, 2024

cc @josephscott who worked on D136850-code. Could you take a look at this?

Thanks!

@jeherve jeherve added [Feature] WPCOM API Triaged and removed Needs triage Ticket needs to be triaged labels Feb 2, 2024
@matticbot matticbot moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Feb 2, 2024
@josephscott
Copy link
Contributor

I think this has been fixed - please confirm that. Please ping me in Slack if it has not.

@staskus
Copy link
Author

staskus commented Feb 5, 2024

Thanks, @josephscott, yes it works fine now! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Stats Data Feature that enables users to track their site's traffic and gain insights on popular content. [Feature] WPCOM API [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Pri] High [Status] Priority Review Triggered The guild in charge of triage has been notified of this issue in Slack Triaged [Type] Bug When a feature is broken and / or not performing as intended
Development

No branches or pull requests

3 participants