• Resolved damngoodiam

    (@damngoodiam)


    I got this error out of no where yesterday and search console shows that it affects over 500 pages on my site.

    And Highlights this : only screen and ( min–moz-device-pixel-ratio: 2)

    Please help I have 0 developer experience.

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

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

    (@westonruter)

    @damngoodiam @standupurology Are you using the wp-appbox plugin?

    If so, I believe this is the same thing that was reported in two other topics:

    https://www.ads-software.com/support/topic/amp-css-syntax-error-in-tag-style-amp-custom-2/
    https://www.ads-software.com/support/topic/css-syntax-error-in-tag-style-amp-custom-11/

    In the wp-appbox plugin specifically. There is this CSS:

    @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min--moz-device-pixel-ratio: 1.5), only screen and (min-resolution: 240dpi) {
    	div.googleplay a.apptitle {
    		background: url(../img/googleplay-small.png);
    	}
    }

    You can see the code in wp-appbox here: https://plugins.trac.www.ads-software.com/browser/wp-appbox/tags/4.3.9/css/styles.css#L538

    The min--moz-device-pixel-ratio here is invalid. From looking at the MDN docs, this min--moz-device-pixel-ratio is ancient code that only works in Firefox versions before 16.

    Therefore, you should contact wp-appbox to have them remove this obsolete code.

    Their support forum: https://www.ads-software.com/support/plugin/wp-appbox/

    Otherwise, if you aren’t using that plugin specifically, the fix would be the same if it’s in another plugin or theme.

    It appears that Google Search Console has some additional CSS validation that is being performed beyond what the AMP validator is checking. I’ll see if I can get someone on the Search Console team to take a look.

    Nevertheless, the issue here is reported as a warning. It’s not preventing your AMP pages from being indexed, as it is not an AMP validation error.

    Plugin Author Weston Ruter

    (@westonruter)

    It seems the issue is just that the AMP Validator has recently been doing more in-depth analysis of the CSS to check for warnings. I can see the same warning when I check the URL on https://playground.amp.dev/

    The quick fix is to remove this obsolete media query. But I’ve also opened a pull request to allow both min--moz-device-pixel-ratio and max--moz-device-pixel-ratio in the validator: https://github.com/ampproject/amphtml/pull/34553

    So long story short, you can just subscribe to that pull request and after it is merged, after two weeks it should go live and then the Search Console warning will go away automatically.

    Plugin Author Weston Ruter

    (@westonruter)

    No action required ??

    Thread Starter damngoodiam

    (@damngoodiam)

    I am not using Appbox plugin, unfortunately.

    As I said I am not very good with technical things, so can you tell me the short way to get this fixed? Liked where to go in WordPress to remove the code.

    Plugin Author Weston Ruter

    (@westonruter)

    No action is required. I’ve submitted a change to add the CSS to the AMP validator so that the CSS syntax error will go away after your pages are re-crawled. In any case, Search Console says the issue is a warning and it is not blocking AMP from being indexed. So it’s not causing any problem other than causing noise at the moment. That noise should go away in the next couple weeks.

    Thread Starter damngoodiam

    (@damngoodiam)

    Thanks ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘CSS syntax error in tag ‘style amp-custom’.’ is closed to new replies.