No img src but data-src-fg on a WordPress site

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
ajtruckle
Rank II - Novice
Posts: 47
Joined: Sat Feb 27, 2010 1:24 pm

No img src but data-src-fg on a WordPress site

Post by ajtruckle »

I am working on my Wordpress website www.publictalksoftware.co.uk and I started to run it through HTML Validator.

A repeated error was consistently raised:

Code: Select all

Error in line 639 at character 304: The "img" element (with class="fg-image") requires the "src" attribute.
So, I looked at one of the places this was raised:

Code: Select all

 <img  title="Ribbon" width="100" height="100" data-src-fg="http://www.publictalksoftware.co.uk/wp-content/uploads/cache/2018/04/pt0/3907932661.png" class="fg-image" />
I see that it has it's own

Code: Select all

data-src-fg
but no

Code: Select all

src
entry. This code is created by the FooGallery plugin. I have not yet asked there about this issue because I don't know much about Wordpress mechanics.

I don't see any setting in the options for the media to specify this:

Image

Logic tells me that it is a setting specified automatically. Anyway, what I am asking is that technically, a src parameter is being specified. It is just not called "src". Is this a issue I need to raise with the plugin developer?
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Using SEO Validation with a WordPress site

Post by Albert Wiersch »

Hello Andrew,

In the next update, CSS HTML Validator will generate this warning:
Even though this "img" (with class="fg-image") element has a "data-src-fg" attribute, it still technically requires an "src" attribute. This message is displayed up to 5 times.

You can disable that warning if you want, but note that technically "img" elements should have an "src" element. Here is more info:
https://stackoverflow.com/questions/415 ... t-just-src

So you may want to bring it up with the plugin developer... but even though it's not technically correct, it probably works "well enough" for the vast majority of people (assuming the plug-in has been thoroughly tested).

I doubt this has any significant effect on SEO but only the search engines would know for sure.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
ajtruckle
Rank II - Novice
Posts: 47
Joined: Sat Feb 27, 2010 1:24 pm

Re: Using SEO Validation with a WordPress site

Post by ajtruckle »

Ok, I have raised it here:

https://wordpress.org/support/topic/mis ... ttributes/

I also raised the query about the long lines of code (7000+ characters):

https://wordpress.org/support/topic/seo ... n-warning/