WordPress.org

Ready to get started?Download WordPress

Forums

Tweet Old Post
Twitter Authorization Problem Work Around and Code Improvement (5 posts)

  1. seo-dave
    Member
    Posted 1 year ago #

    Had the authorisation issue with latest two versions, earlier version (been using this plugin a while no probs).

    Followed the instruction in the FAQ (clicked the Update tweet Old Posts Option button) that still didn't work, but did remove the redirection error message, had a link loaded in the webpage as plain text when I tried to authenticate similar to this (edited it to remove my domain etc...):

    http://www.domain.com/wp-admin/admin.php?page=TweetOldPost&TOP_oauth=1&oauth_token1=qzQftrwitE4RWTCW5zJg9goyPLbNxRgrswaIpUk0G1I&oauth_verifier=VxWzkMBeJWQ3DDt2CYDg3yab2vURXiiUvkTrJqFIhttp://www.domaine.com/wp-admin/admin.php?page=TweetOldPost&TOP_oauth=1&oauth_token1=qzQftrwitE4RWTCgW5zJg9goPLbNxRggrswaIpUk0G1I&oauth_verifier=VxWzkMBeJWQ3DgDt2CYDg3ab2vURgXiiUvkTrJqFI

    Copy and pasted the URL into a browser window and it redirected back to the options page and the plugin was activated. Posts are tweeting.

    It works, I'm happy.

    I run around 90 WordPress sites and have the plugin (a customized earlier version that Tweeted Pages as well) on around 30 sites. I found updating a site that was already authorised with an older version of the plugin still worked, but authorising new sites was hitting the redirection problem during activation. So if others can't get it to authorise install an older version, authorise and update to V4.

    Good to see you've added Pages, was a pain having to add Pages myself after each update.

    Any news on Tweeting to multiple Twitter accounts, really looking forward to that feature?

    Hmm, just updated another site and it's working, but looks like you haven't added Pages to the exclude options page so you can't exclude Pages.

    Really easy to add the exclude code, in top-excludepost.php change

    $sql = "SELECT p.ID,p.post_title,p.post_date,u.user_nicename,p.guid FROM $wpdb->posts p join $wpdb->users u on p.post_author=u.ID WHERE post_type = 'post'

    to

    $sql = "SELECT p.ID,p.post_title,p.post_date,u.user_nicename,p.guid FROM $wpdb->posts p join $wpdb->users u on p.post_author=u.ID WHERE post_type = 'post' or post_type = 'page'

    Only problem with this is Pages don't have a category, so the options page layout lacks a category for the Page entries, says uncategorized (not linked), it works which is the main thing.

    Any chance you could add this to your next update so I don't need to edit it in each update?

    It's important to have Pages excluded, got a bunch of pages I don't want tweeting and since you've added Pages it's the only edit I had to make (earlier versions edited top-core.php as well to add Pages).

    Not played with the plugin much yet, but looks like a good update with Pages and tweeting multiple posts, nice :-)

    You thought about adding a Tweet home page option? Appreciate the home page doesn't have a Page ID unless you've selected a Front Page.

    David

    http://wordpress.org/extend/plugins/tweet-old-post/

  2. seo-dave
    Member
    Posted 1 year ago #

    Spoke a little too soon, looks like the Auto Draft is being Tweeted.

    Got a site with just three posts and two static Pages.

    Added the code change I suggested above, excluded the 2 posts, this left the three posts and the auto Draft.

    Did a test Tweet and it posted the auto draft.

    Vaguely recall having this issue before with post revisions and fixing it.

    Might have a fix

    top-core.php

    if($top_opt_post_type!='both'){
    	$post_type = "post_type = '$top_opt_post_type' AND";
         }
         else
         {
             $post_type="";
         }

    to

    if($top_opt_post_type!='both'){
    	$post_type = "post_type = '$top_opt_post_type' AND";
         }
         else
         {
             $post_type="(post_type = 'post' OR post_type = 'page') AND";
         }

    Your original code is saying when it's not set to post to both pages and posts only Tweet Posts (which is fine). But when the post to both Posts and Pages is set don't limit which posts types to Tweet. Unfortunately the MYSQL table also stores auto drafts, revisions and any custom post types. Some custom post types are fine, but the auto drafts and revisions aren't.

    Had to fix this exact same issue in a related posts plugin, was even grabbing the custom menu links that are also stored in that table as a post type.

    Done limited testing (2 mins), on the above site and it's giving the Ooops message for the three posts like I'd expect (already Tweeted) and not trying to post the auto draft (so think it's a good fix).

    David

  3. Ajay Matharu
    Member
    Posted 1 year ago #

    @David just amazing update coming your way for both the things. Great thanks for the help mate :) you rock.

  4. Ajay Matharu
    Member
    Posted 1 year ago #

    @David just wanted to check if you were able to create and use the custom app on twitter in tweet old post successfully?

  5. seo-dave
    Member
    Posted 1 year ago #

    No problem with the code suggestions.

    Running v4 with the above code changes on about 15 sites that I updated with the new code right away and working fine for 10 hours.

    Couple of my Twitter accounts
    https://twitter.com/davidlaw all v4 custom.
    https://twitter.com/etravelhotels all v4 custom.

    Not tested every feature, but have tested the important stuff.

    Posts only
    Pages only
    Posts and Pages
    Multiple Tweets (got sites set from 1 to 10)
    Excluding posts and/or pages

    All works, not seen any issues so far and over the past half a day there would have been hundreds of tweets because of the number of sites and the settings I'm using: set the intervals as low as possible.

    Rereading what you asked, you want to know if I'm using the Twitter Consumer Key etc... :-) It's working with the blank defaults. Did a test with the keys from a Twitter app for my account and got the Ooops error when tweeting. So no using that feature didn't work for me.

    What would be a cool feature for you to add is integration with services like Tweetmeme, so when something is retweeted it's also tweeted to Tweetmeme and similar. I'll take a look see how Tweetmeme works as that would be nice.

    David

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic