WordPress.org

Ready to get started?Download WordPress

Forums

WP Socializer
[resolved] Errors during W3C Validation (9 posts)

  1. ifaist0s
    Member
    Posted 1 year ago #

    Heya,

    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 validator.w3.org. I have spotted one of the errors:
    File: wp-socializer.php
    Line: 201
    Issue: validator.w3.org 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
    http://www.blogger.com/blog_this.pyra?t&u=http
    This is the validator's suggestion
    & did not start a character reference. (& probably should have been escaped as &.)

    http://wordpress.org/extend/plugins/wp-socializer/

  2. vaakash
    Member
    Plugin Author

    Posted 1 year ago #

    Hello,

    Thanks for the notification. Ill fix that soon.

  3. acmeous
    Member
    Posted 1 year ago #

    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,
    Acmeous.

  4. vaakash
    Member
    Plugin Author

    Posted 1 year ago #

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

  5. mhbeyle
    Member
    Posted 1 year ago #

    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.

    Regards.

  6. sadiem
    Member
    Posted 1 year ago #

    @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.

  7. vaakash
    Member
    Plugin Author

    Posted 1 year ago #

    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.

    http://wordpress.org/extend/plugins/wp-socializer/

    Thank you.

  8. mattbeck
    Member
    Posted 1 year ago #

    xhtml fix is just cdata

    <script type="text/javascript">
    //<![CDATA[
    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 . '
    //]]>
    </script>

  9. ifaist0s
    Member
    Posted 1 year ago #

    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)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic