openprovider / Openprovider-WHMCS-domains

Openprovider WHMCS Domain Module
43 stars 31 forks source link

Extremely slow page load #345

Open idagroup opened 3 days ago

idagroup commented 3 days ago

https://github.com/openprovider/Openprovider-WHMCS-domains/blob/71684dce9fe6735bcb3e170fff591d81737d9fdf/modules/registrars/openprovider/hooks.php#L15C1-L15C36

Every page took at least 20 seconds to load, but I found the culprit and it is now back to ~2 second load times.

What I did: In hooks.php, I moved require_once(__DIR__ .'/init.php'); from line 15 to 7 and replaced it with require_once '../../../init.php';

sapillai commented 2 days ago

Hi @idagroup,

Thank you for sharing.

I couldn't reproduce it in my test environment, but I will have our developers review this. For testing, can you please mention few pages where you noticed slow loading?

idagroup commented 2 days ago

Hey @sapillai, we're using the latest WHMCS on PHP 8.1 along with the ModulesGarden MultiBrand module, and that might be the reason for those delays. I don't think we need to use DIR since the path between the two files stays consistent.