Issue with Facebook posts duplicating
-
We had an issue with Facebook posts getting duplicated on our site on every fetch, which bloated up our database and had the images taking up a lot of hard disk size.
After looking into this, I managed to fix the issue by making this small change to the plugin code:
inc/class-facebook.php on line 56:
$post_id = $this->post_exists( $title );
The issue with using post_name_exists and passing the title as a parameter, is that the post_name property gets formatted in the database like this: “Post Name One” -> “post-name-one”, which causes the LIKE comparison to fail. Instead we should use your brilliant function
post_exists()
and only just pass the title as a parameter.Cheers!
Antti
- The topic ‘Issue with Facebook posts duplicating’ is closed to new replies.