WHMCS module
The stillorigin WHMCS module lets you sell Website protection as a product in WHMCS. When a client's order is set up, the module turns on Website protection for their domain in your stillorigin account. Your client then gets a Manage protection button that signs them in to their site's owner area.
The module is free and open source (MIT licence).
What the module does
| In WHMCS | What happens in stillorigin |
|---|---|
| Create (the order is set up) | The module finds the service's domain in your stillorigin account and turns Website protection on. Turning Website protection on always starts the domain in log mode. If Website protection is already on, nothing changes. |
| Suspend | Turns Website protection off, unless the product's On suspend setting is Leave Website protection on. |
| Unsuspend | Turns Website protection back on, in the same mode the domain had before it was suspended (log mode or blocking). With Leave Website protection on, nothing changes, because Website protection was never turned off. |
| Terminate | Turns Website protection off. The domain stays in stillorigin with Network protection, and the owner's settings are kept. |
| Change package (upgrade or downgrade) | Nothing changes. |
| Manage protection (client area, and the admin service page) | Creates a one-time sign-in link to the owner area when pressed, and opens it in a new tab. |
The module never adds or removes domains in stillorigin. It only turns Website protection on and off for domains that are already in your account. Running a step twice is safe: if Website protection is already on, Create succeeds and changes nothing.
Changes the module makes show in your audit log as made by API key. The cluster's sentries pick each change up within a minute.
Before you start
You need:
- WHMCS 8, on PHP 7.4 to 8.3 with the curl extension;
- your WHMCS server able to make HTTPS connections to
control.stillorigin.app; - your stillorigin account's API key. Only an account owner can create it, under My account › API key (see Your API key);
- each client's domain already added to stillorigin, by hand on Domains or from the Not protected yet list on the origin server's page;
- a free Website protection licence for each domain: the Website protection licence included with each licensed sentry, or an Website protection licence.
Before you sell the product, choose what your clients can change and set your support link on Owner access. See Domain owner access. Every permission is off by default, so until you allow something, clients can only view their site's protection.
1. Install the module
-
Download the stillorigin WHMCS module. Its files are in a folder called
modules/servers/stillorigin. -
Upload the
stilloriginfolder to your WHMCS server'smodules/servers/folder, using SFTP or your control panel's file manager. -
Check the path. You should now have:
<your WHMCS folder>/modules/servers/stillorigin/stillorigin.php
The folder name must stay stillorigin, all in lowercase.
2. Add stillorigin as a server
-
In the stillorigin portal, open My account from the menu at the bottom of the sidebar, then API key. Have your API key ready. stillorigin shows it only once, when it's created, so take it from your password manager. If you don't have it, an account owner can create a new one, but then your sentries need the new key too (see Your API key).
-
In WHMCS, go to Configuration › System Settings › Servers and click Add New Server.
-
Fill in:
Field What to enter Module stillorigin Name Any name you'll recognise, for example stilloriginHostname control.stillorigin.appPassword Your stillorigin API key Enter the hostname exactly like that, without
https://. WHMCS needs a hostname or an IP address for every server: if you leave both empty, saving the server fails with The Hostname or IP Address format is invalid.Leave the other fields empty, including IP Address. The module doesn't use a username.
-
Click Test Connection. It should succeed. If it doesn't, see Troubleshooting.
-
Save the server.
Anyone with your API key can turn Website protection on and off for your domains and create owner sign-in links for any Website protection domain in your account. Keep it only in the server's Password field. Never paste it into a ticket, an email or a product description.
If you later create a new API key in stillorigin, put it in this server's Password field too. If you ticked Keep the old key working for 7 days, the old key keeps working until then.
3. Set up the product
- In WHMCS, go to Configuration › System Settings › Products/Services and click Create a New Product.
- Choose product type Other, a product group and a name, for example Site protection. Set the module up as its own Other product, not as a product addon (see below).
- On the Details tab, tick Require Domain, so the order asks for the domain to protect.
- On the Module Settings tab, choose stillorigin as the module. If you've put your stillorigin server in a server group, choose that group.
- Choose the On suspend setting (see below).
- Choose when WHMCS sets the product up: as soon as the order is placed, when payment is received, when you accept the order, or never (you press Create yourself).
- Set your pricing on the Pricing tab, and save.
On suspend
On suspend decides what happens to Website protection when this service is suspended. Unsuspending turns it back on.
- Turn Website protection off (the default): Website protection is turned off when the service is suspended. This frees the domain's Website protection licence for another domain. The domain keeps its Network protection.
- Leave Website protection on: suspending the service in WHMCS doesn't change anything in stillorigin.
With Turn Website protection off, Unsuspend turns Website protection on again, in the same mode the domain had before it was suspended: log mode or blocking.
With Turn Website protection off, the domain's Website protection licence is free while the service is suspended. If you use it for another domain in the meantime, Unsuspend fails until a place is free again.
Product addons aren't supported yet
Set the module up as an Other product, as above. Don't set it up as a product addon to a hosting plan: product addons aren't supported yet, and the Manage protection button doesn't show on an addon. To offer protection alongside your hosting plans, use WHMCS's own upsell or cross-sell options for the Other product instead.
4. Test it
- Pick a domain that's already in stillorigin with Website protection off.
- Place a test order for the product with that domain, or add the service to a client by hand and click Create on the service page.
- In the stillorigin portal, open Domains. Website protection should now be on for that domain, in log mode.
- On the service page in WHMCS, check the fields the module shows, then click Manage protection to open the owner area as your client will see it.
What your clients see
The module replaces WHMCS's standard product page with a stillorigin page for the service. It fits WHMCS's default Twenty-One theme, and uses plain Bootstrap so it works with most other themes. It shows:
- the domain, and the service's status (Active, Pending, Suspended, Terminated or Cancelled);
- the Manage protection button, with the note Opens your site's protection dashboard in a new tab.;
- Protection: Website protection or Network protection, with a one-line explanation;
- with Website protection, the Website protection mode (Log mode or Blocking) and Browser checks (Every visitor is checked (Under Attack), Checks some visitors or Off);
- Last 24 hours: requests allowed and blocked, and browser checks passed and failed when Captcha Protection is checking visitors, with how long ago the figures were updated;
- Top block reasons: up to 3 reasons with how many requests each blocked, or Nothing was blocked in the last 24 hours.;
- Billing: the product, sign-up date, amounts, billing cycle, next due date and payment method, and WHMCS's Request Cancellation button when you allow cancellations.
Everything except the button is read-only. The figures are kept in WHMCS for 10 minutes, so stillorigin is asked at most once every 10 minutes for each service, however often the page is opened. If stillorigin can't be reached, your client sees the last figures with We couldn't refresh these figures just now, so they may be out of date., or Protection details aren't available right now. Please check back soon. if there are none yet. While the service is suspended, they see This service is suspended. Contact us if you need help., and while it's pending, This service is being set up. Protection details will show here once it's active. Suspending, unsuspending, creating or terminating the service clears the kept figures, so the page shows the change straight away.
The module keeps the figures in its own table in your WHMCS database, mod_stillorigin_summary, which it creates the first time a client opens the page. It holds only the summary, never your API key or sign-in links.
When your client clicks Manage protection, WHMCS asks stillorigin for a one-time sign-in link and opens the owner area for that one domain in a new tab. The link is only created when they click, works once, and expires after 5 minutes. They can click the button again at any time to get a new one.
In the owner area they see Overview, Traffic, Blocks, Protection, Countries and Settings, and can change only the settings you allow on the Settings tab (the same permissions as on Owner access). The owner area is stillorigin-branded, but stillorigin doesn't offer support to domain owners. Your clients get help from you, through the Get help from your host link you set. See What domain owners see.
- The button only shows while the service is Active and the domain has Website protection. It's hidden while the service is suspended or terminated, and for a domain with Network protection only.
- If Website protection isn't on for the domain, your client sees: Protection isn't turned on for this domain yet, so there's nothing to manage.
- If anything else goes wrong, your client sees: Protection settings aren't available right now. Try again later. You'll find the reason in the WHMCS module log (see Troubleshooting).
- In WHMCS, users on a client's account need the Perform Single Sign-On permission to use the button. This is a WHMCS setting.
Owner sign-ins appear in your stillorigin audit log as domain owner via API key (current).
What you see in the admin area
On the service's page in the WHMCS admin area, the module shows:
| Field | What it shows |
|---|---|
| stillorigin domain ID | The domain's number in stillorigin. It's the same number as in the domain's page address in the portal (/domains/2050). If the module can't find the domain, it shows Not found in stillorigin, or the reason it couldn't check. |
| Website protection | Off, On, log mode (rules only record what they would block) or On, blocking. |
| Test owner login | Use the Manage protection button to open the owner area for this domain, as your client sees it. Each link works once. |
| stillorigin module | The module's version, and Up to date, or Update available with links to what's new and the download when a newer version is out. Security updates are marked Security update. The module checks at most once every 10 minutes, only when you open this tab. See Updates. |
The admin area has the same Manage protection button. Use it to check what your client sees. Changes you make in the owner area apply to the live site. Whether an admin can use the button is controlled in WHMCS, under the server's single sign-on access control.
How the module remembers the domain
The first time the module finds a service's domain, it keeps the stillorigin domain ID on the service, in an admin-only custom field called stillorigin domain id. Later steps use that ID. So if you rename the service's domain in WHMCS, protection doesn't move to another domain.
The module looks a domain up by name with or without www., so www.example.com on the order finds example.com in stillorigin, and the other way round.
Updating the module
The module never updates itself. When the admin service tab or your portal dashboard shows Update available, download the latest zip from https://control.stillorigin.app/downloads/stillorigin-whmcs.zip and extract it over your WHMCS folder. Your server settings, products and services are kept. See Updates and the changelog.
Troubleshooting
The module writes each call to the WHMCS module log (Configuration › System Logs › Module Log, once module logging is turned on). Your API key is always masked there, and sign-in links are never logged.
| Message | What to do |
|---|---|
| This service has no domain set. Add the domain to the service, then try again. | Enter the domain on the service in WHMCS, then press Create again. Tick Require Domain on the product so new orders always have one. |
| stillorigin has no domain called example.com in your account. Add it to stillorigin first (for example from the origin server's Not protected yet list), then try again. | Add the domain in the portal, on Domains or from Not protected yet, then press Create again. Check the spelling, and that it's in the same stillorigin account as the API key. |
| There's no free Website protection licence in your stillorigin account for example.com. Add a licensed sentry or buy a Website protection licence, then try again. | Every Website protection licence is in use. Turn Website protection off for a domain you no longer need, add a licensed sentry, or buy an Website protection licence, then try again. Nothing was changed. |
| Protection isn't turned on for this domain yet, so there's nothing to manage. | Website protection is off for the domain, so it has no owner area. Press Create (or Unsuspend) on the service, or turn Website protection on in the portal. |
| stillorigin didn't accept the API key. Put your account API key (My account > API key in the stillorigin portal) in this server's Password field. | The Password on the WHMCS server is wrong, empty, an old key, or an origin agent key. Put your account API key there, then click Test Connection. |
| Your stillorigin account is closed. | The API key belongs to a closed account. See Closing an account. |
| Too many requests to stillorigin. Try again in a minute. | More than 120 requests in a minute. Wait a minute and try again. |
| Couldn't reach stillorigin at https://control.stillorigin.app: ... | Your WHMCS server couldn't connect. Check that it can make outgoing HTTPS connections to control.stillorigin.app, and that the server's Hostname is control.stillorigin.app (with IP Address empty). The text after the colon is the connection error. |
| stillorigin returned an unexpected response (HTTP 404). (or another number) | Usually the server's Hostname (or IP Address) is wrong. Set Hostname to control.stillorigin.app, leave IP Address empty, then click Test Connection. |
| The Hostname or IP Address format is invalid (when you save the server) | WHMCS needs a hostname. Enter control.stillorigin.app in Hostname, then save. |
| Not found in stillorigin (admin service page) | The domain isn't in your stillorigin account under that name, or was removed. Add it, then press Create. |
| Unsuspend fails with There's no free Website protection licence... | The domain's place was used while the service was suspended. Free a place or add a licence, then press Unsuspend again. |
A domain that has been removed from stillorigin doesn't stop Suspend or Terminate: there's nothing left to turn off, so the step succeeds.
Using the API yourself
The module uses the stillorigin API with your account API key. If you use another billing system or CRM, Build your own integration walks through the same flow, including creating owner sign-in links.
If your clients use cPanel, the cPanel plugin gives them a Manage protection page in cPanel too.