Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search not working when logged out and SQL errors
This topic contains 6 replies, has 2 voices, and was last updated by lonemill 1 year, 6 months ago.
- AuthorPosts
- February 1, 2023 at 7:35 pm #41191
I am having a strange issue where search only works when logged into the site. Logged out and incognito returns 0 results, or if I remove the search string it will return all results.
This is the search bar on the homepage.
I am also receiving a lot of sql query errors in our logs from the plugin (see attached). Perhaps it’s related. Can you please help?
Plugin version 4.25.1
Attachments:
You must be logged in to view attached files.February 2, 2023 at 10:23 am #41193Hi,
Thank you for the details!
Interestingly, the MySQL log refers to a syntactical error, when there is none in the log, so maybe there is a missing part. I am suspecting the file may have been corrupted, it can happen if it was uploaded via FTP.
- Can you please try downloading the plugin from codecanyon, then uninstalling, deleting and installing it again? That will refresh the files. Your settings, search instances etc.. will remain as is.
- Try turning OFF the custom ajax handler too, that may cause conflicts in some cases.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 2, 2023 at 10:40 pm #41206Thanks Ernest. I just disabled/uninstalled/reinstalled the plugin as well as turned off the ajax handler and still seeing the same results as well as the error being generated in the log.
Any other ideas?
February 3, 2023 at 10:58 am #41212Okay, then I have to debug through this. Can you please add temporary FTP and back-end details? I will have to make direct changes to the code to track the conflict.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 3, 2023 at 6:19 pm #41223You cannot access this content.February 4, 2023 at 2:31 pm #41227Thank you!
I managed to find the issue. A 3rd party script is contaminating the search settings form in the header with additional inputs, as you can see on this screenshot. This is not part of the plugin, this element is injected into the search form itself, and when the search is initiated it is sent to the back-end. It looks like it is for some sort of cookie validation or something similar.
That alone would not be an issue whatsoever, however after the data is sent to the back-end, when it reaches to ajax search pro, these options are completely wiped out, so malformed data is reaching the plugin, causing the issue.
I suspect this is caused by one of the plugin scripts – something to do with cookies/firewall or something similar. The element is injected, so I can’t trace it back to the origin, but based on the injector function name
Best,apbct_attach_event_handler__backend
it seems to be Spam protection, AntiSpam, FireWall by CleanTalk. If you use a plugin by that name or anything similar, then it is very likely causing the problem.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
February 4, 2023 at 4:58 pm #41230Thank you Ernest, I’ll look into that other plugin. Appreciate the help.
- AuthorPosts
You must be logged in to reply to this topic.