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

Statify REST API Endpoint #219

Closed
Zodiac1978 opened this issue Nov 13, 2021 · 1 comment · Fixed by #226
Closed

Statify REST API Endpoint #219

Zodiac1978 opened this issue Nov 13, 2021 · 1 comment · Fixed by #226

Comments

@Zodiac1978
Copy link
Member

This issue is meant to be a starting point for discussing the usage of a custom REST API endpoint for tracking and/or showing data.

@stklcode
Copy link
Contributor

stklcode commented Nov 16, 2021

Why not.

Tracking:
For tracking this should be a replacement for the AJAX call we use right now. If there are concerns about compatibility (we know there are some custom JS implementations out there from the AJAX migration), this might be added additionally as fourth/fifth tracking method. Think we do not want to maintain both methods indefinitely though, so AJAX should be at least marked deprecated.

Visualization:
The dashboard widget should use this endpoint, so we no longer add the JSON hidden data table to the markup. We should restrict access to the same user group as for the widget and not open a public endpoint for the world though.
Nevertheless, this endpoint might be reused for frontend visualization (#224) in future releases.

@florianbrinkmann florianbrinkmann linked a pull request Mar 19, 2023 that will close this issue
@stklcode stklcode added this to the 2.0.0 milestone Mar 19, 2023
stklcode added a commit that referenced this issue Mar 20, 2023
Use a custom WP REST route for tracking requests. The tracking
logic is moved up into Statify class. The API logic is separated
into a new class, so additional endpoints can be added there.

Override the default nonce behavior for the tracking endpoint to
preserve the logged-in flag with nonce verification disabled.
stklcode added a commit that referenced this issue Mar 20, 2023
Dynamically fetch data for chart and top lists from WP API.
We add some placeholders in the backend code to hopefully reduce
layout shifts and replace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants