Hi, I Have the rather undefined feeling that the slow Parts of the Site might, come from slow database queries, either the Indexes are broken, or the Queries themselves are querying unnecessary large Datasets from the Database and filtering is done in PHP, or whatever ^^.
Just a Gut-Feeling, as I cannot think of anything computational in PHP That could cause those Slow responses.
What is your take on letting other People take a peek into the Source Code?
I have a feeling the PHP/MySQL coding may be part of the issue. The only thing I don't understand is why the site worked fine in 2019 and then in 2020 it's really slow when nothing really changed coding-wise.
There are many things that could be at fault, A change, hopefully, introduced in that time span might be Updates to newer dependency versions, or you possibly extracted the Database once, and restored it from a Dump, with the dump missing Index Information, maybe the Database is running on Slow Disks, and the Cache is not configured Properly... the list goes on . To know for sure I would have to take a look though.
Are you running on some kind of Webspace? or is this a VPS?
What PHP Version are we on?
What kind of Database are you running in the Backend? (MySQL / MariaDB probably?)
What Version is the Database in?
If you want me to take a look, hit me up on Discord, I am around all the Creatures Discords. look for "KeyboardInterrupt#6976"