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

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.9
Comparing to
See all releases

Code changes from version 7.0.0.8 to 7.0.0.9

curl.php CHANGED
@@ -61,7 +61,7 @@ class ShareaholicCurl {
61
  ShareaholicUtilities::log($method);
62
  ShareaholicUtilities::log('-----------------');
63
  if ($method == 'GET') {
64
- $response = wp_remote_get($url, array('body' => $data));
65
  } elseif ($method == 'POST') {
66
  $request = array();
67
  if ($data_type == 'json') {
@@ -73,19 +73,22 @@ class ShareaholicCurl {
73
  $request['body'] = $data;
74
  }
75
  $request['headers']['Accept'] = 'application/json';
 
76
  $response = wp_remote_post($url, $request);
77
  }
78
 
79
- if( is_wp_error( $response ) ) {
80
  $error_message = $response->get_error_message();
81
  ShareaholicUtilities::log($error_message);
82
  return false;
83
  }
84
  else {
85
- $body = $response['body'];
86
- $response['body'] = ShareaholicUtilities::object_to_array(json_decode($body)) ?
87
- ShareaholicUtilities::object_to_array(json_decode($body)) : $body;
88
- return $response;
 
 
89
  }
90
  }
91
 
@@ -196,4 +199,4 @@ class ShareaholicCurl {
196
  }
197
  }
198
 
199
- ?>
61
  ShareaholicUtilities::log($method);
62
  ShareaholicUtilities::log('-----------------');
63
  if ($method == 'GET') {
64
+ $response = wp_remote_get($url, array('body' => $data, 'sslverify'=>false));
65
  } elseif ($method == 'POST') {
66
  $request = array();
67
  if ($data_type == 'json') {
73
  $request['body'] = $data;
74
  }
75
  $request['headers']['Accept'] = 'application/json';
76
+ $request['sslverify'] = false;
77
  $response = wp_remote_post($url, $request);
78
  }
79
 
80
+ if (is_wp_error($response)) {
81
  $error_message = $response->get_error_message();
82
  ShareaholicUtilities::log($error_message);
83
  return false;
84
  }
85
  else {
86
+ if(is_array($response) && array_key_exists('body', $response)) {
87
+ $body = $response['body'];
88
+ $response['body'] = ShareaholicUtilities::object_to_array(json_decode($body)) ?
89
+ ShareaholicUtilities::object_to_array(json_decode($body)) : $body;
90
+ return $response;
91
+ }
92
  }
93
  }
94
 
199
  }
200
  }
201
 
202
+ ?>
languages/shareaholic.pot CHANGED
@@ -3,9 +3,9 @@
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Shareaholic | share buttons, analytics, related content "
6
- "7.0.0.3\n"
7
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/shareaholic\n"
8
- "POT-Creation-Date: 2013-07-01 21:13:09+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -13,29 +13,35 @@ msgstr ""
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
 
 
 
 
16
  #: templates/advanced_settings.php:3
17
  msgid "Shareaholic: Advanced Settings"
18
  msgstr ""
19
 
20
  #: templates/advanced_settings.php:5
21
- msgid ""
22
- "You rarely need to edit these settings. We recommend keeping with the "
23
- "default. "
24
  msgstr ""
25
 
26
  #: templates/advanced_settings.php:15
27
  msgid "Disable Analytics"
28
  msgstr ""
29
 
30
- #: templates/advanced_settings.php:15 templates/advanced_settings.php:21
31
- msgid "(not recommended)"
32
  msgstr ""
33
 
34
  #: templates/advanced_settings.php:21
35
  msgid "Do not automatically include <code>Open Graph</code> tags"
36
  msgstr ""
37
 
38
- #: templates/advanced_settings.php:29 templates/settings.php:71
 
 
 
 
39
  msgid "Save Changes"
40
  msgstr ""
41
 
@@ -72,20 +78,20 @@ msgstr ""
72
 
73
  #: templates/footer.php:8
74
  msgid ""
75
- "If you like our work, show some love and %sgive us a good rating%s. Thanks "
76
- "for using Shareaholic, made with much love in Boston, Massachusetts."
77
  msgstr ""
78
 
79
  #: templates/meta_boxes.php:6
80
  msgid "Hide Share Buttons"
81
  msgstr ""
82
 
83
- #: templates/meta_boxes.php:15
84
- msgid "Do not include Open Graph tags"
85
  msgstr ""
86
 
87
- #: templates/meta_boxes.php:24
88
- msgid "Hide Related Content"
89
  msgstr ""
90
 
91
  #: templates/settings.php:3
@@ -138,11 +144,11 @@ msgid ""
138
  "and %sPrivacy Policy%s."
139
  msgstr ""
140
 
141
- #: templates/why_to_sign_up.php:102
142
  msgid "Edit General Website Settings"
143
  msgstr ""
144
 
145
- #: utilities.php:76
146
  msgid "Settings"
147
  msgstr ""
148
 
3
  msgid ""
4
  msgstr ""
5
  "Project-Id-Version: Shareaholic | share buttons, analytics, related content "
6
+ "7.0.0.8\n"
7
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/shareaholic\n"
8
+ "POT-Creation-Date: 2013-07-09 22:02:07+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
13
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
  "Language-Team: LANGUAGE <LL@li.org>\n"
15
 
16
+ #: admin.php:258
17
+ msgid "Settings successfully saved"
18
+ msgstr ""
19
+
20
  #: templates/advanced_settings.php:3
21
  msgid "Shareaholic: Advanced Settings"
22
  msgstr ""
23
 
24
  #: templates/advanced_settings.php:5
25
+ msgid "You rarely should need to edit the settings on this page."
 
 
26
  msgstr ""
27
 
28
  #: templates/advanced_settings.php:15
29
  msgid "Disable Analytics"
30
  msgstr ""
31
 
32
+ #: templates/advanced_settings.php:15
33
+ msgid "(it is recommended NOT to disable analytics)"
34
  msgstr ""
35
 
36
  #: templates/advanced_settings.php:21
37
  msgid "Do not automatically include <code>Open Graph</code> tags"
38
  msgstr ""
39
 
40
+ #: templates/advanced_settings.php:21
41
+ msgid "(it is recommended NOT to disable open graph tags)"
42
+ msgstr ""
43
+
44
+ #: templates/advanced_settings.php:26 templates/settings.php:71
45
  msgid "Save Changes"
46
  msgstr ""
47
 
78
 
79
  #: templates/footer.php:8
80
  msgid ""
81
+ "If you like our work, show some love and %sgive us a good rating%s. Made "
82
+ "with much love in Boston, Massachusetts."
83
  msgstr ""
84
 
85
  #: templates/meta_boxes.php:6
86
  msgid "Hide Share Buttons"
87
  msgstr ""
88
 
89
+ #: templates/meta_boxes.php:16
90
+ msgid "Hide Related Content"
91
  msgstr ""
92
 
93
+ #: templates/meta_boxes.php:26
94
+ msgid "Do not include Open Graph tags"
95
  msgstr ""
96
 
97
  #: templates/settings.php:3
144
  "and %sPrivacy Policy%s."
145
  msgstr ""
146
 
147
+ #: templates/why_to_sign_up.php:104
148
  msgid "Edit General Website Settings"
149
  msgstr ""
150
 
151
+ #: utilities.php:81
152
  msgid "Settings"
153
  msgstr ""
154
 
notifier.php CHANGED
@@ -110,4 +110,4 @@ class ShareaholicNotifier {
110
  }
111
  }
112
 
113
- ?>
110
  }
111
  }
112
 
113
+ ?>
readme.txt CHANGED
@@ -141,7 +141,7 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
141
 
142
  == Changelog ==
143
 
144
- = 7.0.0.8 =
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
@@ -155,6 +155,7 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
155
  * Bugfix: Facebook Debugger will no longer show "Parser Mismatched Metadata" warnings
156
  * Bugfix: Page titles are now properly encoded
157
  * More robust curl function, more robust plugin
 
158
 
159
  = 6.1.3.8 =
160
  * Bugfix: fixed "Cannot use object of type WP_Error"
@@ -875,7 +876,7 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
875
 
876
  == Upgrade Notice ==
877
 
878
- = 7.0.0.8 =
879
  * 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.
880
 
881
  = 6.1.3.5 =
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
155
  * Bugfix: Facebook Debugger will no longer show "Parser Mismatched Metadata" warnings
156
  * Bugfix: Page titles are now properly encoded
157
  * More robust curl function, more robust plugin
158
+ * Show Related Posts data status
159
 
160
  = 6.1.3.8 =
161
  * Bugfix: fixed "Cannot use object of type WP_Error"
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 =
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main and first file!
4
  *
5
  * @package shareaholic
6
- * @version 7.0.0.8
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.8
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.8';
47
  /**
48
  * Starts off as false so that ::get_instance() returns
49
  * a new instance.
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
  */
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.
templates/settings.php CHANGED
@@ -17,7 +17,7 @@ window.verification_key = '<?php echo $settings['verification_key'] ?>'
17
 
18
  <div id='app_settings'>
19
  <fieldset><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>/img/sharebuttons@2x.png" height=32 width=32 /> <?php echo sprintf(__('Share Buttons', 'shareaholic')); ?></h2></legend>
20
- <span class="helper"><i class="icon-question-sign"></i> Pick where you want your buttons to be displayed. Click "Edit" to customize look & feel, themes, share counters, alignment, etc.</span>
21
 
22
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
23
  <fieldset id='sharebuttons'>
@@ -44,7 +44,7 @@ window.verification_key = '<?php echo $settings['verification_key'] ?>'
44
  <div class='clear'></div>
45
 
46
  <fieldset><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>/img/related_content@2x.png" height=32 width=32 /> <?php echo sprintf(__('Related Content / Recommendations', 'shareaholic')); ?></h2></legend>
47
- <span class="helper"><i class="icon-question-sign"></i> Pick where you want Related Content to be displayed. Click "Edit" to customize look & feel, themes, block lists, etc.</span>
48
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
49
  <?php if (isset($settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"])) { ?>
50
  <?php $location_id = $settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"] ?>
@@ -63,6 +63,19 @@ window.verification_key = '<?php echo $settings['verification_key'] ?>'
63
  </div>
64
  </fieldset>
65
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  </fieldset>
67
  </div>
68
 
17
 
18
  <div id='app_settings'>
19
  <fieldset><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>/img/sharebuttons@2x.png" height=32 width=32 /> <?php echo sprintf(__('Share Buttons', 'shareaholic')); ?></h2></legend>
20
+ <span class="helper"><i class="icon-question-sign"></i><?php echo sprintf(__('Pick where you want your buttons to be displayed. Click "Edit" to customize look & feel, themes, share counters, alignment, etc.', 'shareaholic')); ?></span>
21
 
22
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
23
  <fieldset id='sharebuttons'>
44
  <div class='clear'></div>
45
 
46
  <fieldset><legend><h2><img src="<?php echo SHAREAHOLIC_ASSET_DIR; ?>/img/related_content@2x.png" height=32 width=32 /> <?php echo sprintf(__('Related Content / Recommendations', 'shareaholic')); ?></h2></legend>
47
+ <span class="helper"><i class="icon-question-sign"></i><?php echo sprintf(__('Pick where you want Related Content to be displayed. Click "Edit" to customize look & feel, themes, block lists, etc.', 'shareaholic')); ?></span>
48
  <?php foreach(array('post', 'page', 'index', 'category') as $page_type) { ?>
49
  <?php if (isset($settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"])) { ?>
50
  <?php $location_id = $settings['location_name_ids']['recommendations']["{$page_type}_{$position}_content"] ?>
63
  </div>
64
  </fieldset>
65
  <?php } ?>
66
+
67
+ <div class='clear'></div>
68
+
69
+ <strong>Data Status:</strong>
70
+ <?php
71
+ $status = ShareaholicUtilities::recommendations_status_check();
72
+ if ($status == "processing" || $status == 'unknown'){
73
+ echo '<img class="shrsb_health_icon" align="top" src="'.SHAREAHOLIC_ASSET_DIR.'/img/circle_yellow.png" /> Processing';
74
+ } else {
75
+ echo '<img class="shrsb_health_icon" align="top" src="'.SHAREAHOLIC_ASSET_DIR.'/img/circle_green.png" /> Ready';
76
+ }
77
+ ?>
78
+
79
  </fieldset>
80
  </div>
81
 
utilities.php CHANGED
@@ -571,10 +571,7 @@ class ShareaholicUtilities {
571
  $event_api_url = Shareaholic::URL . '/api/events';
572
  $event_params = array('name' => "WordPress:".$event_name, 'data' => json_encode($event_metadata) );
573
 
574
- // var_dump($event_params);
575
-
576
  $response = ShareaholicCurl::post($event_api_url, $event_params);
577
- // $result = wp_remote_post($event_api_url, array('body' => $event_params) );
578
  }
579
 
580
  /**
@@ -583,8 +580,20 @@ class ShareaholicUtilities {
583
  */
584
  public static function recommendations_status_check() {
585
  $recommendations_status_api_url = Shareaholic::URL . "/v2/recommendations/status?url=" . get_bloginfo('url');
586
- $result = ShareaholicCurl::get($recommendations_status_api_url);
 
 
 
 
 
 
 
 
 
 
 
 
587
  }
588
 
589
  }
590
- ?>
571
  $event_api_url = Shareaholic::URL . '/api/events';
572
  $event_params = array('name' => "WordPress:".$event_name, 'data' => json_encode($event_metadata) );
573
 
 
 
574
  $response = ShareaholicCurl::post($event_api_url, $event_params);
 
575
  }
576
 
577
  /**
580
  */
581
  public static function recommendations_status_check() {
582
  $recommendations_status_api_url = Shareaholic::URL . "/v2/recommendations/status?url=" . get_bloginfo('url');
583
+ $response = ShareaholicCurl::get($recommendations_status_api_url);
584
+ if(is_array($response) && array_key_exists('body', $response)) {
585
+ $body = $response['body'];
586
+ if (is_array($body) && $body['code'] == 200) {
587
+ if ($body['data'][0]['status_code'] < 3) {
588
+ return "processing";
589
+ } else {
590
+ return "ready";
591
+ }
592
+ } else {
593
+ return "unknown";
594
+ }
595
+ }
596
  }
597
 
598
  }
599
+ ?>