Plugin Directory

Changeset 990247


Ignore:
Timestamp:
09/15/2014 02:17:45 PM (11 years ago)
Author:
djtidau
Message:

1.1.6

Location:
sm2wp-google-minimal
Files:
10 added
5 edited

Legend:

Unmodified
Added
Removed
  • sm2wp-google-minimal/trunk/classes/google_plus.php

    r989546 r990247  
    7070    protected $_author_url;
    7171
     72    public $reshares = 0;
     73    public $plusones = 0;
     74
    7275    public function __construct($parent, $id, $url, $type, $content, $date, $annotation='', $poster=null, $poster_url, $images=array(), $video=null, $article=array(), $album=array()) {
    7376        $this->id = $id;
     
    8992        $this->_video = $video;
    9093        $this->_article = $article;
    91 
    9294    }
    9395
     
    176178                                     '{{google-url}}',
    177179                                     '{{album-title}}',
    178                                      '{{album-url}}'),
     180                                     '{{album-url}}',
     181                                     '{{plusones}}',
     182                                     '{{reshares}}'),
    179183                               array($this->get_title(),
    180184                                     $this->_images ? $this->_images[0]['full'] : '',
     
    191195                                     $this->url,
    192196                                     $albumTitle,
    193                                      $albumUrl),
     197                                     $albumUrl,
     198                                     $this->plusones,
     199                                     $this->reshares),
    194200                                     $content);
    195201
     
    300306        } else if (get_option('gfw_overwrite', true)) {
    301307            wp_update_post($wp_post);
     308            if (!has_post_thumbnail($this->postId) && get_option('gfw_featured_images', false) && $this->_images) {
     309              $this->_add_featured_image($this->postId);
     310            }
     311
    302312        }
    303313
     
    453463            }
    454464
    455             if (!$r && $s != 200) {
     465            if (!$r || $s != 200) {
    456466                log_running("Unable to fetch posts for ".$this->name.'. ('.$s.')');
    457467                return;
     
    461471            $pageToken = @$r->nextPageToken;
    462472
    463             foreach ($r->items as $post) {
     473            foreach (@$r->items as $post) {
    464474                if (!in_array($post->provider->title, array('Google+', 'HootSuite', 'Mobile', 'Photos', 'Google Reader', 'Reshared Post', 'Community', 'Buffer', ''))) continue;
    465475                $posts++;
    466476                if ($posts > get_option('gfw_history', 10)) break;
    467477                $p = new GFW_Post($this, $post->id, $post->url, $post->verb, trim($post->object->content), $post->published, @$post->annotation, @$post->object->actor->displayName, @$post->actor->url);
    468 
     478                $p->plusones = $post->object->plusoners->totalItems;
     479                $p->reshares = $post->object->resharers->totalItems;
    469480                if (!@$post->object->attachments) $post->object->attachments = array();
    470481                foreach ($post->object->attachments as $a) {
     
    539550        $id = $this->id;
    540551        list($s, $r) = SM2WP_GooglePlus_Library::get(SM2WP_AUTH_URL.'r/'.$id.'/');
    541         if ($s && $s != 200) {
    542             log_error('Connection lost to "'.$this->name.'" please connect network again.');
     552        if (!$r || $s != 200) {
     553            log_running('Unable to refresh access for "'.$this->name.'" you may need to reconnect it.');
    543554            return;
    544555        }
  • sm2wp-google-minimal/trunk/classes/sm2wp_googleplus.php

    r989017 r990247  
    66
    77class SM2WP_GooglePlus {
    8     public static $slug = 'sm2wp-googleplus';
    9     protected static $instance = null;
     8    public static $slug = 'sm2wp-googleplus';
     9    protected static $instance = null;
    1010
    11     private function __construct() {
    12         add_action( 'wpmu_new_blog', array($this, 'activate_new_site'));
    13         add_filter('get_avatar', array($this, 'avatar_replace'), 10, 5);
    14         if (!get_option('gfw_ignore_canonical', false)) {
    15             add_action('wp_head', array($this, 'canonical_add'));
    16             remove_action('wp_head', 'rel_canonical');
    17         }
     11    private function __construct() {
     12      add_action( 'wpmu_new_blog', array($this, 'activate_new_site'));
     13      add_filter('get_avatar', array($this, 'avatar_replace'), 10, 5);
     14      if (!get_option('gfw_ignore_canonical', false)) {
     15        add_action('wp_head', array($this, 'canonical_add'));
     16        remove_action('wp_head', 'rel_canonical');
     17      }
    1818
    19         add_action('gfw_import', array('SM2WP_GooglePlus', 'run'));
     19      add_action('gfw_import', array('SM2WP_GooglePlus', 'run'));
    2020
    21     }
     21    }
    2222
    2323
  • sm2wp-google-minimal/trunk/readme.txt

    r989852 r990247  
    55Requires at least: 3.0.1
    66Tested up to: 4.0
    7 Stable tag: 1.1.5
     7Stable tag: 1.1.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4949== Changelog ==
    5050
     51= 1.1.6 =
     52* Reshare count template tag added {{reshares}}
     53* +1 count template tag added {{plusones}}
     54* Better capturing of request errors
     55* Misc fixes
     56
    5157= 1.1.5 =
    5258* HTTP Request changes to support hosts not giving status codes
  • sm2wp-google-minimal/trunk/sm2wp.php

    r989546 r990247  
    44 * Plugin URI:      http://sm2wp.com
    55 * Description:     Import your Google+ Posts to your WordPress Blog
    6  * Version:         1.1.5
     6 * Version:         1.1.6
    77 * Author:          Daniel Treadwell
    88 * Author URI:      http://minimali.se
  • sm2wp-google-minimal/trunk/views/admin.php

    r989546 r990247  
    8080        QTags.addButton( 'gfw_content', 'Content', '{{content}}');
    8181        QTags.addButton( 'gfw_post_url', 'G+ Post URL', '{{google-url}}');
     82        QTags.addButton( 'gfw_plusones', '+1 Count', '{{plusones}}');
     83        QTags.addButton( 'gfw_reshares', 'Reshare Count', '{{reshares}}');
    8284
    8385    });
     
    206208    <p><b>{{content}}</b> This content of the post (or reshared post)</p>
    207209    <p><b>{{google-url}}</b> The link of the post on Google+</p>
     210    <p><b>{{plusones}}</b> The number of +1s a post received</p>
     211    <p><b>{{reshares}}</b> The number of times a post was reshared</p>
    208212    <p><hr /></p>
    209213    <p><b>{{if-reshare-start}}</b> Keep reshare specific information between the start and end tags</p>
Note: See TracChangeset for help on using the changeset viewer.