Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Peformance boost: Optimize configuration loading and credential checks #342

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrKoopie
Copy link
Contributor

Modified openprovider_getConfigArray to use static caching for configuration and refined the credential check logic in ConfigController to include additional parameters such as action and module. These changes aim to improve performance and ensure the proper execution of credential verification, but only upon saving in WHMCS.

Reduced admin/clientssummary.php?userid=xxx from 11 seconds to 1.34 seconds.

Modified `openprovider_getConfigArray` to use static caching for configuration and refined the credential check logic in `ConfigController` to include additional parameters such as action and module. These changes aim to improve performance and ensure the proper execution of credential verification.
@sapillai sapillai requested a review from avishka-ra November 29, 2024 07:50
@avishka-ra
Copy link
Collaborator

I tested the code and clearly i can see that there is an improvement of the performance.
But can i know what is the reason of using "$_GET['action'] == 'save' / $_GET['module'] == 'openprovider' " in ConfigController.php class.

@DennisSkov
Copy link

But can i know what is the reason of using "$_GET['action'] == 'save' / $_GET['module'] == 'openprovider' " in ConfigController.php class.

It only runs the checkCredentials method if the configuration for the openprovider module is saved.
It seems like the current version of the module will check if the credentials are valid every time WHMCS calls the getConfigArray().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants