WordPress.org

Forums

wpomatic duplicate posts fix for wordpress 2.8? (29 posts)

  1. tacomamama
    Member
    Posted 5 years ago #

    Hi,

    Wpomatic has an issue with fetching duplicate posts. There was a great fix for that, that worked great in older versions of WordPress.

    Here's the link to that fix:

    http://linuxil.wordpress.com/2008/02/24/wp-o-matic-quick-dirty-duplicate-post-fix/

    Unfortunately, I can't find the corresponding line of code in wordpress 2.8's post.php file. Any idea where to put that "return 0;"? Would that still fix the problem?

    A new version has been promised for months but the release date keeps getting pushed back. For now, I really need this fix to work.

  2. Nexton
    Member
    Posted 5 years ago #

    I think i have found the fix

    Look at line 1750

    Hope this works for you.

  3. lehenryjr
    Member
    Posted 5 years ago #

    This isn't working for me...

    Can someone just post a couple of lines from that area to show, what it should look like?

    Thanks in advance and I appreciate it...

  4. Nexton
    Member
    Posted 5 years ago #

    I found it.

    There are 3 lines you need to change.

    -1750
    -1766
    -1780

    In these lines you should remove the suffix and add return 0;

    Cheers

  5. benjiw
    Member
    Posted 5 years ago #

    Ugh -- this doesn't seem to work for me -- is it working for other people? All you do is remove the suffix = 2 line and replace it with return 0;, right?

  6. benjiw
    Member
    Posted 5 years ago #

    Am I missing something?

  7. tacomamama
    Member
    Posted 5 years ago #

    Benjiw: Wasn't working for me either. I am so tired of waiting for an update to this plugin, I know my client is too. No updates to the twitter profile since June 12th, nothing new at the website. Home page link on WordPress is broken.

    Anyone have a good recommendation for another similar plugin?

  8. mrmidjam
    Member
    Posted 5 years ago #

    I`,m looking for a solution to this also please help its doing my head in.

    Have changed the suffix to "return 0;" but nothing happens when i fetch now. returns on posts and it says in the log "Filtering duplicate post"

    Has anyone found a solution to this?

  9. mrmidjam
    Member
    Posted 5 years ago #

    ok used myphpadmin and deleted all rows in "wp_wpo_campaign_post" and i can now post.

  10. l053r
    Member
    Posted 5 years ago #

    did you delete all the rows at phpmyadmin >>> YOURDATABASE >>> wp_wpo_campaign_post >>> Browse ?

    And if so then did it work? i mean did it solve the duplicate posting issue? Please do let me know cuz I'm experiencing the same issue.

  11. l053r
    Member
    Posted 5 years ago #

    I Have WordPress 2.8, and WPOMATIC. The Editing was done on wp-includes/post.php

    Heres the deal, So Far I have Tried The Following Methods:-

    1. As tacomamama mentioned

    "Unfortunately, I can't find the corresponding line of code in wordpress 2.8's post.php file. Any idea where to put that "return 0;"? Would that still fix the problem?"

    and i did and i replaced return 0; with $suffix = 2; at Line 1750 as Pointed out by "Nexton"

    Result: FAILED! didn't work
    ---------------------------

    2. Then as suggested by Nexton (which is as follows)

    "I found it.

    There are 3 lines you need to change.

    -1750
    -1766
    -1780

    In these lines you should remove the suffix and add return 0;
    Cheers"

    So i replaced return 0; with $suffix = 2; on all the lines mentioned above.

    Result: FAILED! didn't work
    ----------------------------------

    3. I even tried as mentioned by mrmidjam in their post:-

    "ok used myphpadmin and deleted all rows in "wp_wpo_campaign_post" and i can now post"

    I deleted ALL the rows at phpmyadmin >>> YOURDATABASE >>> wp_wpo_campaign_post >>> Browse

    Result: FAILED! didn't work
    -----------------------------
    I just thought i would share my results with the world since non of them work so if anyone stumbles upon a solution that actually works please do let me know at L053r1 at gmail dot com

    cheers
    Peace

  12. lehenryjr
    Member
    Posted 5 years ago #

    Has anyone found a way to stop matic to prevent duplicates?
    Thanks in advance and I appreciate it...

  13. carl_pilk
    Member
    Posted 5 years ago #

    yes none of these fixes work for the latest version 2.9.2 of wordpress?

    the developer has been promising the new version will be released in a few days for months now.

    any fix for the duplicate post in the current wpomatic is greatly appreciated.

  14. westweb1
    Member
    Posted 5 years ago #

    I found a plugin that works. It's called ClearDuplicatePosts_V0.1 email me at westweb1 at gmail.com. Tested up to 2.7.

  15. moose123
    Member
    Posted 5 years ago #

    This is a great plugin, but it's doing the duplicate post thing in my 2.7.1. install.

    I think the author should fix this, but to be fair, WP keeps churning out releases so frequently that I think it's hard for authors to keep up and make sure that their plugins work with latest releases.

  16. llbbl
    Member
    Posted 5 years ago #

    I would like to see the double posting thing fixed as well. I was hoping that these newer release candidates would fix the problem.

  17. GarnetHGB
    Member
    Posted 5 years ago #

    I'm glad I found this discussion! I've been building my blog by mainly following a .pdf tutorial that insisted I should have this plugin. Now I know to hold off. A shame, though.

    It's unfortunate that the new WordPress releases tend to have such dramatic overall changes where plugins are concerned.

    Anyway, thanks for the warning, everyone.

  18. GarnetHGB
    Member
    Posted 5 years ago #

    I just came across an interesting discussion on Warrior Forum concerning possible alternatives to WP-O-Matic:

    I hope it's okay to make the referral, since it's completely relevant to what's going on here, but of much more current content.

  19. pittsleyb
    Member
    Posted 5 years ago #

    Any updates on wpomatic fixes for 2.9? Mine works perfect when I fetch manually but when i setup a cron it duplicates like crazy.

  20. mach5des
    Member
    Posted 5 years ago #

    "Any updates on wpomatic fixes for 2.9? Mine works perfect when I fetch manually but when i setup a cron it duplicates like crazy. "

    I am getting exactly the same error. It doesn't happen consistently, which makes it even more strange. One theory we had was that it was a memory issue when you run the cron. We added some more memory to the PHP.ini and it worked better. But we stil get duplicate posts.

    Any feedback would great.

  21. elizabethcb
    Member
    Posted 5 years ago #

    I believe I solved the duplication problem.

    For some reason the isDuplicate function doesn't quite catch a duplicate.

    I added a unique index to the hash column in the campaign_feeds table. I then tested for the insert and if it returns false, I don't insert the post to wordpress's posts table.

    In processItem had to move:
    $test = $wpdb->query(WPOTools::insertQuery($this->db['campaign_post'], array(
    'campaign_id' => $campaign->id,
    'feed_id' => $feed->id,
    'post_id' => $postid,
    'hash' => $this->getItemHash($item)
    )));

    if ($test == false)
    return false;
    to above this:
    // Create post
    $postid = $this->insertPost(
    $wpdb->escape($item->get_title()),
    $wpdb->escape($content),
    $date, $categories, $campaign->posttype,
    $this->feeduser, $campaign->allowpings,
    $campaign->comment_status, $meta);

    // If pingback/trackbacks
    if ($campaign->dopingbacks) {
    $this->log('Processing item pingbacks');

    require_once(ABSPATH . WPINC . '/comment.php');
    pingback($content, $postid);
    }

    also, I had to add the if $test statement to prevent lasthash from being overwritten:
    // Processes post stack
    foreach($items as $item) {
    $test = $this->processItem($campaign, $feed, $item);
    if ($test == true)
    $lasthash = $this->getItemHash($item);
    }

    Also, in the activation section I had to change campaign_feed's hash column definition from:
    hash varchar(255) default '',
    to this:
    hash varchar(255) default '' UNIQUE,

    which adds a unique constraint to the insert statement.

    I would add line numbers, but I've switched a bunch of other stuff around. It wouldn't be accurate.

    Note:
    With the use of dbDelta, it won't drop the table if it already exists, so deactivation and activation won't work. Also, if you do drop the table the data already stored will be removed. However, since the only thing that needs to be changed is an add index, if you have access to your db at all, it is simple to make the modifications. Especially, with something like PHPMyAdmin.
    All you do is find the table, click add index, name it hash or whatever, select unique from the dropdown menu and click save.

    I'll keep an eye on this thread to see if anyone has any problems or suggestions.

    Done with WPMU 2.9.1

  22. DragonDon
    Member
    Posted 5 years ago #

    That looks like a great fix, unfortunately I don't know much about sql, let alone going in and making such edits.

    Here's to hoping a fix comes out soon. I'll be checking into that alternative thread now...

  23. kiwipearls
    Member
    Posted 5 years ago #

    I would like step by step instructions on how to apply that fix please Eliza.

    If given the correct instructions on going in and modifying things via phymyadmin, I should be able to fix my wp-o-matic too.

    I managed to follow creating a unique hash in the campaign feeds table. I think.

    I went to the table, viewed structure, under actions clicked the unique button. It said:

    An index has been added on hash ( Query took 0.9295 sec )

    ALTER TABLEwp_1_wpo_campaign_feed` ADD UNIQUE (
    hash
    )`

    But as for the processItem info, I do not know what or where to edit. Which file?

    I eagerly look forward to hearing from you.

  24. daviddicks
    Member
    Posted 5 years ago #

    any chance somebody can make elizabethcb changes into the latest wpomatic installation? The duplicate post fix suggestion is rather complicated for most (including me) to integrate and test.

    Happy to host the new files if some clever person can kindly integrate this potential fix code into the latest release.

    The developer hasnt updated this plugin for nearly 2 years so we can't rely/expect him to fix it.

    Feel free to mail me.

    dd;)

  25. elizabethcb
    Member
    Posted 5 years ago #

    I jumped the gun a little, it mostly worked, but I didn't have enough data. Now that I'm getting about 100-200 posts an hour, I have a lot more data to go on. I'll be sure in a day or two weather it's a fix.

    I'm thinking of forking this project and releasing it.
    I'll get a plain copy to diff, and see if I can't find a nice middle ground between my very custom changes and public changes.

    slatetechpdx.com will eventually have a page for plugins and a contact form.

    Please feel free to email me.

    elizabeth at slatetechpdx dot com

  26. kiwipearls
    Member
    Posted 5 years ago #

    I'd be sure to try out your new project. As long as it more or less does what Wp-O-Matic does.

    I like the fact that with each campaign I can have it set to get as many articles as I like - which is normally 2 from each one. As I have quite a few feeds that I gather articles from. I like choosing categories for my campaigns.

    Also, tagging, I could never get tags to work in Wp-o-matic. That would be brilliant if you could.

    I'll be checking back here often to see what's happeing, Thank-you Elizabeth.

  27. daviddicks
    Member
    Posted 5 years ago #

    yes kiwipearlsthat reminds me, theres a bug with wpomatic and simple tags.

    http://wordpress.org/extend/plugins/simple-tags/

    I could never get simple tags to autotag posts wpomatic made, always had to manually click edit and 'update' each post for simple tags to apply the tags for me.

    the issue has been mentioned here: http://wordpress.org/support/topic/316385

    if that bug and the duplication bug could be ironed out this plugin would rock.

    dd

  28. elizabethcb
    Member
    Posted 5 years ago #

    Daviddicks,
    Replied at the topic: http://wordpress.org/support/topic/316385

    Kiwipearls,
    The problem with automatic tags and feed pulling, is that feeds have all sorts of random things in their categories. I've seen 6 digit numbers, 5 words, the name of the author. It's unfortunate, but using the feeds info is pretty gross.

    What is the difficulty you're having with tags?

  29. kiwipearls
    Member
    Posted 5 years ago #

    Hi Elizabeth,

    My problem was that I couldn't enter anything in the tag's field for each campaign feed. Ie My site is a wow site, so I would have a feed for druids, so I would want to use tags like Druid, Feral, Balance, Bear, Restoration etc.

    But instead just had to use categories. But I only wanted one category for each feed. But use the tags for other options.

    I have completely disabled Wp-O-matic for now. So I hope I have explained that ok from memory.

Topic Closed

This topic has been closed to new replies.

About this Topic