• Resolved logoglo

    (@logoglo)


    Ok, so I added your plugin, and added /wp.serviceworker to wprocket to exclude the url from the cache.

    However, I test my site in lighthouse, and its still erroring:

    https://www.logoglo.com/wp-content/uploads/2021/07/1.png

    I read I need to have the favicon as a png, and I checked the manifest, and it is, so unsure why its still erroring, but the main ones are the other.

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Hummm. I’m seeing the same thing. Nevertheless, the service worker is installed and I can see the offline template is being served.

    Nevertheless, I’m not seeing the error message being shown on the error template. Currently the PWA plugin injects the error message by replacing an HTML comment with the message, but when accessing the error template directly I’m not seeing any comment: https://www.logoglo.com/?wp_error_template=offline

    It seems you have an optimization plugin which is stripping out all HTML comments?

    Nevertheless, this wouldn’t explain why Lighthouse is failing the audit.

    When looking at the source code of the page, I’m seeing something peculiar:

    <script type="rocketlazyloadscript">
    		if ( navigator.serviceWorker ) {
    			window.addEventListener( 'load', function() {
    									{
    						navigator.serviceWorker.register(
    							"https:\/\/www.logoglo.com\/wp.serviceworker",
    							{"scope":"\/"}						).then( reg => {
    													} );
    					}
    							} );
    		}
    	</script>

    Notice the rocketlazyloadscript type. I’m guessing this JS lazy-loading feature of WP Rocket is conflicting with Lighthouse’s audit.

    Thread Starter logoglo

    (@logoglo)

    Ahhh ok, so this is a feature of wprocket, I can add to exclude for things to work, at the moment i have this:

    /jquery.min.js
    /plugins/revslider/public/assets/js/
    setREVStartSize
    rev_slider_
    jquery
    /wp-includes/js/jquery/ui/core.min.js
    /wp-includes/js/jquery/ui/tabs.min.js
    /plugins/cornerstone/assets/dist/js/site/cs.2155f74.js
    /themes/x/framework/dist/js/site/x.js
    /plugins/wp-rocket/assets/js/lazyload/16.1/lazyload.min
    /wp-content/cache/min/1/ajax/libs/jquery/3.6.0/jquery.min.js
    /wp-includes/js/jquery/jquery.min.js
    lazyload
    window.RS_MODULES

    What could I add to exclude PWA? would it be “navigator.serviceWorker”?

    Or could it be asset clean up pro? “Strip HTML comments? This feature will strip all comments except the Internet Explorer conditional ones. If you wish to keep specific comments, use the textarea below to add exception patterns (one per line).
    Do not remove comments containing the following (case insensitive) text:”

    Thanks so much for your help thus far.

    • This reply was modified 3 years, 8 months ago by logoglo.
    Thread Starter logoglo

    (@logoglo)

    **Update. I disabled the strip html, cleared caches, and its still erroring, so Im guessing its the wprocket.

    Plugin Author Weston Ruter

    (@westonruter)

    What could I add to exclude PWA? would it be “navigator.serviceWorker”?

    I recommend excluding scripts that include wp.serviceworker.

    Thread Starter logoglo

    (@logoglo)

    Ok, but how would I know what those scripts would be? maybe you have a better idea?

    Thanks.

    Thread Starter logoglo

    (@logoglo)

    Would this work? /plugins/pwa/wp-includes/js (.*) If I add it?

    Plugin Author Weston Ruter

    (@westonruter)

    The script in question is an inline script, not an external one. So you’d need to exclude the inline script that contains wp.serviceworker from being lazy-loaded. I don’t know how WP Rocket provides configuration for that.

    Thread Starter logoglo

    (@logoglo)

    No worries, I just included all scripts tat your plugin uses, and it worked ?? im getting green..the only issue in red is now “Manifest doesn’t have a maskable icon
    A maskable icon ensures that the image fills the entire shape without being letterboxed when installing the app on a device. Learn more.”

    My favicon is a png, so not sure whats going on there, any thoughts?

    Again, thanks for your help with getting to the bottom of this.

    Plugin Author Weston Ruter

    (@westonruter)

    For the maskable icon, please see this issue: https://github.com/GoogleChromeLabs/pwa-wp/issues/304

    There is some PHP code you can use to indicate that the icon is maskable. Currently there is no UI to enable that, but that’s what the issue is for.

    Thread Starter logoglo

    (@logoglo)

    Perfect! that worked, thank you so much for all your time.

    • This reply was modified 3 years, 8 months ago by logoglo.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Lighthouse Errors’ is closed to new replies.