Support » Plugin: WP Socializer » [Plugin: WP Socializer] Errors during W3C Validation

  • Resolved Tony



    Thanks for the WP Socializer plugin which I use in one WP installation. It all looks cool. The only trouble it gives me is when trying to validate my site with I have spotted one of the errors:
    File: wp-socializer.php
    Line: 201
    Issue: complains about whitespace characters inside <a> tag (the subject of the page and excerpt contain whitespace characters)
    Code: 'url' => 'mailto:?subject={de-title}&body={de-excerpt} - {de-url}', // Fixed the bug in v2.4.1 & v2.4.3

    Workaround?: Some code to parse {de-title} {de-excerpt} and {de-url} to replace whitespace with %20

    The other errors, most probably have to do with the blogger button URL
    This is the validator’s suggestion
    & did not start a character reference. (& probably should have been escaped as &.)

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author vaakash



    Thanks for the notification. Ill fix that soon.

    Hey Aakash,
    Did you get a chance to fix this issue with W3C Validator. It would really helpful if we can have this fixed. Your plugin is really nice and serves the purpose great.

    Thanks Aakash,

    Plugin Author vaakash


    Did you check out the v2.4.5 of the plugin. Is it having the same problem ?? I didn’t check that out.

    v2.4.5 of the plugin has a W3C validation error at the script that opens with this line:

    <!--WP Socializer v2.4.5 - Scripts Loader-->

    And fails with this piece of code:

    function wpsrload(){ for(var i=0;i<wc;i++){wpsrasync(wu[i]);} }

    <wc” fails when W3C validation is checking the document.


    @mhbeyle, I’m not getting the error you report, using HTML5 doctype.

    @ifaist0s and @vaakash:

    Wrapping in rawurlencode seems to fix the whitespace errors.

    I made the following changes, and my pages now validate. If you try this, please back up the file first.

    In wpsr-socialbuttons.php:

    Change Line 160 to
    ‘$deTitle = rawurlencode(trim($pTitle));’

    Change Line 163 to
    ‘$deExcerpt = rawurlencode(htmlspecialchars($pExcerpt));’

    Hope this helps someone.

    Plugin Author vaakash


    Sorry for the late reply,
    The new version v2.4.6 of WP Socializer has cleared most of the W3 Errors Please update to that version and reply back if the errors persist.

    Thank you.

    xhtml fix is just cdata

    <script type=”text/javascript”>
    var wu=[‘ . $scriptsVar . ‘],wc=’ . $scriptsCount . ‘;
    function wpsrload(){ for(var i=0;i<wc;i++){wpsrasync(wu[i]);} }
    function wpsrasync(u){var a=document.createElement(“script”);a.type=”text/javascript”;a.async=true;a.src=u;var s=document.getElementsByTagName(“script”)[0];s.parentNode.insertBefore(a,s);} ‘ . $scriptsFnc . ‘

    I upgraded to 2.4.7 and was still getting some validation errors. I tracked the errors inside wp-socializer.php line 70 which was using & instead of &a-m-p; (without the dashes – I had to write it that way in this forum, because it gets converted to & if I don’t)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: WP Socializer] Errors during W3C Validation’ is closed to new replies.