Support » Plugin: FeedWordPress Advanced Filters » Creating duplicate unattached image records in DB

  • I recently noticed that FAF was generating an enormous number of unattached media files, so I did a bit of research and I think I may have uncovered a bug (or at least something annoying).

    When an Image Filter is added on the Posts & Links page and “Save images locally” is marked, a duplicate, unattached record is created in the database.

    Effect: database clutter – the “unattached” records remain when a post and its media are deleted. May also mean WP doesn’t delete the media files when the posts are removed? (Not sure about that.)

    Here’s how I tested:

    Deleted a few posts, emptied trash.
    Unmarked the “Save images locally” option.
    Ran feed updates manually.

    Result: local copies of images are created for new posts in the normal way and are attached to the correct post_parent.

    Deleted a few posts, emptied trash.
    Marked the “Save images locally” option.
    Ran feed updates manually.

    Result: local copies are created as before, but a second media (attachment) record is also created in the DB. It is exactly the same as the first, pointing to the same image, but has post_parent set to 0.

    I tried it with the “Set featured image” option as well, but that doesn’t seem to affect it. It’s definitely the “Save images locally” option that’s duplicating lines.

    Hope it helps. 🙂

    http://wordpress.org/plugins/faf/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Bas Schuiling

    (@basszje)

    Interesting. This is indeed a problem I have once in the few hundred of posts I index through my plugin but I never got to it what exactly causes this.

    Normally FAF stores images locally, adds a temporary reference in the database ( as a workaround since at filter time there is no postId yet, which is needed for this ) and after the process all images are attached to the corresponding feed.

    ‘Result: local copies of images are created for new posts in the normal way and are attached to the correct post_parent.’

    How does FWP save images locally normally? The whole reason for this filter is that it doesn’t happen.

    Anyway if you have an example of a feed where this happens structurally then please share so I can dig into the problem.

    n.b. can you also check if images are being duplicated physically? This never happened but I want to double-check since that would be way worse than too much DB-records.

    Thread Starter TIEro

    (@tiero)

    The images aren’t duplicated physically. I suspect it’s an interaction with one of the (many) other plugins active on the site.

    If it’ll help, I can happily give you admin access to one of the sites it happens on, and even DB access if needed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating duplicate unattached image records in DB’ is closed to new replies.