Plugin Directory

Changeset 1687901


Ignore:
Timestamp:
06/29/2017 05:38:10 PM (9 years ago)
Author:
bcole808
Message:

Release of 1.6.8

Location:
social-metrics-tracker
Files:
107 added
4 edited

Legend:

Unmodified
Added
Removed
  • social-metrics-tracker/trunk/MetricsUpdater.class.php

    r1466646 r1687901  
    787787
    788788            $total['count']++;
    789             $total['socialscore'] += $socialcount_TOTAL;
    790             $total['views'] += $ga_pageviews;
    791             $total['comments'] += $post->comment_count;
     789            $total['socialscore'] += intval($socialcount_TOTAL);
     790            $total['views'] += intval($ga_pageviews);
     791            $total['comments'] += intval($post->comment_count);
    792792
    793793        }
  • social-metrics-tracker/trunk/data-sources/FacebookGraphUpdater.class.php

    r1202486 r1687901  
    1313    public $enabled_by_default = true;
    1414
    15     private $uri = 'https://graph.facebook.com/v2.3';
     15    private $uri = 'https://graph.facebook.com/v2.9';
    1616
    1717    public function __construct($access_token=false) {
     
    3434        if (strlen($app_id) == 0 || strlen($app_secret) == 0) return false;
    3535
    36         $oauth_uri = "https://graph.facebook.com/v2.3/oauth/access_token?client_id=$app_id&client_secret=$app_secret&grant_type=client_credentials";
     36        $oauth_uri = "https://graph.facebook.com/v2.9/oauth/access_token?client_id=$app_id&client_secret=$app_secret&grant_type=client_credentials";
    3737
    3838        $response = wp_remote_get($oauth_uri);
     
    5757        $this->updater->resource_params = array(
    5858            'id' => $url,
    59             'fields' => 'og_object{engagement}'
     59            'fields' => 'engagement'
    6060        );
    6161
     
    6666
    6767        // Note: The final encoded URL should look a bit like this:
    68         // https://graph.facebook.com/v2.3/?id=http://www.wordpress.org&fields=og_object{engagement}&access_token=TOKEN_HERE
     68        // https://graph.facebook.com/v2.9/?id=http://www.wordpress.org&fields=engagement&access_token=TOKEN_HERE
    6969    }
    7070
     
    8383        // Validation
    8484        if (!is_array($this->updater->data)) return 0;
    85         if (!isset($this->updater->data['og_object'])) return 0;
    86         if (!isset($this->updater->data['og_object']['engagement'])) return 0;
    87         if (!isset($this->updater->data['og_object']['engagement']['count'])) return 0;
     85        if (!isset($this->updater->data['engagement'])) return 0;
     86
     87        $engagement = $this->updater->data['engagement'];
    8888
    8989        // Return count
    90         return intval($this->updater->data['og_object']['engagement']['count']);
     90        return (
     91            intval($engagement['reaction_count']) +
     92            intval($engagement['comment_count']) +
     93            intval($engagement['share_count']) +
     94            intval($engagement['comment_plugin_count'])
     95        );
    9196    }
    9297
  • social-metrics-tracker/trunk/readme.txt

    r1466646 r1687901  
    44Tags: admin, dashboard, social, social media, facebook, twitter, metrics, analytics, tracking, stats, engagement, share, sharing, shares, likes, tweets
    55Requires at least: 3.5
    6 Tested up to: 4.5.3
    7 Stable tag: 1.6.7
     6Tested up to: 4.8
     7Stable tag: 1.6.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    108108
    109109== Changelog ==
     110
     111= 1.6.8 =
     112* Update Facebook Graph API version to 2.9
    110113
    111114= 1.6.7 =
     
    257260== Upgrade Notice ==
    258261
     262= 1.6.8 =
     263* Update Facebook Graph API version to 2.9
     264
    259265= 1.6.7 =
    260266Fixed a bug with the Facebook Public data
  • social-metrics-tracker/trunk/social-metrics-tracker.php

    r1466646 r1687901  
    44Plugin URI: https://github.com/bcole808/wp-social-metrics-tracker
    55Description: Collect and display social network shares, likes, tweets, and view counts of posts.
    6 Version: 1.6.7
     6Version: 1.6.8
    77Author: Ben Cole
    88Author URI: http://www.bencole.net
     
    3939class SocialMetricsTracker {
    4040
    41     public $version = '1.6.7'; // for db upgrade comparison
     41    public $version = '1.6.8'; // for db upgrade comparison
    4242    public $updater;
    4343    public $options;
Note: See TracChangeset for help on using the changeset viewer.