Exteme slowdown in site with 3.4.2 - Error log included. (2 posts)

  1. jrnetwork
    Posted 3 years ago #

    Upon using WordPress 3.4.2 I had an issue with a website running very slow. I then lodged a support ticket with my hosting provider who investigated this for me. They came back with the following.


    I checked the error logs for the website and found the following error occurring quite a lot.

    [Sat Sep 29 04:15:20 2012] [error] [client] PHP Warning:
    Invalid argument supplied for foreach() in
    /var/www/vhosts/micksgym247.com.au/httpdocs/wp-includes/query.php on
    line 2762

    I have fixed this error by replacing

    // Always sanitize
    foreach ( $this->posts as $i => $post ) {
    $this->posts[$i] = sanitize_post( $post, 'raw' );


    // Always sanitize
    if ( $this->post_count > 0 ) {
    foreach ( $this->posts as $i => $post ) {
    $this->posts[$i] = sanitize_post( $post, 'raw' );

    in wp-includes/query.php


    Is this a known error, and if not, why would this happen on a brand new install of WordPress?

  2. Quoting someone else (it's a good reply):

    No! Never, ever, edit WordPress core scripts. And do not encourage others to do so. Editing core scripts can bring down your entire site and/or open security holes for hackers to use when your site is online.

    Can you put the original wp-includes/query.php back and try the usual troubleshooting steps?

    Have you tried:

    - deactivating all plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    - switching to the Twenty Eleven theme to rule out any theme-specific problems.

    - resetting the plugins folder by FTP or PhpMyAdmin. Sometimes, an apparently inactive plugin can still cause problems.

    - re-uploading the wp-admin and wp-includes folders from a fresh download of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Topic