Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › 500 error
This topic contains 5 replies, has 2 voices, and was last updated by malhyp 1 year, 5 months ago.
- AuthorPosts
- November 10, 2022 at 10:35 pm #39949
Hi Ernest,
I sent an email yesterday about the 500 error, can you have a look into this urgently? The whole site relies on search as there are many products and this is the third time we get this error. Last time you mentioned that the issue was resolved via a plugin update.
To confirm, we upgraded to PHP 8 yesterday and noticed this straight after the update.
In relation to access to the site, can you test admin and SSH? there is no FTP on this server.
Thanks
MalcolmNovember 11, 2022 at 10:17 am #39951Hi Malcolm,
Thank you very much for the details. I have logged in to the back-end and installed a beta version of the next release, which addresses a few known bugs.
Can you please test if that resolved the issues?
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 11, 2022 at 10:53 am #39954Hi Ernest, thanks for the update, did you try?
Attached is what we see, one is searching for something, and the other is when we hit enter.
Attachments:
You must be logged in to view attached files.November 11, 2022 at 11:09 am #39957I did, and strangely it actually worked.
I will do a debugging session via the sftp access, and will let you know what I found.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 11, 2022 at 11:19 am #39958The issue was not related to the plugin, you had a custom code in your functions.php file which was incorrect and caused the error. I made a correction to it, now it is going to be fine. For reference, this is the correct code:
Best,// Replace search phrases add_filter('asp_search_phrase_before_cleaning', 'asp_replace_characters', 10, 1); add_filter('asp_query_args', 'asp_replace_characters', 10, 1); function asp_replace_characters( $s ) { $before_strings = array( "landc" => "land c", //land cruiser "brakes" => "brake", "rangero" => "range ro", //range rover "landr" => "land r", //land rover "towb" => "tow b", //towbar "bellh" => "bell h", //bellhousing "extractor" => "header", "pickup" => "ute", "hood" => "bonnet", "mfg12" => "mfk12", "brake disc" => "brake rotor", "adapte" => "adapto", "centref" => "centerf", "hydrob" => "hydro b" ); foreach($before_strings as $key => $value){ if ( is_array($s) ) { $s['s'] = str_replace($key, $value, $s['s']); } else { $s = str_replace($key, $value, $s); } }; return $s; }
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 12, 2022 at 12:48 am #39961Hi Ernest,
Thanks for the update, and for finding that issue.
Honestly, I don’t know why it’s there but will ask.
- AuthorPosts
You must be logged in to reply to this topic.