ShareThis causes numerous 3rd party tracking and ad server calls. Page load time is severely degraded and often incomplete. Removing the ShareThis Block from all pages is not sufficient to stop these processes. A method finding, disabling, and removing the ShareThis module and/or scripts, and cleanup is needed.

Comments

Virginian created an issue. See original summary.

Virginian’s picture

It took 4 steps for me to disable ShareThis (aka OpenChurchShare) and clean up. The first 2 steps were deleting the ShareThis Block (which removes the Share buttons or "chicklets" from all pages), and deleting OpenChurch Share (module?), which only allows entry of a publisher key, with no other options or controls available to the user. However, these 2 steps will not not stop the stream of 3rd party ad and tracking server traffic, and there is no way to simply turn it off or disable it.

Javascript in the theme's (template) head section is responsible for opening the gate to to the ShareThis and affiliated servers, allowing them to change whatever they wish from their end by modifying the actual javascript file. I have medium speed DSL at home, and have observed the sequence of ad and tracking server calls last for several minutes sometimes, and occasionaly resulting in timeouts and incomplete page load. It's a severe performance hit, serious privacy issue, and vulnerability exists for security issues.

So, the 3rd step is php code change in openchurch_theme.theme, in which hook_js_alter is removed, and the hook_preprocess_HOOK() for node.html.twig (for getting the Publisher ID number) is removed. This stops the javascript from running (by removing it) and cleans up. The 2 sections of code to be removed are as follows:
_____________________________________________________
/**
* Implements hook_js_alter().
*/
function openchurch_theme_js_alter(&$javascript) {
$sharethis = '//w.sharethis.com/button/buttons.js';
$javascript[$sharethis] = array(
'type' => 'file',
'scope' => 'header',
'data' => $sharethis,
);
}
____________________________________________________

$variables['publisher_key'] = \Drupal::configFactory()->get('openchurch.settings')->get('sharethis_publisher_key');
____________________________________________________

Then go to Configuration/(Development)Performance and select "Clear All Caches" to complete cleanup.

I am new to Drupal, and not very familiar with how issues like this are officially processed through. A better solution might be to develop an option to simply turn off ShareThis and disable the javascript, possibly by moving it to the block so it would not run if the Block is not used, and removed if the Block is deleted. However, completely removing OpenChurch Share should at least remove the javascript to prevent this problem. I chose to delete everything simply because of the intrusion and impact it has on performance and privacy, and so I could move on with my project! There are less intrusive social share solutions out there, but I'll probably use simple code directly from the few that are most used, such as Facebook and Twitter, and a share by e-mail function.

  • drupalninja99 committed 11a3026 on
    Issue #2651900 by drupalninja99: Added a condition to check ShareThis...
drupalninja99’s picture

Status: Active » Fixed

@Virginian I believe, I have this fixed now in dev. With this fix all you would need to do is disable the block to disable the ShareThis calls.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

BEGRAFX’s picture

I'm not sure if this is the same issue or not... Please review https://www.drupal.org/node/2843463