I have also been experiencing this with my install of WordPress. I’ve found two workarounds to the problem. Each of these workaround were tested for a couple of days each and I never experienced another duplicate posts.
—–
The first workaround has to do with the guid that is generated and stored along with the post. I found that all of my duplicate posts had only one difference: their guid in the posts table were slightly different. For example:
https://www.testsite.com/example/?guid=<guid-hash>
https://www.testsite.com/example/?guid=<guid-hash>
https://example.testsite.com/?guid=<guid-hash>
https://example.testsite.com/?guid=<guid-hash>
In syndicatedpost.class.php:
Line 778, change to:
return trailingslashit(get_option('siteurl')).'?guid=';
I’m using the Domain Mapping plugin (https://premium.wpmudev.org/project/domain-mapping/), so I had to also add the following.
In feedwordpress.php, add:
Line 1003 at the beginning of function update, add:
remove_all_filters('pre_option_siteurl');
remove_all_filters('pre_option_home');
With this workaround, I have noticed in my log file, that feedwordpress repeatedly tries to insert the post, but its never duplicated.
—–
The second workaround, I tried storing the original guid from the rss feed for each post and checked for that guid before inserting any post.
In sydicatedpost.class.php:
Line 262, add:
$this->post['meta']['guid'] = $this->post['guid'];
Line 1267, change:
$q = new WP_Query( array(
'ignore_sticky_posts' => true,
'meta_key' => 'guid',
'meta_value' => $guid
));
—–
I’m thinking for my install, I will do a combination of both workarounds, so I have a consistent guid in my posts table, plus feedwordpress won’t constantly be trying to insert already existing posts.
If you have a chance to test these, please let me know if these solutions work for you or not.
Good Luck!