Disconnected ShareThis plugin for Wordpress

I see the ShareThis plugin on tons of Wordpress blogs — and with reason, because the presentation is quite nice. You don’t have to take up a chunk of the screen listing all of the different social networks (and they keep multiplying…) or offering the option to email this post to a friend; instead you have a simple link that shows all of the useful detail in a little popup.

ShareThis was so popular, in fact, that a business has sprouted up around it — and current versions of the plugin are tightly bound into the ShareThis.com website. They collect data every time anyone even clicks the link to open the ShareThis window, the social networks links all redirect through the ShareThis.com servers, and all that data (associated with your website) is there for detailed reporting if you register with them. They now also encourage your visitors to sign up. I’m sure it has its uses, and they’re supported by advertising revenue, so they want lots of people to sign up and I imagine they use all that data in conjunction with showing those ads.

Note: I haven’t registered, so I don’t know where the ads come into it… I just read their terms privacy policy where they mention advertising revenue, and using your data. For example:

…by posting or submitting content or materials on public areas of the service, such as public message boards, etc., you are giving us permission to use your submission in connection with the operation of ShareThis, including the right to copy, transmit, publicly display and reformat your submissions on ShareThis.

And “ShareThis is supported by advertising revenue. Some of the advertisements may be targeted.” Etc..

Unfortunately, the tracking features slow down the process (there’s a delay while it opens the window, visitors have to wait for the redirects, etc.)… but more importantly, they creep me out (I want control of my data!), and you can’t turn them off even if you aren’t interested in all the related features. Each time someone clicks the icon, forwards an email, submits a link, etc. there’s a step in there that goes through r.sharethis.com, and it’s all tracked and associated with your blog.

You can still download older versions (since before all of the tracking features were added) from here… but then you’re missing out on bug fixes.

