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

Version Description

  • Added support for shareaholic:keywords meta tag for better Recommendations and Related Content matches
Download this release

Release Info

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

Code changes from version 7.0.4.2 to 7.0.4.3

Files changed (4) hide show
  1. notifier.php +1 -1
  2. public.php +44 -2
  3. readme.txt +7 -1
  4. shareaholic.php +3 -3
notifier.php CHANGED
@@ -27,7 +27,7 @@ class ShareaholicNotifier {
27
  global $wpdb;
28
  $post = get_post($post_id);
29
  $url = get_permalink($post_id);
30
- $tags = wp_get_post_tags($post_id, array('fields' => 'name'));
31
 
32
  $categories = array_map(array('ShareaholicNotifier', 'post_notify_iterator'), get_the_category($post_id));
33
 
27
  global $wpdb;
28
  $post = get_post($post_id);
29
  $url = get_permalink($post_id);
30
+ $tags = wp_get_post_tags($post_id, array('fields' => 'names'));
31
 
32
  $categories = array_map(array('ShareaholicNotifier', 'post_notify_iterator'), get_the_category($post_id));
33
 
public.php CHANGED
@@ -81,12 +81,54 @@ class ShareaholicPublic {
81
  echo "\n<!-- Shareaholic Content Tags -->\n";
82
  self::draw_site_name_meta_tag();
83
  self::draw_language_meta_tag();
84
- self::draw_plugin_url_meta_tag();
 
85
  self::draw_plugin_version_meta_tag();
86
  self::draw_image_meta_tag();
87
  echo "\n<!-- Shareaholic Content Tags End -->\n";
88
  }
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  /**
91
  * Draws Shareaholic language meta tag.
92
  */
@@ -100,7 +142,7 @@ class ShareaholicPublic {
100
  /**
101
  * Draws Shareaholic url meta tag.
102
  */
103
- private static function draw_plugin_url_meta_tag() {
104
  if (in_array(ShareaholicUtilities::page_type(), array('page', 'post'))) {
105
  $url_link = get_permalink();
106
  echo "<meta name='shareaholic:url' content='" . $url_link . "' />\n";
81
  echo "\n<!-- Shareaholic Content Tags -->\n";
82
  self::draw_site_name_meta_tag();
83
  self::draw_language_meta_tag();
84
+ self::draw_url_meta_tag();
85
+ self::draw_keywords_meta_tag();
86
  self::draw_plugin_version_meta_tag();
87
  self::draw_image_meta_tag();
88
  echo "\n<!-- Shareaholic Content Tags End -->\n";
89
  }
90
 
91
+ /**
92
+ * Draws Shareaholic keywords meta tag.
93
+ */
94
+ private static function draw_keywords_meta_tag() {
95
+ if (in_array(ShareaholicUtilities::page_type(), array('page', 'post'))) {
96
+ global $post;
97
+ $keywords = '';
98
+
99
+ // Get post tags
100
+ $keywords = implode(', ', wp_get_post_tags( $post->ID, array('fields' => 'names') ) );
101
+
102
+ // Get post categories
103
+ $categories = get_the_category($post->ID);
104
+ $separator = ', ';
105
+ $output = '';
106
+
107
+ if($categories) {
108
+ foreach($categories as $category) {
109
+ if ($category->cat_name != "Uncategorized") {
110
+ $output .= $separator.$category->cat_name;
111
+ }
112
+ }
113
+ $categories = trim($output, $separator);
114
+ }
115
+
116
+ // Merge post tags and categories
117
+ if ($keywords != ''){
118
+ $keywords .= ', '.$categories;
119
+ } else {
120
+ $keywords .= $categories;
121
+ }
122
+
123
+ // Encode appropriately
124
+ $keywords = trim(htmlspecialchars(htmlspecialchars_decode($keywords), ENT_QUOTES));
125
+
126
+ if ($keywords != '') {
127
+ echo "<meta name='shareaholic:keywords' content='" . strtolower($keywords) . "' />\n";
128
+ }
129
+ }
130
+ }
131
+
132
  /**
133
  * Draws Shareaholic language meta tag.
134
  */
142
  /**
143
  * Draws Shareaholic url meta tag.
144
  */
145
+ private static function draw_url_meta_tag() {
146
  if (in_array(ShareaholicUtilities::page_type(), array('page', 'post'))) {
147
  $url_link = get_permalink();
148
  echo "<meta name='shareaholic:url' content='" . $url_link . "' />\n";
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.2
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,9 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
148
 
149
  == Changelog ==
150
 
 
 
 
151
  = 7.0.4.2 =
152
  * Better debug prompts
153
 
@@ -942,6 +945,9 @@ Please see here: [Usage & Installation Instructions](https://shareaholic.com/too
942
 
943
  == Upgrade Notice ==
944
 
 
 
 
945
  = 7.0.4.2 =
946
  Better debug prompts
947
 
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.3
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.3 =
152
+ * Added support for shareaholic:keywords meta tag for better Recommendations and Related Content matches
153
+
154
  = 7.0.4.2 =
155
  * Better debug prompts
156
 
945
 
946
  == Upgrade Notice ==
947
 
948
+ = 7.0.4.3 =
949
+ Added support for shareaholic:keywords meta tag for better Recommendations and Related Content matches
950
+
951
  = 7.0.4.2 =
952
  Better debug prompts
953
 
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 7.0.4.2
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.2
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.2';
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.3
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.3
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.3';
57
  /**
58
  * Starts off as false so that ::get_instance() returns
59
  * a new instance.