WordPress.org

Ready to get started?Download WordPress

Forums

The Google+ plugin
[resolved] Widget showing the same post multiple times (8 posts)

  1. windracer
    Member
    Posted 2 years ago #

    The latest update to the plugin fixed the problem of the authentication token only working one time (I had to keep deauthorizing and re-authorizing in order to keep the import working).

    However, now the sidebar widget only shows the most recent post multiple times. For example, I have the widget set to show 5 items so the 5 items listed are all the same thing (the most recent G+ post). Any way to fix this?

    http://wordpress.org/extend/plugins/google/

  2. windracer
    Member
    Posted 1 year ago #

    No one else is having this problem?

  3. apclarke
    Member
    Posted 1 year ago #

    This is how I fixed the problem - a bit involved, but it has worked for me and has eradicated the multiplication of imported posts.

    Look for this code in lib/class_wdgpo_google_auth.php (around line 300):

    private function _is_imported ($gplus_id) {
    		$posts = get_posts('meta_key=wdgpo_gplus_item_id&meta_value=' . $gplus_id);
    		return $posts ? true : false;
    	}

    Change it to this instead:

    private function _is_imported ($gplus_id) {
    	$posts = get_posts(
    		array(
    			'meta_key'    => 'wdgpo_gplus_item_id',
    			'meta_value'  => $gplus_id
    		)
    	);
    	if ( count($posts) > 0 ) return false;
    	else return true;
    }

    Next you will need to rid the database of duplicate posts. Look in the Posts table first and find any duplicate posts in there. Make a note of the ID of any duplicate posts and then delete them. Then go to the PostMeta table and look for the post_id with the same number(s) you just deleted in the other table. There should be 3 entries in here per post each having the same post_id that you deleted in the other table (wdgpo_gplus_feed_id, wdgo_gplus_item_id and wdgo_glus_author). Delete these as well.

    Finally, there is an updated version of this plugin (free) from here http://premium.wpmudev.org/project/google-1/. You will still need to fix the code as described above.

  4. Mike
    WPMU DEV Support Staff
    Posted 1 year ago #

    Looks good @apclarke!

    Thanks for sharing!

    Cheers,
    Mike

  5. Mike
    WPMU DEV Support Staff
    Posted 1 year ago #

    Hi @windracer

    I know this is old, but if @apclarks solution worked, could you please mark this as resolved.

  6. windracer
    Member
    Posted 1 year ago #

    I "fixed" the problem by removing the plugin, so I can't say whether or not that solution works, sorry.

  7. Mike
    WPMU DEV Support Staff
    Posted 1 year ago #

    Hi @windracer

    That's understandable, it was quite a while before you got an answer!

    Hopefully this will help others in the future though.

    If you could mark this thread as resolved that would be great and will help us keep things tidy.

  8. windracer
    Member
    Posted 1 year ago #

    Ok!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.