My personal solution was to download the “ShareThis Classic” plugin from the website of Alex King (the original creator) — since it includes bugfixes and is the last version before the entire ShareThis popup started to be loaded directly from ShareThis.com. It does include the tracking features, but it’s pretty easy to disable them if you know at least minimal PHP:

  • First, make sure you have a backup of the zip file (to reinstall if needed)
  • Visit the Plugins page in wp-admin
  • Make sure ShareThis Classic is deactivated (click Deactivate if not)
  • Click Edit
  • Search the page for references to “r.sharethis.com”
  • Update the code to remove the redirects and links (more details below)
  • Click “Update File”, reactive the plugin, and make sure you haven’t broken anything!

    Example changes:

    Remove the redirect from a link:

    return 'http://r.sharethis.com/web?destination=' + encodeURIComponent(base) + '&publisher=' + pubid;

    CHANGE TO:

    return base;

    Remove the image (which identifies you when it’s loaded)…

    <img src="http://r.sharethis.com/powered-by?publisher=<?php print(get_option('st_pubid')); ?>" alt="Powered by ShareThis" />

    CHANGE TO:

    Powered by ShareThis

    Remove the reporting of an email submission:

    require_once(ABSPATH.WPINC.'/class-snoopy.php');
    $snoop = new Snoopy;
    $snoop->agent = 'ShareThis Classic for WordPress';
    $snoop->fetch('http://r.sharethis.com/email?url='.urlencode(get_permalink($post_id)).'&publisher='.get_option('st_pubid'));

    [Just remove those lines.]

    …and remove another redirect:

    print('                <li><a href="http://r.sharethis.com/web?destination='.urlencode($link).'&publisher='.get_option('st_pubid').'" id="akst_'.$key.'">'.$data['name'].’</a></li>’.”\n”);

    CHANGE TO:

    print('                <li><a href="'.$link.'" id="akst_'.$key.'">'.$data['name'].’</a></li>’.”\n”);

    That one’s a bit ugly….

    Wait: is this legal?

    Short answer: Yes.

    Longer answer: The PHP code is licensed under the open source GPL (GNU Public License). That means you can edit it however you like, and you can even redistribute your changed source code — though I’m not redistributing the whole plugin right now, since it’s trivial to make these changes yourself, and I haven’t looked up the licensing for that ShareThis image.

    I also notice that the terms in ShareThis.com include a lot of restrictions that are NOT allowed by the GPL, even though the PHP itself is still licensed that way — they make claims like this:

    You may not reverse engineer, decompile, or disassemble any aspect of ShareThis Widgets. You may not modify, adapt, or create derivative works from the ShareThis Widgets. Do not remove proprietary notices. Do not help any one else to do any of the things prohibited in this paragraph.

    …which, frankly, are nonsense, assuming “ShareThis Widgets” comprise the PHP plugin… and what other code would they mean? Huh. Anyway — GPL. Go read it if you aren’t sure (perhaps the ShareThis lawyers ought to read it… it’s in the header of the PHP file).


    Comments

    1. Quote

      I have to disagree with your post. Sure, ShareThis might be tracking this data, but I love seeing the reports they generate. As a publisher and site owner, it is very important to understand where my content is going and what is being shared. If my visitors want to sign up for their free service, then even better because it will make their experience on my site better. I do agree though that the box loads a little slower, but I’m sure they are working on improving that. And, Sharethis should be the least of your worries. You might want to start worrying about Google and how deep they are getting into sites and users’ profiles.

    2. Quote

      @James B: Sure, ShareThis is certainly not the *most* of my worries. I also run my own mailserver, and don’t use Google Apps, for example.

      But I also get the sense that people don’t understand the possible repercussions of letting companies all over the web gather and share their information. Yes, giving them this information enables services that are valuable — and the ShareThis reports are a good example of that — but they are not “free”.

      I’ve read a lot of accounts recently about women who change their “single” status to “engaged” on Facebook… and are immediately flooded with ads for wedding-related services (even if that’s the *last* thing they want to see..). One woman in this situation was aghast, and set her status back to “single” to try to avoid the ads… only to have her friends and family suddenly concerned that the engagement was off. It’s messy.

      ShareThis is on a much smaller scale, though I don’t know who they will partner with along the way, and what information they will share now or in the future with paying advertisers. Notice how the terms of service on their website (like many, many places) stipulates that the terms may change at any time without notice. Why do that? I run an online business — my privacy terms are clear, and I specifically say I’ll contact users and give them the chance to opt out if the privacy terms are going to change. It’s not hard.

      But it’s not the end of the world, either way — if you know the price you’re paying (however vague that price may be) and it’s worth the service you’re getting, then good. If you don’t think it’s worth it (this is where I am) then I at least want the ability to opt out.

      This post was about making it easy to opt out for those who want to.

    3. Quote

      Rob - you should try out our iBegin Share tool (linked as my name). Fully open source, and comes with printing/pdf/Word doc support.

    4. Quote

      Checked iBegin Share, and it looks quite nice. As far as I understand, it will not send information to any third party, and it logs only the pages that are being shared, but not any personal information (except IP address). Is that correct? It also is possible to translate it. And it is open source. :)

    5. Quote
      Joseph Kulandai said 23rd May, 2008, 15:07 CET:

      Excellent post! Thanks!!

    6. Quote
      Joseph Kulandai said 24th May, 2008, 10:17 CET:

      Hi, I have customized and used this plugin and working well. Thanks!

      After a mail is sent, the page gets forwarded to an error page! Its the same way happening in your site also. See the title of the page.

      Can you please share the idea to fix that?

    7. Quote

      I had similar experience, the customized plugin worked fine except the error page.
      I changed to iBegin Share, but it has problems with character encoding, so I would get back to Rob’s nice customized Share plugin, if there is a fix for that error message problem.

    Leave a Comment

    (required)

    (required)

    Formatting Your Comment

    The following XHTML tags are available for use:

    <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    URLs are automatically converted to hyperlinks.

    Close
    Powered by ShareThis (custom mod)