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

Javascript inclusion when bot visits. #84

Closed
websupporter opened this issue Apr 19, 2018 · 3 comments
Closed

Javascript inclusion when bot visits. #84

websupporter opened this issue Apr 19, 2018 · 3 comments
Labels
Milestone

Comments

@websupporter
Copy link
Contributor

Javascript is not included in a cached page, when a bot was the first visitor.

As far as I can see, the problem is the interplay between those two areas:

https://github.com/pluginkollektiv/statify/blob/master/inc/statify_frontend.class.php#L268-L270

https://github.com/pluginkollektiv/statify/blob/master/inc/statify_frontend.class.php#L141-L145

@patrickrobrecht
Copy link
Member

At first view it looks like removing https://github.com/pluginkollektiv/statify/blob/master/inc/statify_frontend.class.php#L268-L270 would fix the problem, right?

@websupporter
Copy link
Contributor Author

Yes, I think so @patrickrobrecht
If I see it correctly, in track_visit() we check again, if we want to skip, so I think it is quite safe to remove this check in the wp_footer()

@patrickrobrecht
Copy link
Member

Unfortunately removing https://github.com/pluginkollektiv/statify/blob/master/inc/statify_frontend.class.php#L268-L270 is not the correct solution. After removing this, JS tracking will log 404 errors for example (because is_404() is not true for the XMLHttpRequest such that tracking is not skipped).

stklcode added a commit that referenced this issue May 19, 2018
Changed the rules for appending JS snippet to avoid caching problems.
stklcode added a commit that referenced this issue May 19, 2018
Changed the rules for appending JS snippet to avoid caching problems.
stklcode added a commit that referenced this issue May 19, 2018
Changed the rules for appending JS snippet to avoid caching problems.
@stklcode stklcode added this to the 1.7.0 milestone Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants