I confirmed this problem on two other Divi sites and one using the GeneratePress theme.
Plugin Author
Ajay
(@ajay)
@brianrshim
Are you in a position to disable other plugins and give this a try? Ideally do this one at a time.
I’m unable to replicate this in my production and test sites.
Also, do you have some kind of stack trace in the error to see what functions are calling?
Hi Ajay,
Thanks for your response. I traced the conflicting plugin to the Lightspeed Cache plugin:
https://wordpress.org/plugins/litespeed-cache/
The memory error only happens when that plugin is activated. It doesn’t matter if the cache is on or off though. Either way, with that plugin activated, the memory crash happens when search term is blank.
Error also only happens with Better Search’s “Enable seamless integration” set to OFF. When set to ON, the crash doesn’t happen.
You can view the problem here:
https://test.brianshim.com/?s=
And I’m happy to give you admin rights to that server if you want.
I wasn’t able to find a simple solution. But would it be possible to add a switch (in the UI or action hook) to Better Search to give a message like “Please enter a search term” if the search term is blank (i.e., /?s=) ?
Many thanks,
Brian
Plugin Author
Ajay
(@ajay)
Thanks for this tracing. Also helps knowing this is limited to the non-seamless mode. So it’s likely something in the template. For some reason the plugin thinks there is a search term when there isn’t.
I’ll try to see if I can replicate this in my test server – will be easier for me to trace and debug vs your test site.
Great, thanks Ajay. Let me know if you need anything from me.
Best,
Brian
Plugin Author
Ajay
(@ajay)
@brianrshim
I think I have a solution for this. Will you be able to make an edit to the utilities.php file above – Line 446 should be changed to:
while ( ! empty( $loc ) ) {
Hi Ajay,
I did the update and it solved the crash! See clean result here (no longer crashing):
https://test.brianshim.com/?s=
I look forward to seeing it in the next revision.
Many thanks!!!
Best,
Brian
Plugin Author
Ajay
(@ajay)
@brianrshim
I’ve fixed this in GitHub and it will part of the next release.
HI Ajay,
Can you tell me when the next release will be coming? It doesn’t look like this fix is in the released code yet.
Thanks,
Brian
Plugin Author
Ajay
(@ajay)
I haven’t had the time to finalise a release. However, there is this beta in GitHub which has this fixed if you’d like to give it a go.
https://github.com/WebberZone/better-search/releases/tag/v3.2.0-beta1
Thanks. I implemented your fix manually and it works great.