Skip to:

WordPress Attachment Nightmare..

  • dennissmolek


    I wanted to get some feedback on what I see as a real issue in the way WordPress handles attachments and user added content.

    Right now when you create an attachment WP creates a hidden blog post in your blog with the file data, and is given a post “owner” so it can be tracked.

    This is fine and dandy when your a user one ONE blog for a site, but what if you’re on MANY blogs or NONE AT ALL.

    My users don’t have blogs so for example EVERYONE’s avatars are attached to blog #1

    And as I work my plugin I found so is all 30 photos they have, that means for 1000 users it will have 31,000 hidden posts in Blog #1 to hold all that file data.. PLUS two posts in the meta data for each post, so 62,000 post metas.. or 93,000 rows of data. for 1000 users..

    So usability of blog number 1 is gone

    BP automatically puts ALL USER AVATARS there when loaded via the profile. Besides mucking around I haven’t seen how to change this..

    Now a user CAN load data in a blog they are given, but these attachments don’t go anywhere near their profile. They are written as hidden posts in that blog.

    With that, what if I’m on a site for visual communicators, and I make a post on the Zines blog, but want to use the SAME photos or files on the Cool Stuff blog?

    Right now I have to upload those files TWICE. And again that data is stored as blog posts on those specific blogs and nowhere else. So my profile doesn’t show any of that data.

    Also, when/if the image plugin gets working and if it uses the same core WP code it will trap all images onto the #1 blog and a user wont be able to load images into a blog post on another numbered blog. So one image of the great party could end up being uploaded 3 times.. That seems like a real waste when we’re talking about storage space.

    I was going to write my own file system into BP that tracked files on a USER basis, but that would mean writing TONS of code that WP core has done, and gotten working GREAT. The way it works now was written for the single WP install, and WPMU just inherited it because who thought the users would be moving their attachments over? But now that ALL users are on blog #1, or have no blog at all and we are starting to give them files(images, .doc files, PDF, etc) for their profile we are having to back track that data. Here’s the wild part, BP is telling WP that user number 1 is uploading all of the Avatars, so right now you cant even do a search in the database to see what users created what content(EDIT: well you can, but avatars or any content created with the avatar upload modified will still show user #1 as the author)

    Even the language is weird, everyone who adds attachments is an “author” and all attachments are “posts”. I know WordPress is a blogging software first and foremost, but as it evolves into a wider platform it too needs to change.

    My personal solution right now is to create 10 hidden blogs and when a new user registers it randomly chooses one of those 10 to store the attachments. That way I can scale those tables if/when that becomes an issue, and to avoid 1 million post blogs. (5,000 users on a photo sharing site.. ) I cant even imagine the comments..

    I’m sticking with blogs as this will future proof my plugin, and I think average site admins wont notice, and those that do can scale easily.. Also this keeps it updatable when WP makes any changes.

    Then in the future when this becomes something large sites are noticing and it becomes addressed I will change with them. That or it will bother me enough to write file management over the summer.

    You may be thinking, who cares its just files, and stuff like that will only be in a blog, but when PDF’s and REAL files start being able to be moved(SOON) and sites like mine get large enough for this to be an issue WordPress may be left behind.. Joomla has Joomsocial, which works great.

    I dunno.. I just needed a rant.. And because I’m getting frustrated while working on a BP plugin I thought here would be as good as any..

    Oh and PS groups uses blog #1 too..

Viewing 2 replies - 1 through 2 (of 2 total)

  • Andy Peatling


    Just change the upload path setting and filter the location, not a big deal.




    Are you referring to the actual file path? That is a non issue as most WP plugins for cloud/split level management work great with BP.

    The issue is where in the database, and HOW in the database it is being stored.

    If your saying I can MOVE the location from the #1 blog with a filter I havent found please let me know.

    Also if I can choose which fields it uses to store them would be usefull, I have looked in WP upload and your avatar script and it seems hard coded into the users blog directory, which in all BP users case is blog #1 first.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WordPress Attachment Nightmare..’ is closed to new replies.
Skip to toolbar