W3C compliance test

From SiteRay wiki

Jump to: navigation, search
SiteRay Test
First appeared:Sitescore 1.0
Applies to:All versions
Type:Individual test
Scored:Always

What does it do?

Tests whether the website is W3C compliant (a measure of the code used to build a website).

Why is it important?

W3C is the standards body for the web, and W3C compliance is therefore a widely adopted test with many benefits. As a general rule, sites which are W3C complaint will work more consistently across web browsers, in particular new ones as they are released. They will also likely be more accessible and usable (though adoption of standards which users will tend to expect, and therefore be familiar with). They are also more likely to work on non-standard devices, such as mobile phones and televisions, which are becoming increasingly prevalent. Some search engines (notably MSN and Google Accessible) prefer W3C compliant pages.

The principles of validation generally correlates highly with good SEO (Search Engine Optimisation) practice. W3C compliance is considered one of the best assurances that the website has been built with accessibility in mind (which is a legal requirement in many countries). The UK is particularly concerned with W3C compliance.

For more reasons see: http://validator.w3.org/docs/why.html

Example results

How is it measured?

The W3C test is run on every single page of the website in turn. The overall score is based on the proportion of pages which contain no errors – a perfect score means 100% of pages are compliant.

Although this test reports W3C Warnings and Errors, only Errors count towards the final score. It is therefore possible for a site to score a perfect 10 and yet report compliance warnings.

Technical explanation

The W3C test is extremely complex and defined in detail by the various HTML / XHTML specifications of the W3C. You may need a technical background to understand them: http://www.w3.org/MarkUp/#recommendations

The actual score calculation is as follows:

proportionBroken = penaltyPageCount/noOfPages
averagePerPage = errorCount/noOfPages

score = 10-(proportionBroken*9)
			
// For almost 100% compliance, give a min of 9.5 
// Used when there's say 1 error on a 10 page site
if (score<9.5 AND (averagePerPage<0.2 OR errorCount<=2))
	score=9.5;

The results of this test should be functionally identical to those provided by the official W3C Validator, although they are implemented differently, and the two tools may report issue detail differently.

Common problems

If you think your pages are valid and that this test is marking them as invalid, bear in mind this test:

  • Displays errors and warnings in results but
  • Only counts errors towards your score

You can compare like-for-like results by filtering the W3C results in SiteRay down to a single page, and comparing these with those of the official W3C validator. They should be identical.

Some argue the value of W3C compliance. We advocate compliance wherever possible, however we acknowledge that it is not necessarily a flawless measure of code quality (it is, however, by far the most accepted).

How to improve this score

Address the compliance issues for your website. We suggest you make use of the Visual Inspector and/or Export list features, as these will put the most invalid pages at the top of your list. Depending on the technology used, whether or not your website uses templates or any form of scripting, compliance may be extremely difficult to obtain. In many cases, the most efficient solution is to rebuild the entire website. Some websites which are usually compliant can suffer when users add content to the website via a Content Management System. Many CMS’s will accept potentially invalid content from a user and thereby compromise the W3C compliance as content is updated.

How to use this test effectively

Wherever possible, use this test to fix and improve the W3C compliance of your websites. For new websites, try to insist that the website is W3C compliant to begin with. It is not easy to fix a large website which has not been designed to be compliant once it is finished.

See all SiteRay tests.
Personal tools