Shareaholic Breaks W3C Valadation in HTML5
-
WP 4.3.1 – Shareaholic Version 7.7.0.0
My client is insisting on W3C Validation for their website:
El Dorado Beach ResortThe theme is written in HTML5.
While testing this with W3C Validation:
With Shareaholic Disabled, the above page Passes with no errors.
With Shareaholic Enabled, the above page Fails with the following error…
Error: X-UA-Compatible HTTP header must have the value IE=edge, was IE=edge,chrome=1.
This only happens with an HTML5 Theme – but it appears to me this error happens with any HTML5 Theme (I’ve tried a few!)
Investigation revealed that “chrome=1” is not valid in HTML5 (not valid in both meta tags and not valid in headers.
Likewise Google discontinued the Chrome Frame project running 2 years ago.
I did a scan of my current (large) collection of plugins and themes and found that many use “IE=edge” but None used either “chrome=1” nor the combo “IE=edge,chrome=1” used by Shareaholic and causing this W3C error.
I would suggest changing the following in the Shareaholic utilities.php file.
function add_header_xua – Line 1076
From:
$headers['X-UA-Compatible'] = 'IE=edge,chrome=1';
To:
$headers['X-UA-Compatible'] = 'IE=edge';
This solves the HTML% Validation Error!
Because chrome frame is no longer supported by Google, I would also recommend…
function draw_meta_xua Line 1086
From:
echo '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">';
To:
echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
The above works! I hope this, or some other HTML5 fix, will be in the next version so I do not need to edit this error out of each Shareaholic upgrade.
Thank You!
- The topic ‘Shareaholic Breaks W3C Valadation in HTML5’ is closed to new replies.