Jump to content

Prevent WHMCS from calling _GetDomainInformation


Recommended Posts

Hi,

I've already asked support but I fear that my question is going to result in a "You should consult your developer"-response.

We've developed a registrar module for .dk domains. DK Hostmaster is the .dk registry, and unfortunately their EPP is awfully slow. I'm trying to optimize our calls to their EPP system the best I can.

We have a custom function called dkregistrar_ManageDNSSEC that basically grabs the current DS records from EPP and allows the client to manage these records on clientarea.php?action=domaindetails. This function is available to the customer in dkregistrar_ClientAreaCustomButtonArray.
Calls to DK Hostmaster's EPP is, as I've said, very slow, and a single call to get information about the domain name takes around 15 seconds.

While trying to optimize my code, I saw that WHMCS automatically calls dkregistrar_GetDomainInformation whenever I access any of the tabs on the domaindetails page. I've tried deleting all of my code, except the function name, but WHMCS still runs the function.

The problem is that I have to call the exact same function to get information about DS records, so WHMCS basically has to call that function twice which results in very, very bad load times.

Is there any way to prevent WHMCS from making the automated call, or preferably: Would I be able to grab the response from the function call that WHMCS makes?

 

I can't really see the reason that WHMCS calls _GetDomainInformation in custom functions without returning the response anywhere. Or maybe it's being returned, I just don't know where.

Link to comment
Share on other sites

I got this answer from WHMCS:
 

Quote

It would not be possible to prevent the _GetDomainInformation function from being called. Perhaps you could store the response from that call in some way, such as a session or custom database table, which could then be used within your custom function.

I hope that helps. For further assistance customising WHMCS I’d recommend posting on our Developer Corner community where our friendly and knowledgeable community will I’m sure be pleased to assist in this matter: https://whmcs.community/community/41-developer-corner/ .

Regrettably we are unable to assist with customisations/development here as part of product technical support.

If we can assist with any software technical errors, please don’t hesitate to get back in contact.

Unfortunately, that doesn't provide me with an actual answer on why WHMCS forces this function to be run on custom pages.
In fact, why is that function being run in the client area at all? GetDomainInformation doesn't update any information regarding the client's domain at all. If it does, then please tell me what I'm doing wrong 😅

Link to comment
Share on other sites

With the EPP being slow, for some items using a cache might be better.  Save domain info for example to a session variable with a date variable indicating when it was cached.  Then before doing the EPP request, check if cache is available and is recent enough to be used.  If cache is available and recent, then return the data variable held in the cache.  if its to old, then get the info again and save that request to cache for the next time. 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated