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

Version Description

  • Support for All in One SEO Pack keywords
  • Additional fixes for Cloudflare
Download this release

Release Info

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

Code changes from version 7.0.4.5 to 7.0.4.6

Files changed (4) hide show
  1. public.php +23 -8
  2. readme.txt +8 -1
  3. shareaholic.php +3 -3
  4. templates/script_tag.php +2 -2
public.php CHANGED
@@ -105,11 +105,17 @@ class ShareaholicPublic {
105
  global $post;
106
  $keywords = '';
107
 
108
- // Get post tags
109
- $keywords = implode(', ', wp_get_post_tags( $post->ID, array('fields' => 'names') ) );
 
 
 
110
 
 
 
 
111
  // Get post categories
112
- $categories = get_the_category($post->ID);
113
  $separator = ', ';
114
  $output = '';
115
 
@@ -120,7 +126,7 @@ class ShareaholicPublic {
120
  }
121
  }
122
  $categories = trim($output, $separator);
123
- }
124
 
125
  // Merge post tags and categories
126
  if ($keywords != ''){
@@ -129,11 +135,20 @@ class ShareaholicPublic {
129
  $keywords .= $categories;
130
  }
131
 
132
- // Encode appropriately
133
- $keywords = trim(htmlspecialchars(htmlspecialchars_decode($keywords), ENT_QUOTES));
 
 
 
 
 
 
 
 
 
134
 
135
- if ($keywords != '') {
136
- echo "<meta name='shareaholic:keywords' content='" . strtolower($keywords) . "' />\n";
137
  }
138
  }
139
  }
105
  global $post;
106
  $keywords = '';
107
 
108
+ if (is_attachment() && $post->post_parent){
109
+ $id = $post->post_parent;
110
+ } else {
111
+ $id = $post->ID;
112
+ }
113
 
114
+ // Get post tags
115
+ $keywords = implode(', ', wp_get_post_tags( $id, array('fields' => 'names') ) );
116
+
117
  // Get post categories
118
+ $categories = get_the_category($id);
119
  $separator = ', ';
120
  $output = '';
121
 
126
  }
127
  }
128
  $categories = trim($output, $separator);
129
+ }
130
 
131
  // Merge post tags and categories
132
  if ($keywords != ''){
135
  $keywords .= $categories;
136
  }
137
 
138
+ // Support for All in One SEO Pack keywords
139
+ $keywords .= stripslashes(get_post_meta($post->ID, '_aioseop_keywords', true));
140
+
141
+ // Encode & trim appropriately
142
+ $keywords = trim(strtolower(trim(htmlspecialchars(htmlspecialchars_decode($keywords), ENT_QUOTES))), ",");
143
+
144
+ // Unique keywords
145
+ $keywords_array = array();
146
+ $keywords_array = explode(', ', $keywords);
147
+ $keywords_array = array_unique($keywords_array);
148
+ $keywords_unique_list = implode(', ', $keywords_array);
149
 
150
+ if ($keywords_unique_list != '' && $keywords_unique_list != "array") {
151
+ echo "<meta name='shareaholic:keywords' content='" . $keywords_unique_list . "' />\n";
152
  }
153
  }
154
  }
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, wanelo, 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.6.1
6
- Stable tag: 7.0.4.5
7
 
8
  Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
9
 
@@ -148,6 +148,10 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
148
 
149
  == Changelog ==
150
 
 
 
 
 
151
  = 7.0.4.5 =
152
  * Enforce Internet Explorer compatibility mode to latest version available; fixes a lot of general issues with Internet Explorer. Recommended update.
153
 
@@ -948,6 +952,9 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
948
 
949
  == Upgrade Notice ==
950
 
 
 
 
951
  = 7.0.4.5 =
952
  * Enforce Internet Explorer compatibility mode to latest version available; fixes a lot of general issues with Internet Explorer. Recommended update.
953
 
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, wanelo, 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.6.1
6
+ Stable tag: 7.0.4.6
7
 
8
  Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
9
 
148
 
149
  == Changelog ==
150
 
151
+ = 7.0.4.6 =
152
+ * Support for All in One SEO Pack keywords
153
+ * Additional fixes for Cloudflare
154
+
155
  = 7.0.4.5 =
156
  * Enforce Internet Explorer compatibility mode to latest version available; fixes a lot of general issues with Internet Explorer. Recommended update.
157
 
952
 
953
  == Upgrade Notice ==
954
 
955
+ = 7.0.4.6 =
956
+ * Significant upgrade to keyword generation for Related Content. Additional fixes for those using Cloudflare.
957
+
958
  = 7.0.4.5 =
959
  * Enforce Internet Explorer compatibility mode to latest version available; fixes a lot of general issues with Internet Explorer. Recommended update.
960
 
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 7.0.4.5
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.4.5
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
@@ -53,7 +53,7 @@ require_once(SHAREAHOLIC_DIR . '/deprecation.php');
53
  */
54
  class Shareaholic {
55
  const URL = 'https://shareaholic.com';
56
- const VERSION = '7.0.4.5';
57
  /**
58
  * Starts off as false so that ::get_instance() returns
59
  * a new instance.
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 7.0.4.6
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.4.6
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
53
  */
54
  class Shareaholic {
55
  const URL = 'https://shareaholic.com';
56
+ const VERSION = '7.0.4.6';
57
  /**
58
  * Starts off as false so that ::get_instance() returns
59
  * a new instance.
templates/script_tag.php CHANGED
@@ -1,9 +1,9 @@
1
- <script type='text/javascript'>
2
  //<![CDATA[
3
  (function() {
4
  var shr = document.createElement('script');
5
  shr.setAttribute('data-cfasync', 'false');
6
- shr.src = '<?php echo ShareaholicUtilities::asset_url('pub/shareaholic.js') ?>?ver=<?php echo ShareaholicUtilities::get_version() ?>';
7
  shr.type = 'text/javascript'; shr.async = 'true';
8
  shr.onload = shr.onreadystatechange = function() {
9
  var rs = this.readyState;
1
+ <script type='text/javascript' data-cfasync='false'>
2
  //<![CDATA[
3
  (function() {
4
  var shr = document.createElement('script');
5
  shr.setAttribute('data-cfasync', 'false');
6
+ shr.src = '<?php echo ShareaholicUtilities::asset_url('pub/shareaholic.js') ?>';
7
  shr.type = 'text/javascript'; shr.async = 'true';
8
  shr.onload = shr.onreadystatechange = function() {
9
  var rs = this.readyState;