• Resolved Chuckie

    (@ajtruckle)


    I ran this page through validator.w3.org and it picked up on an interesting error (amongst others):

    This minor oversight appears to be derived from the Latest Forum Activity widget.

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

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Robin W

    (@robin-w)

    so which file did this say it was in?

    Thread Starter Chuckie

    (@ajtruckle)

    The validator.v3.org website only reports for the final HTML file and not the underlying PHP files.

    An example is on line #806 of my contact form page:

    <span class="bsp-la-text">reply by</span> <span class=" bsp-la-topic-author topic-author"><a href="" title="" class="bbp-author-link"><span class="bbp-author-avatar"><img alt='' src='' srcset='...' class='avatar avatar-14 photo' height='14' width='14' loading='lazy' decoding='async'itemprop="image" /></span><span class="bbp-author-name">...</span></a></span>

    I stripped some of the text with … . It seems to be this bit:

    <img alt='' src='...' srcset='...' class='avatar avatar-14 photo' height='14' width='14' loading='lazy' decoding='async'itemprop="image" />

    1. It does not have the space before itemprop.
    2. It seems to be using single quotes instead of double quotes.

    Since it is within the recent posts widget area assumed it was part of the plugin’s output. But I could be wrong. Maybe there is more to it?

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

    (@ajtruckle)

    I assume that line #230 of the widgets file, where it does this:

    echo $settings['reply_author_label'].'</span> <span class=" bsp-la-topic-author topic-author">' . $author_link . '</span>' ;

    I guess that the $author_link is the nuts and bolts of all that TML with the single quotes and missing space?

    FYI, Style Pack does not specifically add “loading='lazy' decoding='async'itemprop="image". It’s being added elsewhere along the way. If you have any page-speed plugins activated, specifically for image loading speed-ups, they’re the most-likely culprits. Try deactivating those plugins one at a time and re-run w3 validator to see which plugin is doing it.

    Thread Starter Chuckie

    (@ajtruckle)

    Hi @codejp3

    I do have Autoptimize, but the option for lazy loading images is unticked in that plugin.

    I also have Convertor for Media that makes my images WebP. But there is nothing in the settings, nor in the plugin description that refers to lazy loading.

    Finally, I have my one.com Performance Cache plugin.

    I have asked Autoptimize because I did find decoding='async' in their code.

    Thread Starter Chuckie

    (@ajtruckle)

    We have ruled out Autoptomize. Now I am researching Convertor for Media.

    I’ve checked out both Autoptimize and WebP Converter for Media and don’t see either of them injecting the itemprop value.

    I looked for the one.com Performance Cache plugin but I’m guessing that’s a default plugin that gets installed as a MU plugin for your hosting (not available in the WP plugin repo). That’s still suspect.

    By chance are you running your site through a CDN like CloudFlare? Those are suspect too.

    Thread Starter Chuckie

    (@ajtruckle)

    @codejp3 I switched the CDN off because it messed up my TinyMCE toolbar functionality. So I only have the caching side. It is in the plugins folder: onecom-vcache.

    Thread Starter Chuckie

    (@ajtruckle)

    I noticed the Admin Menu Editor plug-in has a lazy load JS library. I have contacted my theme provider to see what they think.

    SO after looking into onecom-vcache, apparently that plugin is an interface to the Varnish CDN provided by One.com

    https://help.one.com/hc/en-us/articles/360000080458-How-to-use-the-Performance-Cache-plugin-for-WordPress

    That does make it a suspect. However, I was not able to find anything that Varnish does specifically affecting images, so that makes it slightly less suspect.

    Admin Menu Editor shouldn’t be affecting it.

    It’s SOMETHING that’s lazy-loading images and setting them as asynchronous loading. That’s not the default action of the latest activity widget images, so it’s something external to Style Pack.

    • This reply was modified 3 years, 3 months ago by codejp3.
    Thread Starter Chuckie

    (@ajtruckle)

    I thought I would provide you with the thorough feedback that I received from my theme provider:

    What you are looking for is the get_avatar function.

    The widget you mentioned, and other pages where you have th avatar like the ones below, all have the same coding. Single quotes (instead of double) and the missing space.

    From bbpress: https://www.publictalksoftware.co.uk/support-forums/topic/instruction-for-installing-msa-for-macbook-air-m1-using-crossover/

    From theme: https://www.publictalksoftware.co.uk/author/chuckie/

    ​All these are using WordPress’s get_avatar function

    ​If you look at the coding for this function at https://developer.ww.wp.xz.cn/reference/functions/get_avatar/ you will notice the single quotes around line#2890

    wphoot

    As for the missing space, it is due to the itemprop='image' attribute. This is once again, added by WordPress core itself ( via the filters in get_avatar_data function) – the $extra_attr variable in screenshot above at line#2897.

    ​​The reason no one bothers with single quotes and missing space is because developers stopped caring about validator.w3 long long time ago.

    For example, the single quote is coming from WordPress core and not a theme or plugin.

    Unless the validator states something is broken, syntax standards can sometimes be ignored.

    As of now, the only way to fix this would be to overwrite WordPress’s core function using filters. However, this is never a good idea and generally not recommended.

    wphoot

    Well thank you sir!

    It’s WP core itself adding it. Crystal clear now.

    I suppose we could add a custom filter to address this issue, and only apply it to the latest activity widget and wherever “is_bbpress()” returns true.

    Probably add it as an optional “bbPress fix” since it’s not really a feature/styling element, and addresses a WP/bbPress core issue that most people don’t care about in the first place.

    Even though it’s not actually resolved, I’m going to mark as resolved since the mystery is cleared up and it’s not directly a Style Pack issue.

    I’ll keep this one in mind for a possible future update, but it’s not a top priority to be perfectly honest. Busy working on another large Style Pack revision and don’t want to spend time fixing non-Style Pack issues right now.

    Thread Starter Chuckie

    (@ajtruckle)

    Understood! 👍😊👌

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘No space between attributes’ is closed to new replies.