mysql_real_escape_string error may be timing out my feed processing

I've seen multiple threads about this issue but it seems that nobody is following through with support to give the information you guys need to help fix the problem. Here's what I can tell you:

In my error log I can see multiple instances of 200+ lines of the same error coming from the same site, here's an example:
PHP Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in /var/www/htdocs/wp/wp-includes/wp-db.php on line 789, referer: http://preview.vortala.com/pp0550/wp-admin/admin.php?page=autoblog_admin

sometimes the error comes right from the wp-db.php file like this:
PHP Warning: mysql_real_escape_string() expects parameter 1 to be string, object given in /var/www/htdocs/wp/wp-includes/wp-db.php on line 789

I have something set up to run my WP crons for me, and it's got a timeout of 30 seconds to make sure nothing hangs too long. The above error goes on for over 1000 lines before hitting the 30 second limit and cutting off.

I have the latest version of Autoblog and I'm on WP 3.4.2 (haven't moved to 3.5 yet). I have a large ~2000 site network and the feeds don't run automatically as they should (start showing "next check: 2 days ago"). I think this long list of warnings may be the problem or part of the problem.

Any ideas with the information I have given? Is there any other information you need that I can give you?

  • jasonjulien

    Well, after hours and hours and 1000s of lines added to my error log dumping variables and such, I figured out the problem. I think this is the same issue facing a lot of other forum-goers here.

    The problem is:

    When importing the post author the entire author object is getting passed in.

    Solution:

    Pass in just the author ID.

    Once you've got the Author object you need only use $author->ID when assigning it to $post_author for use in the array for wp_insert_post.

    So in the latest version of Autoblog (3.9.5.1) line 831 of autoblogprocess.php would be $post_author = $author->ID;

    I believe it's as easy as that since Autoblog is always using an author object.

    Let me know if I've nailed it.

  • aecnu

    Greetings jasonjulien,

    Just checking if this issue was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thank you for being a WPMU DEV Community Member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.