Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Marius L. J.

    (@clorith)

    Hi,

    It could mean that you are on a pretty good host, and are currently in the middle of a search still (on a good host you probably won’t ever see the transition from “preparing” to “performing”)

    It could also mean that you’ve hit a memory limit, which was something I (unfortunately) did not anticipate in the same way that I looked into max execution times.

    Good news is that I’m just finishing up tests for an update that handles memory limits, and provides better statuses, so keep your eyes peeled for 2.0 some time today!

    I’m on version 2.0 and was getting stuck on “preparing search” also for queries that should work. I’m on what you would consider a “fast host”. Rolled back to 1.9.1 and it’s working again.

    Plugin Author Marius L. J.

    (@clorith)

    @mrbrian
    Then you have other problems I suspect, could you open a new thread and check your servers error log as it won’t be able to get stuck on “preparing search” any more unless something really broke on the code layer for you (and the 2.0 issue won’t be related to this 1.9 one that I can guarantee ?? )

    I updated back to 2.0 (from 1.9) to look again and there are no php errors happening. I have debug mode enabled and log to a .txt file in wp-content – i’m positive there’s no errors from your plugin. Rather, from using chrome network inspect, it looks like your plugin is sending the same ajax data over and over (never actually returning results):
    {“success”:true,”data”:{“search”:[]}}

    Plugin Author Marius L. J.

    (@clorith)

    239Odd… it sounds like it thinks it’s exceeded the memory limit, are you comfortable making some edits to the 2.0 version quickly to add some debug output ?

    If you are, in string-locator.php find the nearing_memory_limit function (it should be at line #239) and change it to the following:

    function nearing_memory_limit() {
      $built_in_buffer = apply_filters( 'string-locator-extra-memory-buffer', 256000 );
      $memory_use = ( memory_get_usage( true ) + $built_in_buffer );
    
      if ( $memory_use >= $this->max_memory_consumption ) {
        error_log( sprintf( 'Memory exhaustion near (%d), currently at %d', $this->max_memory_consumption, $memory_use ) );
        error_log( var_export( memory_get_usage( true ), true ) );
        return true ;
      }
      return false;
    }

    It should now create output in your error log, could you see what it shows (should be two lines, but if it’s failing to check the memory it’ll re-trigger quite often)

    Actually seems to be working somewhat (the results are looping and never finishing), but yes looks like it’s hitting memory limits:
    May 07, 11:52:20 Memory exhaustion near (12800000), currently at 12838912
    May 07, 11:52:20 12582912
    May 07, 11:52:22 Memory exhaustion near (12800000), currently at 13101056
    May 07, 11:52:22 12845056
    May 07, 11:52:23 Memory exhaustion near (12800000), currently at 12838912
    May 07, 11:52:23 12582912
    May 07, 11:55:14 Memory exhaustion near (12800000), currently at 25946112
    May 07, 11:55:14 25690112

    Plugin Author Marius L. J.

    (@clorith)

    All right, progress!

    Are you at this time searching through something large with a lot of possible files to look over (such as the whole WordPress directory, or all themes/all plugins) ?

    Yes, when it continually looped the same results and never finished it was searching all plugins. I ran a search on a plugin with only 1 file and it returned results and finished as expected, but it did still throw a warning in the log:
    May 07, 12:52:03 Memory exhaustion near (12800000), currently at 12838912
    May 07, 12:52:03 12582912

    Plugin Author Marius L. J.

    (@clorith)

    Just a follow up to let you know I’ve not forgotten about you, I’m just testing in various environments when time permits to try and track this down.

    Do you have a lot of plugins enabled at this time, or a “heavy duty” theme ?

    Around 50 plugins. The theme is not heavy duty nor would that have any impact as themes are not loaded into memory in admin. Memory usage per page load is around 15mb (using query monitor) with a 256mb limit.

    Plugin Author Marius L. J.

    (@clorith)

    Hiyah,

    Just letting you all know I am pushing 2.0.1 now, which contains a calculation fix for the memory consumption checks which would in some cases give an incorrect report when there was a large amount of plugins available (or a heavy theme)) in place.

    On many of my websites, 2.0.1 just gives:
    The memory limit is about to be exceeded before the search has started, this could be an early indicator that your site may soon struggle as well, unfortunately this means the plugin is unable to perform any searches. Current memory consumption: 2353152 bytes

    I’ve used your latest version on different VPS and websites and it just doesn’t work well. I’m still using version 1.9 and it searches the entire wordpress directory in 10 seconds.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Stuck on "preparing search"?’ is closed to new replies.