Coding for the New Year

Just a quickie before diving into 2011;

And this is how I feel about 2011:

Jon Hopkins – Light Through The Veins (Full 9 Minute HQ Version)

Watch this video on YouTube.

Have a great New Year!

20 thoughts on “Coding for the New Year

  1. cimddwc

    Thanks for the DoNotTrack plugin! I’m testing it on my second blog now, and it seems to work fine blocking Quantserve so far.

    However, it breaks some existing, “good” document.write by making every written text lower-case. My quick solution was to replace the beginning of function sanitizer in the JS file with tSL=tS.toLowerCase(); if((tSL.indexOf(unescape('%3Cscript'))!=-1)&&(tSL.indexOf(unescape('src='))!=-1)) {for(x in spy){if(tSL.indexOf(spy[x])!=-1){ (and leave the rest unchanged), i.e. use the toLowerCase result (in tSL) only for comparison, but not for modification and output.

    Also, do you think it’s okay to include this short Javascript inline in the header, instead of in a separate file? This would remove this additional HTTP request to load the .js file.

    Reply
      1. cimddwc

        To be nitpicking, you got one difference: you’re assigning the lower-cased modified version to the output with tS=ttS.replace(...) – but that doesn’t really matter since it only affects additional text that’s written together with an offending tracking script in the same document.write command, and everything will be fine for “good” document.writes. :)

        Putting it inline: well, the fewer external files the browser has to load, the faster the page will be loaded – though there won’t be much difference here with this small file, I guess, and it’s still faster than the Quantcast file(s).

      2. frank Post author

        it’s correct that loading less external (js- and css-) files is recommandable, and in general there are a lot of js/css-files that are included by plugins (including mine, I admit). That’s why I use the CSS/JS booster plugin (made in Germany) to move all CSS and all JS into one file each. Great plugin, really!

  2. Pingback: WordPress.com Stats plugin tracking | Not A Blog

  3. Matt

    Many thanks for donottrack – good to know the wordpress community is still classy and ready to step in when needed.

    Reply
  4. Pingback: Špijuni su među nama - third-party tracking skriven u WordPress pluginu | Not A Blog

  5. John Alexander

    Ok I want to include the tracking but only remove the call for the pixel, is this possible? to get rid of this error

    “pixel.quantserve.com/pixel…..
    Resource interpreted as Image but transferred with MIME type text/plain.”

    Reply
    1. frank Post author

      i’m afraid not john; as far as I know the tracking is done with the pixel. Just curious; what browser do you use to complain about mime-types?

      Reply
  6. Brian Yang

    Hi Frank, thanks for this awesome script.

    Today I visited my site without being logged in and noticed that something was loading from pixel.quantserve.com again and it was really slow (As in won’t load at all).

    It looks like the WP.com Stats script got updated and no longer uses document.write to insert the Quantcast script. It uses an asynchronous method now. Therefore, the notrack script doesn’t seem to work properly anymore.

    It still uses document.write to insert the Stats smiley though…

    Reply
  7. Arafin Shaon

    Hlw sir it works like a charm. But i have an issue with it. After installed ur plugin my site page loading speed got down a bit.

    Before install:-

    According to gtmetrix com my site

    Page Speed Grade: (A) 99%
    YSlow Grade: (A) 92%

    After install:-

    Page Speed Grade: (A) 95%
    YSlow Grade: (A) 93%

    My page loading speed got down 4% while YSlow Grade got up 1%. Which made me upset. Is there any solution for me?

    So what do you think about it. Waiting for ur response.

    Reply
    1. frank Post author

      I you check out http://gtmetrix.com/compare/MpKVTXQA/CJxczTrR, you can see the main differences between your site without (first) and with (second) WP DoNotTrack are:

      1. for pagespeed:
      Optimize the order of styles and scripts A (100) B (85)
      Remove query strings from static resources A (100) A (90)

      2. for yslow:
      Add Expires headers D (67) B (89)
      Put JavaScript at bottom A (100) A (95)

      3. for timeline:
      12 Requests 19.9 KB 542ms (onload: 549ms)
      11 Requests 19.4 KB 425ms (onload: 429ms)

      So:

      1. pagespeed and yslow would prefer donottrack-min.js to be loaded at the bottom of the HTML, but that would mean it wouldn’t be able to filter out script that does get loaded earlier on
      2. pagespeed would like the querystring (the part from the questionmark on in donottrack-min.js?dntver=0.7.2) to be removed, but this is needed to make sure that users don’t get an old version from a cache somewhere when when I push out an upgrade of WP DoNotTrack
      3. yslow is better thanks to the fact that you don’t load the quantcast javascript & image which do not have expires headers
      4. but most important of all: your page loads faster with WP Donottrack (and less requests, smaller total amount of data)
      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *