xwp / stream

🗄️ Stream plugin for WordPress

Home Page:https://wordpress.org/plugins/stream/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Prevent "Auto Draft" posts from being logged

fjarrett opened this issue · comments

@wormeyman reported in the support forum that "Auto Draft" records are being created randomly by the server, I have confirmed this is occurring in my testing environment also.

screen shot 2014-03-03 at 4 18 06 pm

I don't think Stream should be tracking these since they are not actually from a user action, but rather, a system action which deletes neglected drafts. All post types are affected by this.

@shadyvb Do you agree?

I'm not 100% what the steps are to recreate this, but I think you might be able to by creating a new post, leaving it up for a minute and then abandon the screen without doing anything.

Yes, actually i was being bugged by this every now and then, and was going to report it today! We should definitely kill it, totally useless to track it.

EDIT: There almost no need to recreate the issue, it should be fairly easy to fix it in the Posts Connector.

auto draft
I can confirm that my screen looks similar to yours! I also have no idea how to create this.

edit: Also this website has 0 posts it is an all page website not a blog.

@wormeyman Auto Draft here would reference any type of content, posts or pages or any custom post type as well.

And this probably is carried out by a cron or something, since it happens on logging to the administration area sometimes without triggering any action related to editing content.

It looks like it may be related to post revisions after doing a little Google searching.

Post revisions are handled already in another part of the connector, they probably aren't the reason behind this.

I did some research. It seems that the easiest way to create auto drafts is going to Add new post page and clicking Save draft when there's no content at all.

Prevention of deletion logging is not possible by post status, because all trashed posts have trash status. I found out that there's one thing that is special for auto drafts: at the same time they do have titles and don't have post slugs (post_name). After my research it seems like it's their uniqueue property.

After longer research it seems that this combination occurs for regular drafts with non-empty title as well. I found something else: auto drafts are the only ones with post_modified_gmt field set to 0000-00-00 00:00:00. All other types have it set to current date even if their post_date_gmt is 0000-00-00 00:00:00!