Support » Plugin: Harrys Gravatar Cache » Lazyload missing

  • Hello,

    for me the plugin works pretty good…
    as WP 5.5 is now supporting native lazyloading i do miss this feature in the plugin, would be nice to implement it (optional). I did write manually into line 1136 – 1142 in the imag tag… loading=’lazy’…
    now its working with lazyload, til the next update (-;

    Greetings!

    • This topic was modified 1 month, 1 week ago by omar1000.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Harry Milatz

    (@harry-milatz)

    Hi Omar,

    yes i will do so, there a lot of changes in the next version:)

    Could you show your code here?

    Best regards,
    Harry

    Harry, these are the lines I did change:
    in each <img.. I did put in loading=’lazy’ …

    if(strpos($_SERVER['HTTP_USER_AGENT'],'rv:11.0')!==false) {
    				return "<img id='{$id}' alt='{$alt}' src='{$cachefile_png}' srcset='{$srcset} 2x' class='{$css}' height='{$size}' width='{$size}' loading='lazy' />";
    			}
    			elseif(strpos($_SERVER['HTTP_USER_AGENT'],'Validator.nu')!==true)  {
    				return "<img id='{$id}' alt='{$alt}' src='{$cachefile_png}' srcset='{$srcset} 2x' class='{$css}' height='{$size}' width='{$size}' loading='lazy' />";
    			}
    			else {
    				return "<img id='{$id}' alt='{$alt}' src='{$cachefile_png}' srcset='{$srcset} 2x' scale='1.5' originals='{$size}' src-orig='{$cachefile_png}' class='{$css}' height='{$size}' width='{$size}' loading='lazy' />";
    			}

    Salut,
    Omar

    • This reply was modified 1 month, 1 week ago by omar1000.
    Plugin Author Harry Milatz

    (@harry-milatz)

    Thanks:)

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.