WordPress Social Tools, Related Posts, Monetization – Shareaholic - Version 7.0.0.10

Version Description

  • Several bug fixes, in addition to -
  • Huge update! The plugin has been completely re-written from the ground up to be faster, simpler to use
  • Choose from snazzy new Related Post themes
  • Related Posts now come mobile optimized and responsive out of the box - Shareaholic automagically determines how many Related Posts to show given how much screen width it is given
  • Customize your "You may also like" Related Posts text
  • Option to exclude any URL from Related Posts
  • Choose from new Share button themes! (including vertical share buttons!)
  • Additional URL shortener options
  • "Pages" now also have options to exclude Share Buttons, Recommendations
  • Addition of new shareaholic:language tag to improve related content and recommendations computation
  • Bugfix: Facebook Debugger will no longer show "Parser Mismatched Metadata" warnings
  • Bugfix: Page titles are now properly encoded
  • More robust curl function, more robust plugin
  • Show Related Posts data status
Download this release

Release Info

Developer shareaholic
Plugin Icon 128x128 WordPress Social Tools, Related Posts, Monetization – Shareaholic
Version 7.0.0.10
Comparing to
See all releases

Code changes from version 7.0.0.9 to 7.0.0.10

admin.php CHANGED
@@ -204,7 +204,7 @@ class ShareaholicAdmin {
204
  $action = str_replace( '%7E', '~', $_SERVER['REQUEST_URI']);
205
  if(isset($_POST['already_submitted']) && $_POST['already_submitted'] == 'Y' &&
206
  check_admin_referer($action, 'nonce_field')) {
207
- echo "<div class='updated'><p><strong>Saved.</strong></p></div>";
208
 
209
  /*
210
  * only checked check boxes are submitted, so we have to iterate
@@ -234,8 +234,11 @@ class ShareaholicAdmin {
234
 
235
  }
236
 
237
- $api_key = ShareaholicUtilities::get_or_create_api_key();
238
- ShareaholicUtilities::get_new_location_name_ids($api_key);
 
 
 
239
  self::draw_deprecation_warnings();
240
  self::draw_admin_form();
241
  self::draw_verify_api_key();
@@ -254,6 +257,13 @@ class ShareaholicAdmin {
254
  ));
255
  }
256
 
 
 
 
 
 
 
 
257
  if(isset($_POST['already_submitted']) && $_POST['already_submitted'] == 'Y') {
258
  echo "<div class='updated settings_updated'><p><strong>". sprintf(__('Settings successfully saved', 'shareaholic')) . "</strong></p></div>";
259
  foreach (array('disable_tracking', 'disable_og_tags') as $setting) {
204
  $action = str_replace( '%7E', '~', $_SERVER['REQUEST_URI']);
205
  if(isset($_POST['already_submitted']) && $_POST['already_submitted'] == 'Y' &&
206
  check_admin_referer($action, 'nonce_field')) {
207
+ echo "<div class='updated settings_updated'><p><strong>". sprintf(__('Settings successfully saved', 'shareaholic')) . "</strong></p></div>";
208
 
209
  /*
210
  * only checked check boxes are submitted, so we have to iterate
234
 
235
  }
236
 
237
+ if (ShareaholicUtilities::has_accepted_terms_of_service()) {
238
+ $api_key = ShareaholicUtilities::get_or_create_api_key();
239
+ ShareaholicUtilities::get_new_location_name_ids($api_key);
240
+ }
241
+
242
  self::draw_deprecation_warnings();
243
  self::draw_admin_form();
244
  self::draw_verify_api_key();
257
  ));
258
  }
259
 
260
+ if(isset($_POST['reset_settings']) && $_POST['reset_settings'] == 'Y') {
261
+ ShareaholicUtilities::destroy_settings();
262
+ echo "<div class='updated settings_updated'><p><strong>"
263
+ . sprintf(__('Settings successfully reset. Refresh this page to complete the reset.', 'shareaholic'))
264
+ . "</strong></p></div>";
265
+ }
266
+
267
  if(isset($_POST['already_submitted']) && $_POST['already_submitted'] == 'Y') {
268
  echo "<div class='updated settings_updated'><p><strong>". sprintf(__('Settings successfully saved', 'shareaholic')) . "</strong></p></div>";
269
  foreach (array('disable_tracking', 'disable_og_tags') as $setting) {
assets/js/main.js CHANGED
@@ -68,9 +68,7 @@ Shareaholic.click_objects = {
68
 
69
  Shareaholic.Utils.PostMessage.receive('settings_saved', {
70
  success: function(data) {
71
- setTimeout(function(){
72
- $('input[type="submit"]').click();
73
- }, 100);
74
  },
75
  failure: function(data) {
76
  console.log(data);
68
 
69
  Shareaholic.Utils.PostMessage.receive('settings_saved', {
70
  success: function(data) {
71
+ $('input[type="submit"]').click();
 
 
72
  },
73
  failure: function(data) {
74
  console.log(data);
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: shareaholic
3
  Tags: sexybookmarks, shareaholic, shareholic, facebook, twitter, linkedin, URL Shortener, bitly, tinyurl, Goo.gl, Google+1, Google Analytics, Google Plus, Google, Instapaper, Wish List, Digg, Gmail, Google Bookmarks, Translate, Tumblr, AIM, Yahoo Messenger, Delicious, StumbleUpon, mister wong, evernote, add this, addtoany, share this, sharethis, share and follow, share and enjoy, sharing is sexy, sharing is caring, yahoo, reddit, hackernews, tweet button, twitter button, fark, buffer, myspace, orkut, netlog, hubspot, weheartit, printfriendly, yammer, pinterest, google translate, bookmarks, social, email button, social share, socialize, sociable, sharebar, bookmark button, share button, social bookmarking, bookmarks menu, bookmarking, share, seo, analytics, stats, sharing, facebook like, facebook recommend, WPMU, mutisite, shortcode, yaarp, yarpp, nrelate, outbrain, linkwithin, related content, related posts, related, popular posts, popular, thumbnails, recommendations
4
  Requires at least: 2.7
5
  Tested up to: 3.5.2
6
- Stable tag: 6.1.3.8
7
 
8
  Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
9
 
@@ -141,7 +141,7 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
141
 
142
  == Changelog ==
143
 
144
- = 7.0.0.9 =
145
  * Several bug fixes, in addition to -
146
  * Huge update! The plugin has been completely re-written from the ground up to be faster, simpler to use
147
  * Choose from snazzy new Related Post themes
@@ -876,7 +876,7 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
876
 
877
  == Upgrade Notice ==
878
 
879
- = 7.0.0.9 =
880
  * Huge update! Completely re-written from the ground up to be faster and with a new simple interface! Includes brand new Share button themes (including vertical share buttons!) and Related posts themes. Related Posts now come mobile optimized and responsive out of the box - Shareaholic automagically determines how many Related Posts to show given how much screen width it is given. You can now even customize your "You may also like" text and exclude URLs.
881
 
882
  = 6.1.3.5 =
3
  Tags: sexybookmarks, shareaholic, shareholic, facebook, twitter, linkedin, URL Shortener, bitly, tinyurl, Goo.gl, Google+1, Google Analytics, Google Plus, Google, Instapaper, Wish List, Digg, Gmail, Google Bookmarks, Translate, Tumblr, AIM, Yahoo Messenger, Delicious, StumbleUpon, mister wong, evernote, add this, addtoany, share this, sharethis, share and follow, share and enjoy, sharing is sexy, sharing is caring, yahoo, reddit, hackernews, tweet button, twitter button, fark, buffer, myspace, orkut, netlog, hubspot, weheartit, printfriendly, yammer, pinterest, google translate, bookmarks, social, email button, social share, socialize, sociable, sharebar, bookmark button, share button, social bookmarking, bookmarks menu, bookmarking, share, seo, analytics, stats, sharing, facebook like, facebook recommend, WPMU, mutisite, shortcode, yaarp, yarpp, nrelate, outbrain, linkwithin, related content, related posts, related, popular posts, popular, thumbnails, recommendations
4
  Requires at least: 2.7
5
  Tested up to: 3.5.2
6
+ Stable tag: 7.0.0.10
7
 
8
  Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
9
 
141
 
142
  == Changelog ==
143
 
144
+ = 7.0.0.10 =
145
  * Several bug fixes, in addition to -
146
  * Huge update! The plugin has been completely re-written from the ground up to be faster, simpler to use
147
  * Choose from snazzy new Related Post themes
876
 
877
  == Upgrade Notice ==
878
 
879
+ = 7.0.0.10 =
880
  * Huge update! Completely re-written from the ground up to be faster and with a new simple interface! Includes brand new Share button themes (including vertical share buttons!) and Related posts themes. Related Posts now come mobile optimized and responsive out of the box - Shareaholic automagically determines how many Related Posts to show given how much screen width it is given. You can now even customize your "You may also like" text and exclude URLs.
881
 
882
  = 6.1.3.5 =
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main and first file!
4
  *
5
  * @package shareaholic
6
- * @version 7.0.0.9
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related content
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
- Version: 7.0.0.9
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Credits & Thanks: https://shareaholic.com/tools/wordpress/credits
@@ -43,7 +43,7 @@ require_once(SHAREAHOLIC_DIR . '/deprecation.php');
43
  */
44
  class Shareaholic {
45
  const URL = 'https://shareaholic.com';
46
- const VERSION = '7.0.0.9';
47
  /**
48
  * Starts off as false so that ::get_instance() returns
49
  * a new instance.
@@ -65,6 +65,9 @@ class Shareaholic {
65
  add_action('save_post', array('ShareaholicAdmin', 'save_post'));
66
  add_action('admin_head', array('ShareaholicAdmin', 'admin_head'));
67
  add_action('admin_menu', array('ShareaholicAdmin', 'admin_menu'));
 
 
 
68
 
69
  add_action('publish_post', array('ShareaholicNotifier', 'post_notify'));
70
  add_action('publish_page', array('ShareaholicNotifier', 'post_notify'));
3
  * The main and first file!
4
  *
5
  * @package shareaholic
6
+ * @version 7.0.0.10
7
  */
8
 
9
  /*
10
  Plugin Name: Shareaholic | share buttons, analytics, related content
11
  Plugin URI: https://shareaholic.com/publishers/
12
  Description: Whether you want to get people sharing, grow your fans, make money, or know who's reading your content, Shareaholic will help you get it done. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for more settings.
13
+ Version: 7.0.0.10
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Credits & Thanks: https://shareaholic.com/tools/wordpress/credits
43
  */
44
  class Shareaholic {
45
  const URL = 'https://shareaholic.com';
46
+ const VERSION = '7.0.0.10';
47
  /**
48
  * Starts off as false so that ::get_instance() returns
49
  * a new instance.
65
  add_action('save_post', array('ShareaholicAdmin', 'save_post'));
66
  add_action('admin_head', array('ShareaholicAdmin', 'admin_head'));
67
  add_action('admin_menu', array('ShareaholicAdmin', 'admin_menu'));
68
+ if (!ShareaholicUtilities::has_accepted_terms_of_service()) {
69
+ add_action('admin_notices', array('ShareaholicAdmin', 'show_terms_of_service'));
70
+ }
71
 
72
  add_action('publish_post', array('ShareaholicNotifier', 'post_notify'));
73
  add_action('publish_page', array('ShareaholicNotifier', 'post_notify'));
templates/advanced_settings.php CHANGED
@@ -26,6 +26,14 @@
26
  <input type='submit' value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'>
27
  </div>
28
  </form>
 
 
 
 
 
 
 
 
29
  </div>
30
  </div>
31
  <?php ShareaholicAdmin::include_snapengage(); ?>
26
  <input type='submit' value='<?php echo sprintf(__('Save Changes', 'shareaholic')); ?>'>
27
  </div>
28
  </form>
29
+
30
+ <form name='reset_settings' method='post' action='<?php echo $action ?>'>
31
+ <input type='hidden' name='reset_settings' value='Y'>
32
+ <fieldset>
33
+ <p>Clicking this button will reset all of your settings and start you from scratch.</p>
34
+ <input type='submit' value='<?php echo sprintf(__('Reset Everything', 'shareaholic')); ?>'>
35
+ </fieldset>
36
+ </form>
37
  </div>
38
  </div>
39
  <?php ShareaholicAdmin::include_snapengage(); ?>
utilities.php CHANGED
@@ -51,12 +51,22 @@ class ShareaholicUtilities {
51
  * get the shareaholic settings. If the settings
52
  * have not been set it will return an array of defaults.
53
  *
54
- * @return mixed
55
  */
56
  public static function get_settings() {
57
  return get_option('shareaholic_settings', self::defaults());
58
  }
59
 
 
 
 
 
 
 
 
 
 
 
60
  /**
61
  * Returns the defaults we want becuase PHP does not allow
62
  * arrays in class constants.
@@ -320,7 +330,11 @@ class ShareaholicUtilities {
320
  return true;
321
  }
322
 
323
- $api_key = self::get_or_create_api_key();
 
 
 
 
324
  $response = ShareaholicCurl::get(Shareaholic::URL . '/publisher_tools/' . $api_key . '/verified');
325
  $result = $response['body'];
326
 
@@ -403,18 +417,6 @@ class ShareaholicUtilities {
403
  * Returns the api key or creates a new one.
404
  */
405
  public static function get_or_create_api_key() {
406
- $trace = debug_backtrace();
407
- $old_timezone = date_default_timezone_get();
408
- date_default_timezone_set('UTC');
409
- $things_to_log = array(
410
- 'request_uri' => $_SERVER['REQUEST_URI'],
411
- 'calling_location' => $trace[0]['file'] . ':' . $trace[0]['line'],
412
- 'time' => date('l jS \of F Y h:i:s A')
413
- );
414
- date_default_timezone_set($old_timezone);
415
-
416
- ShareaholicUtilities::log($things_to_log);
417
-
418
  $settings = self::get_settings();
419
  if (isset($settings['api_key']) && !empty($settings['api_key'])) {
420
  return $settings['api_key'];
@@ -430,6 +432,7 @@ class ShareaholicUtilities {
430
  'site_name' => get_bloginfo('name'),
431
  'domain' => self::site_url(),
432
  'platform' => 'wordpress',
 
433
  'recommendations_attributes' => array(
434
  'locations_attributes' => array(
435
  array('name' => 'post_below_content'),
@@ -596,4 +599,4 @@ class ShareaholicUtilities {
596
  }
597
 
598
  }
599
- ?>
51
  * get the shareaholic settings. If the settings
52
  * have not been set it will return an array of defaults.
53
  *
54
+ * @return array
55
  */
56
  public static function get_settings() {
57
  return get_option('shareaholic_settings', self::defaults());
58
  }
59
 
60
+ /**
61
+ * Destroys all settings except the acceptance
62
+ * of the terms of service.
63
+ *
64
+ * @return bool
65
+ */
66
+ public static function destroy_settings() {
67
+ return delete_option('shareaholic_settings');
68
+ }
69
+
70
  /**
71
  * Returns the defaults we want becuase PHP does not allow
72
  * arrays in class constants.
330
  return true;
331
  }
332
 
333
+ $api_key = $settings['api_key'];
334
+ if (!$api_key) {
335
+ return false;
336
+ }
337
+
338
  $response = ShareaholicCurl::get(Shareaholic::URL . '/publisher_tools/' . $api_key . '/verified');
339
  $result = $response['body'];
340
 
417
  * Returns the api key or creates a new one.
418
  */
419
  public static function get_or_create_api_key() {
 
 
 
 
 
 
 
 
 
 
 
 
420
  $settings = self::get_settings();
421
  if (isset($settings['api_key']) && !empty($settings['api_key'])) {
422
  return $settings['api_key'];
432
  'site_name' => get_bloginfo('name'),
433
  'domain' => self::site_url(),
434
  'platform' => 'wordpress',
435
+ 'shortener' => 'shrlc',
436
  'recommendations_attributes' => array(
437
  'locations_attributes' => array(
438
  array('name' => 'post_below_content'),
599
  }
600
 
601
  }
602
+ ?>