# SEO.ro Domain Audit for WHMCS

WHMCS addon module that audits purchased domains with SEO.ro.

## What it does

- Adds an Admin Area addon page: `Addons > SEO.ro Domain Audit`.
- Lists domains from WHMCS `tbldomains`.
- Runs SEO.ro audits for one domain or a batch of active domains.
- Stores the latest score and raw SEO.ro JSON in `mod_seoro_domain_audits`.
- Shows score, checks returned, failed checks, and last audit date.

## Install

1. Copy this folder:

   `modules/addons/seoro_domain_audit`

   into your WHMCS installation:

   `WHMCS_ROOT/modules/addons/seoro_domain_audit`

2. In WHMCS Admin, go to:

   `Configuration > System Settings > Addon Modules`

3. Activate `SEO.ro Domain Audit`.

4. Click `Configure`, select admin roles, and set:

   - SEO.ro API URL: `https://www.seo.ro/api/seo-audit.php`
   - SEO.ro API Key: optional, but recommended
   - Default Keyword: optional
   - Request Timeout: recommended `90`

## API key protection

On SEO.ro, set this in `.env`:

```env
SEO_RO_PUBLIC_API_KEY=put-a-long-random-key-here
```

Then put the same value in WHMCS module setting `SEO.ro API Key`.

When this key is set, `https://www.seo.ro/api/seo-audit.php` requires:

```http
X-SEO-RO-API-Key: put-a-long-random-key-here
```

5. Open:

   `Addons > SEO.ro Domain Audit`

## Notes

- Full SEO.ro audits can take time because all checks are enabled, including mobile snapshots and Core Web Vitals.
- Bulk audit has a limit field. Start with 5-10 domains to avoid long admin requests.
- Deactivating the addon does not delete audit history.

## Files

- Main module: `modules/addons/seoro_domain_audit/seoro_domain_audit.php`
