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

Partial LazyLoad Reference Causes 404 error in Google Search Console #795

Closed
arunbasillal opened this issue Mar 9, 2018 · 4 comments
Closed
Assignees
Labels
priority: low Issues that can wait type: bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@arunbasillal
Copy link
Contributor

arunbasillal commented Mar 9, 2018

Google search console for some reason picks up the partial file reference from our LazyLoad JS and throws a 404 error saying the following file is missing:

http://example.com/wp-content/plugins/wp-rocket/inc/front/js/lazyload-

This is a false positive and can be ignored. But we get tickets regarding this and it bothers some of our users.

Possible solution - Include a dummy file with the file name. Worked for a user.

Related tickets:

@arunbasillal arunbasillal added type: bug Indicates an unexpected problem or unintended behavior minor labels Mar 9, 2018
@arunbasillal arunbasillal self-assigned this Mar 9, 2018
arunbasillal added a commit that referenced this issue Mar 9, 2018
@arunbasillal arunbasillal modified the milestone: 2.11.7 Mar 9, 2018
@arunbasillal
Copy link
Contributor Author

arunbasillal commented Apr 25, 2018

Explore how this can be resolved using robots_txt filter instead of a dummy file - https://developer.wordpress.org/reference/hooks/robots_txt/

https://docs.wp-rocket.me/article/1085-lazyload-404-error-in-google-search-console

@glueckpress
Copy link
Contributor

Blocking the broken URL via robots.txt doesn’t seem to be reliable. One customer reported the URL got “indexed though blocked by robots.txt”.

@arunbasillal
Copy link
Contributor Author

arunbasillal commented May 2, 2018

Thanks @glueckpress . Having a dummy file isn't an elegant solution either.

Maybe instead of

var v = !("IntersectionObserver" in w) ? "8.7.1" : "10.5.2";
s.src = "https://www.example.com/wp-content/plugins/wp-rocket/inc/front/js/lazyload-" + v + ".min.js";

we should simply go for:

s.src = !("IntersectionObserver" in w) ? "https://www.example.com/wp-content/plugins/wp-rocket/inc/front/js/lazyload-8.7.1.min.js" : "https://www.example.com/wp-content/plugins/wp-rocket/inc/front/js/lazyload-10.5.2.min.js";

@Tabrisrp - Is this a better solution?

@Tabrisrp
Copy link
Contributor

Tabrisrp commented Jul 4, 2018

I like this better yes

@Tabrisrp Tabrisrp added this to the 3.1.2 milestone Aug 9, 2018
@arunbasillal arunbasillal added the priority: low Issues that can wait label Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low Issues that can wait type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants