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

Improve stats "all time" granularity / deprecated Google Charts code in yourls_google_viz_code() #2351

popnt opened this issue Jan 9, 2018 · 3 comments


Copy link

popnt commented Jan 9, 2018

  • YOURLS version: 1.7.2
    • Plugins enabled: none

Bug description

What is the current behavior?

The stats shown under "all time" represents more of a spot check rather than totals between each granular point.

Using a granular approach instead of an accumulation could leave out important spikes in traffic and it's not immediately obvious that the graph represents single days versus totals.

This is due to yourls_array_granularity() on line 175 functions-info.php which can simply be commented out, and commenting this out will reveal ALL days since day-0 which obviously makes the graph very busy if the time period spans several months/years.

This is a bug because…

If the granularity is every x days, then it would be more intuitive to have total clicks between each point rather than individual days as one day may misrepresent the clicks or even hide spikes altogether if the spike does not happen to fall on one granular days (which also changes over time so the graph is not reliable)

I'm describing this as a bug because it really defeats the purpose of the "all time" graph, since the graph is not reliable, changes over time, and does not reveal important spikes or trends.

ideally a total for each period instead of discarding the data before being sent to yourls_google_viz_code()

Also, not sure how this would be fixed via plugin, and since it's unwise to edit core, this brings us to an impasse

Copy link

ozh commented Jan 9, 2018

Sound arguments. I'd like to see what it would look like and see if the resulting graphs "feels" more representative.

Leaving this open for anyone willing to give it a try : edit core files and submit a couple of resulting screenshots maybe, and then if that looks neat submit your code diff as a pull request ?

Copy link

popnt commented Jan 17, 2018

Also worth mentioning is that the comment on yourls_array_granularity() ln262 in functions-infos.php points to and that URL shows the following warning:

"Warning: This API is deprecated. Please use the actively maintained Google Charts API instead. See our deprecation policy for details."

Would that warrant a new bug or should we just expand the scope of this one?

Copy link

ozh commented Jan 17, 2018

I think that falls under the same scope, if someone takes a stab at this.

@popnt popnt changed the title Improve stats "all time" granularity Improve stats "all time" granularity / deprecated Google Charts code in yourls_google_viz_code() Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

2 participants