Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › 500 error
- This topic has 5 replies, 2 voices, and was last updated 3 years, 6 months ago by
malhyp.
-
AuthorPosts
-
November 10, 2022 at 10:35 pm #39949
malhyp
ParticipantHi 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 #39951Ernest Marcinko
KeymasterHi 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?
November 11, 2022 at 10:53 am #39954malhyp
ParticipantHi 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.
November 11, 2022 at 11:09 am #39957Ernest Marcinko
KeymasterI did, and strangely it actually worked.
I will do a debugging session via the sftp access, and will let you know what I found.
November 11, 2022 at 11:19 am #39958Ernest Marcinko
KeymasterThe 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:
// 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; }November 12, 2022 at 12:48 am #39961malhyp
ParticipantHi 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.