Jump to content

Typos in add_hook() names fail silently: how I stopped losing hours to them


Recommended Posts

A misspelled hook name in add_hook('ClientAddd', ...) never fires and WHMCS logs nothing. Same for a wrong key in $vars['...'] or a required localAPI parameter you forgot: you only find out at runtime, usually in production.

I got tired of it and built a PhpStorm plugin that knows the WHMCS hook list and API reference:

  • completes the 334 hook names (with what each one does) and the $vars keys inside the closure
  • completes the localAPI commands and parameters, and underlines calls missing a required parameter
  • underlines unknown hook names and misspelled keys, with Alt+Enter to fix
  • live templates (whhook, whapi, whmodule, whaddon...) for hooks and provisioning modules

It is called WHMCS Toolkit, paid after a 30-day trial, PhpStorm / IntelliJ Ultimate: https://plugins.jetbrains.com/plugin/35775-whmcs-toolkit

The worked examples (hook, provisioning module, addon, registrar) are in the public repo, no purchase needed: https://github.com/Design-Master-Agencia-Digital/whmcs-toolkit

Happy to hear which hooks or API commands trip you up the most.

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