Search function doesn't work well and hangs up on site

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search function doesn't work well and hangs up on site

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 6 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12906
    Paul Ogle
    Paul Ogle Jr.
    Participant

    Hi, we’re using your ajax search pro search bar for the front page of our site. It seems like it’s running very slow compared to how it is on a different hosted location of the same site. https://www.screencast.com/t/9bGChammCD

    old site for comparison: http://activelogix.net/wp/

    When you type in something like ‘Honeywell’ or ‘Vykon’ it just sits there and thinks but doesn’t take you to anything. Typing in a specific product name will, but it just doesn’t search well in general compared to how it did on the old site. Do you know what might be the issue, and how to fix it?
    Turning off other plugins or changing the theme doesn’t seem to affect it one way or another.

    An error log brought back returns that indicated ajax.php errors:

    [Wed Apr 26 14:56:12.697416 2017] [:warn] [pid 42281] [client 73.131.52.161:47470] Timeout waiting for output from CGI script /home/activel9/public_html/wp-admin/admin-ajax.php, referer: http://www.activelogix.com/
    [Wed Apr 26 14:55:42.667388 2017] [:warn] [pid 42281] [client 73.131.52.161:47470] Timeout waiting for output from CGI script /home/activel9/public_html/wp-admin/admin-ajax.php, referer: http://www.activelogix.com/
    [Wed Apr 26 14:55:34.380378 2017] [:warn] [pid 39399] [client 73.131.52.161:41742] Timeout waiting for output from CGI script /home/activel9/public_html/wp-admin/admin-ajax.php, referer: http://www.activelogix.com/

    Thanks,
    Paul

    #12907
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Paul,

    I think I know why actually. The recent plugin release (4.10.3) has an additional hidden filter to ignore products which are not visible on the search page. Turns out, there was a design flaw in WooCommerce (patched since then), and also a mistake I made with the implementation of this filter. Long story short, in some cases it simply is not able to execute, and just hangs up. I believe that is the cause here.

    To fix it, you will have to make a tiny change to one of the plugin files. Below I will describe exactly how to do it, but if you want, you can leave FTP access here, and I will do it for you.

    – Before you start, please make sure you have a copy of your site files, to be able to restore in case of mistakes.
    – Then open up the wp-content\plugins\ajax-search-pro\includes\classes\search\class-asp-query.php
    – Scroll to line 384, which should be this:

    if ( class_exists( 'WooCommerce' ) ) {

    – Change that to this:

    if ( class_exists( 'WooCommerce' )  && 0) {

    – Save the file, and it’s done.

    After the change, it should start working immediately.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #12908
    Paul Ogle
    Paul Ogle Jr.
    Participant

    awesome! that fixed it perfectly. thanks much!

    #12921
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Search function doesn't work well and hangs up on site’ is closed to new replies.