Wp-rocket: Partial LazyLoad Reference Causes 404 error in Google Search Console

Created on 9 Mar 2018  ·  4Comments  ·  Source: wp-media/wp-rocket

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:

lazyload low bug

All 4 comments

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”.

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?

I like this better yes

Was this page helpful?
0 / 5 - 0 ratings