Closed stklcode closed 3 years ago
Added another check for the query var sitemap-stylesheet
which is set for the XSL call. Don't see any more elegant way at the moment, but it works for me.
Rebased on top of the latest development and added test case for sitemaps.
resolves #185
The default tracking method does not detect core sitemap calls to wp-sitemap.xml, because there is no check. When WP core sitemaps are disabled, the
redirect_template
hook is too early, i.e. the sitemap does not yet know if it shall be generated or skipped, so we accidentally track 404 hits in this case.JS tracking does not seem to be affected, because there either is no
wo_footer()
for the XML output oris_404()
returnstrue
at this point.Solution: Add a check for the query variable
sitemap
as suggested in the WP Core discussion1 to the_is_internal()
check, s.t. we never try to track anything for sitemap calls.[1] https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/#comment-39484