Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search does not work unless page is fully loaded first
- This topic has 13 replies, 2 voices, and was last updated 4 years, 9 months ago by
Ernest Marcinko.
-
AuthorPosts
-
August 16, 2021 at 1:49 am #34278
alan_bpn92
ParticipantI am seeing very intermittent issues with our search box at the top of the broadwaypodcastnetwork.com. It is “website top search” (id 6). It seems that if anyone starts typing in the search bar before the page is 100% loaded, it does not work. Then a page refresh is needed and sometimes it doesn’t even work the second time.
How can we ensure that no matter when a user starts typing that the search will produce results?
Thanks in advance of your help!
August 16, 2021 at 10:12 am #34279Ernest Marcinko
KeymasterHi!
The issue is caused by the script deferring. I noticed on the page source, that all of the scripts are loaded as “deferred”, except some of the ajax search pro scripts. If you are using WP Rocket or similar cache optimization plugins, make sure not to exclude the plugin files from the defer process.
Also, usually excluding jquery from the deferred scripts helps with any compatibility issues, but it should not be neccessary.
You can also try this compatibility switch, if nothing else works: https://i.imgur.com/7pw4sjS.pngAugust 24, 2021 at 8:43 pm #34362alan_bpn92
ParticipantThank you! I seem to have been able to get the search itself working again — but now no featured images show for me next to search results. What do you suggest?
August 25, 2021 at 12:14 pm #34373Ernest Marcinko
KeymasterIt looks like you have an issue with your .htaccess file or your mod_rewrite configuration on your server.
If you try to access the WordPress ajax handler on your server, it should print a blank white page with a 0 or -1 printed to it. However note, that it can not be reached. This file should be publicly accessible, as WordPress does use it for background processes, as well as plugins for ajax requests.
Usually it is due to a permalink misconfiguration, or a cache plugin related misconfiguration in the the server .htaccess file, or something with a firewall.August 30, 2021 at 12:37 am #34404alan_bpn92
ParticipantWhen I visit that link I actually get the blank page with the 0 printed… but still no images in the search results. Thoughts?
August 30, 2021 at 9:43 am #34409Ernest Marcinko
KeymasterI am getting a 403 error still, with a blank page nothing printed to it.
I checked the request source, and it seems to be a firewall blocking the requests based on the response: https://i.imgur.com/fnZgvEI.png
For me it shows a geolocation restriction, but it can be different for other IP addresses.August 30, 2021 at 2:45 pm #34418alan_bpn92
ParticipantWhat is your IP? Let me whitelist you so you can effectively troubleshoot.
August 31, 2021 at 6:43 am #34433Ernest Marcinko
KeymasterYou cannot access this content.
August 31, 2021 at 2:44 pm #34446alan_bpn92
ParticipantOk, try now!
August 31, 2021 at 5:52 pm #34450Ernest Marcinko
KeymasterThanks, that worked!
It was the lazy image loading script not working correctly. I updated the plugin to the latest release (it is not released yet), to test if that resolve it – and it did 🙂
It should be all right now.August 31, 2021 at 5:53 pm #34451alan_bpn92
ParticipantWonderful, thank you! Would you mind doing that on staging.broadwaypodcastnetwork.com as well? We are doing a big home page redesign and I don’t want to lose your changes when we push the staging site into prod.
August 31, 2021 at 5:59 pm #34452Ernest Marcinko
KeymasterSure, done 🙂
August 31, 2021 at 6:59 pm #34453alan_bpn92
ParticipantYOU DA BEST
September 1, 2021 at 7:46 am #34459Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.