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

Version Description

  • Miscellaneous performance enhancements and bug fixes
  • Shareaholic plugin debugger
Download this release

Release Info

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

Code changes from version 7.4.0.7 to 7.4.0.8

Files changed (4) hide show
  1. public.php +138 -0
  2. readme.txt +9 -1
  3. shareaholic.php +11 -3
  4. templates/advanced_settings.php +1 -1
public.php CHANGED
@@ -442,6 +442,144 @@ class ShareaholicPublic {
442
  exit;
443
  }
444
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  /**
446
  * Checks to see if curl is installed
447
  *
442
  exit;
443
  }
444
 
445
+ /**
446
+ * Function to return relevant plugin debug info
447
+ *
448
+ * @return debug info in JSON
449
+ */
450
+ public static function debug_info() {
451
+ global $wpdb;
452
+
453
+ if (ShareaholicUtilities::get_option('disable_tracking') == NULL || ShareaholicUtilities::get_option('disable_tracking') == "off"){
454
+ $analytics_status = "on";
455
+ } else {
456
+ $analytics_status = "off";
457
+ }
458
+
459
+ if (ShareaholicUtilities::get_option('disable_internal_share_counts_api') == NULL || ShareaholicUtilities::get_option('disable_internal_share_counts_api') == "off"){
460
+ $server_side_share_count_status = "on";
461
+ } else {
462
+ $server_side_share_count_status = "off";
463
+ }
464
+
465
+ if (ShareaholicUtilities::has_accepted_terms_of_service() == 1){
466
+ $tos_status = "accepted";
467
+ } else {
468
+ $tos_status = "pending";
469
+ }
470
+
471
+ if (function_exists('curl_version')){
472
+ $curl_version = curl_version();
473
+ }
474
+
475
+ $info = array(
476
+ 'plugin_version' => Shareaholic::VERSION,
477
+ 'site_id' => ShareaholicUtilities::get_option('api_key'),
478
+ 'domain' => get_bloginfo('url'),
479
+ 'language' => get_bloginfo('language'),
480
+ 'tos_status' => $tos_status,
481
+ 'stats' => array (
482
+ 'posts_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'post' AND post_status = 'publish'" ),
483
+ 'pages_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'page' AND post_status = 'publish'" ),
484
+ 'comments_total' => wp_count_comments()->approved,
485
+ 'users_total' => $wpdb->get_var("SELECT count(ID) FROM $wpdb->users"),
486
+ ),
487
+ 'diagnostics' => array (
488
+ 'theme' => get_option('template'),
489
+ 'multisite' => is_multisite(),
490
+ 'shareaholic_server_reachable' => ShareaholicUtilities::connectivity_check(),
491
+ 'server_side_share_count_api_reachable' => ShareaholicUtilities::share_counts_api_connectivity_check(),
492
+ 'php_version' => phpversion(),
493
+ 'wp_version' => get_bloginfo('version'),
494
+ 'curl' => array (
495
+ 'status' => ShareaholicPublic::has_curl(),
496
+ 'version' => $curl_version,
497
+ ),
498
+ 'plugins' => array (
499
+ 'active' => get_option('active_plugins', array()),
500
+ 'sitewide' => get_site_option('active_sitewide_plugins', array()),
501
+ ),
502
+ ),
503
+ 'app_locations' => array (
504
+ 'share_buttons' => ShareaholicUtilities::get_option('share_buttons'),
505
+ 'recommendations' => ShareaholicUtilities::get_option('recommendations'),
506
+ ),
507
+ 'advanced_settings' => array (
508
+ 'analytics' => $analytics_status,
509
+ 'server_side_share_count_api' => $server_side_share_count_status,
510
+ )
511
+ );
512
+
513
+ header('Content-Type: application/json');
514
+ echo json_encode($info);
515
+ exit;
516
+ }
517
+
518
+ /**
519
+ * Function to return relevant info for a given page
520
+ *
521
+ * @return page info in JSON
522
+ */
523
+ public static function post_info() {
524
+ global $wpdb;
525
+ $url = isset($_GET['url']) ? $_GET['url'] : NULL;
526
+ $post_id = url_to_postid($url);
527
+ $post = get_post($post_id);
528
+ $url = get_permalink($post_id);
529
+ $tags = wp_get_post_tags($post_id, array('fields' => 'names'));
530
+
531
+ // $categories = array_map(array('ShareaholicNotifier', 'post_notify_iterator'), get_the_category($post_id));
532
+
533
+ if (function_exists('has_post_thumbnail') && has_post_thumbnail($post_id)) {
534
+ $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'large');
535
+ } else {
536
+ $featured_image = ShareaholicPublic::post_first_image();
537
+ if (!$featured_image) {
538
+ $featured_image = '';
539
+ }
540
+ }
541
+
542
+ if ($post->post_author) {
543
+ $author_data = get_userdata($post->post_author);
544
+ $author_name = $author_data->display_name;
545
+ }
546
+
547
+ $info = array(
548
+ 'url' => $url,
549
+ 'api_key' => ShareaholicUtilities::get_option('api_key'),
550
+ 'content' => array(
551
+ 'title' => $post->post_title,
552
+ 'excerpt' => $post->post_excerpt,
553
+ 'body' => $post->post_content,
554
+ 'featured-image-url' => $featured_image,
555
+ ),
556
+ 'metadata' => array(
557
+ 'author_id' => $post->post_author,
558
+ 'author_name' => $author_name,
559
+ 'post_type' => $post->post_type,
560
+ 'post_id' => $post_id,
561
+ 'post_tags' => $tags,
562
+ // 'post_categories' => $categories,
563
+ 'post_language' => get_bloginfo('language'),
564
+ 'published' => $post->post_date_gmt,
565
+ 'updated' => get_lastpostmodified('GMT'),
566
+ 'visibility' => $post->post_status,
567
+ ),
568
+ 'site_info' => array(
569
+ 'platform' => 'wordpress',
570
+ 'plugin_version' => Shareaholic::VERSION,
571
+ 'posts_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'post' AND post_status = 'publish'" ),
572
+ 'posts_total' => $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts where post_type = 'page' AND post_status = 'publish'" ),
573
+ 'comments_total' => wp_count_comments()->approved,
574
+ 'users_total' => $wpdb->get_var("SELECT count(ID) FROM $wpdb->users"),
575
+ ));
576
+
577
+ header('Content-Type: application/json');
578
+ echo json_encode($info);
579
+ exit;
580
+ }
581
+
582
+
583
  /**
584
  * Checks to see if curl is installed
585
  *
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: 3.0
5
  Tested up to: 3.9.1
6
- Stable tag: 7.4.0.7
7
 
8
  Adds an attractive social bookmarking menu and related content widget to your posts, pages, index, or any combination of the three.
9
 
@@ -155,6 +155,10 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
155
 
156
  == Changelog ==
157
 
 
 
 
 
158
  = 7.4.0.7 =
159
  * Bugfix: Fixed edge case where admin assets were not being linked properly
160
  * [Bugfix](http://wordpress.org/support/topic/save-menu-produces-404-error-or-500-error): Fixed menu timeout issue
@@ -1071,6 +1075,10 @@ Please see here: [Usage & Installation Instructions](http://support.shareaholic.
1071
 
1072
  == Upgrade Notice ==
1073
 
 
 
 
 
1074
  = 7.4.0.7 =
1075
 
1076
  Bug fixes to make Shareaholic a little better for you.
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: 3.0
5
  Tested up to: 3.9.1
6
+ Stable tag: 7.4.0.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
 
155
 
156
  == Changelog ==
157
 
158
+ = 7.4.0.8 =
159
+ * Miscellaneous performance enhancements and bug fixes
160
+ * Shareaholic plugin debugger
161
+
162
  = 7.4.0.7 =
163
  * Bugfix: Fixed edge case where admin assets were not being linked properly
164
  * [Bugfix](http://wordpress.org/support/topic/save-menu-produces-404-error-or-500-error): Fixed menu timeout issue
1075
 
1076
  == Upgrade Notice ==
1077
 
1078
+ = 7.4.0.8 =
1079
+
1080
+ Shareaholic plugin debugger - makes debugging plugin related issues faster and easier.
1081
+
1082
  = 7.4.0.7 =
1083
 
1084
  Bug fixes to make Shareaholic a little better for you.
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 7.4.0.7
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.4.0.7
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
@@ -61,7 +61,7 @@ class Shareaholic {
61
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
62
  const REC_API_URL = 'http://recommendations.shareaholic.com';
63
 
64
- const VERSION = '7.4.0.7';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
@@ -78,7 +78,15 @@ class Shareaholic {
78
  // Share Counts API
79
  add_action('wp_ajax_nopriv_shareaholic_share_counts_api', array('ShareaholicPublic', 'share_counts_api'));
80
  add_action('wp_ajax_shareaholic_share_counts_api', array('ShareaholicPublic', 'share_counts_api'));
 
 
 
 
81
 
 
 
 
 
82
  add_action('init', array('ShareaholicPublic', 'init'));
83
  add_action('the_content', array('ShareaholicPublic', 'draw_canvases'));
84
  add_action('wp_head', array('ShareaholicPublic', 'wp_head'), 6);
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 7.4.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.4.0.8
14
  Author: Shareaholic
15
  Author URI: https://shareaholic.com
16
  Text Domain: shareaholic
61
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
62
  const REC_API_URL = 'http://recommendations.shareaholic.com';
63
 
64
+ const VERSION = '7.4.0.8';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
78
  // Share Counts API
79
  add_action('wp_ajax_nopriv_shareaholic_share_counts_api', array('ShareaholicPublic', 'share_counts_api'));
80
  add_action('wp_ajax_shareaholic_share_counts_api', array('ShareaholicPublic', 'share_counts_api'));
81
+
82
+ // Debug info
83
+ add_action('wp_ajax_nopriv_shareaholic_debug_info', array('ShareaholicPublic', 'debug_info'));
84
+ add_action('wp_ajax_shareaholic_debug_info', array('ShareaholicPublic', 'debug_info'));
85
 
86
+ // Page info
87
+ add_action('wp_ajax_nopriv_shareaholic_post_info', array('ShareaholicPublic', 'post_info'));
88
+ add_action('wp_ajax_shareaholic_post_info', array('ShareaholicPublic', 'post_info'));
89
+
90
  add_action('init', array('ShareaholicPublic', 'init'));
91
  add_action('the_content', array('ShareaholicPublic', 'draw_canvases'));
92
  add_action('wp_head', array('ShareaholicPublic', 'wp_head'), 6);
templates/advanced_settings.php CHANGED
@@ -28,7 +28,7 @@
28
  <?php if (isset($settings['disable_admin_bar_menu'])) { ?>
29
  <?php echo ($settings['disable_admin_bar_menu'] == 'on' ? 'checked' : '') ?>
30
  <?php } ?>>
31
- <label style="display: inline-block; font-size:12px;" for="admin_bar"><?php echo sprintf(__('Disable Admin Bar Menu', 'shareaholic')); ?></label>
32
  <br/>
33
  <input type='checkbox' id='share_counts' name='shareaholic[disable_internal_share_counts_api]' class='check'
34
  <?php if (isset($settings['disable_internal_share_counts_api'])) { ?>
28
  <?php if (isset($settings['disable_admin_bar_menu'])) { ?>
29
  <?php echo ($settings['disable_admin_bar_menu'] == 'on' ? 'checked' : '') ?>
30
  <?php } ?>>
31
+ <label style="display: inline-block; font-size:12px;" for="admin_bar"><?php echo sprintf(__('Disable Admin Bar Menu (requires page refresh)', 'shareaholic')); ?></label>
32
  <br/>
33
  <input type='checkbox' id='share_counts' name='shareaholic[disable_internal_share_counts_api]' class='check'
34
  <?php if (isset($settings['disable_internal_share_counts_api'])) { ?>