=== 404ops SSL Monitor ===
Contributors: spwhite
Tags: ssl, tls, certificate, https, security
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.15.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Monitor your site's SSL/TLS certificate, expiry, and protocol support with a clear security grade.

== Description ==
SSL Monitor checks your site's certificate (issuer, expiry, SANs), the TLS protocol versions and cipher suites it accepts, and gives you a plain green/amber/red grade, right in your WordPress dashboard.

* On-demand certificate check with a green/amber/red grade, and a cipher scan with strong/weak/insecure ratings folded into it.
* Scheduled checks via wp-cron, with the interval, history retention and warning days you choose.
* Many endpoints from the Endpoints tab, including mail servers over STARTTLS (SMTP, IMAP, POP3).
* Alerts before a certificate expires, when the grade drops, on cipher drift and when an endpoint becomes unreachable: by email, and optionally to Slack, Microsoft Teams, Discord or a signed webhook.
* Retry settings for chat and webhook alerts: 1 to 10 delivery attempts and up to 10 waits of 30 to 86,400 seconds. Defaults are 4 attempts and waits of 60, 300 and 1800 seconds; configure them under Endpoints > Settings > Alert tuning. No add-on is needed.
* A notice across wp-admin while a certificate needs attention, a dashboard widget and a shortcode.
* Check history with trend charts.
* Site-wide mixed-content scan, with optional fixes for your own domain.
* Optional domain registration expiry (RDAP, with an opt-in WHOIS fallback for registries without RDAP) and an alert when a domain's transfer lock is removed.
* HSTS, security-header and CAA checks, an optional Certificate Transparency watch, and "Explain & fix" with your own AI provider.
* Multisite network monitoring and an agency fleet of many client sites, each with health-over-time charts.

Everything listed here is part of SSL Monitor itself. Outside services are contacted only when you switch them on; see External services.

== Installation ==
1. Upload the plugin through `Plugins > Add New > Upload Plugin`, or copy the folder to `wp-content/plugins/`.
2. Activate SSL Monitor through the `Plugins` screen.
3. Open `SSL Monitor` in the admin menu and run a check on your site.

On a single site, use the usual WordPress uninstall action. On multisite, follow the coordinated removal instructions and download the version-matched tool from the [SSL Monitor product page](https://404ops.com/plugins/ssl-monitor). If both versions are installed, remove Pro before Free.

== Frequently Asked Questions ==

= Where can I get help? =
Visit https://supportminer.404ops.com to open a support request.

= Which site does it check? =
It checks the site it is installed on — the certificate, TLS protocol support, and cipher strength of your own domain.

= How is the security grade calculated? =
The grade combines certificate validity and time-to-expiry with the TLS protocol versions and cipher strength the endpoint negotiates. A soon-to-expire certificate or weak/insecure protocol support lowers the grade.

= Does it send my data anywhere? =
Checks themselves run from your server directly against your endpoint, and results are stored in your own WordPress database. If you turn on a webhook, Slack, Microsoft Teams or Discord alert channel under Settings > Alert channels, this plugin also sends alert summaries to the address you configure there. The optional domain registration lookups (RDAP, and WHOIS if you also allow it), Certificate Transparency watch (Cert Spotter) and AI explanations also contact outside services only when you switch them on. See External services below. The endpoint URL and shared secret you enter for each channel are encrypted at rest, using a key derived from your site's own secret salts, before they are ever stored.

= Does the mixed-content check look at more than my homepage? =
Yes. Each scheduled sweep also samples up to 20 of your site's own public URLs — the home page, your 10 most recently published posts and pages, and a spread of other public post types — and records how many insecure http:// references (images, scripts, stylesheets, and similar) each one carries, with up to 10 examples per URL. See the "Site-wide mixed content" section of the SSL Monitor screen.

= Can it fix mixed content automatically? =
Optionally, and both options default off. "Upgrade insecure references to this site on HTTPS pages" rewrites http://<your own domain> references — in post content, excerpts, widget text, attachment URLs, and enqueued scripts/styles — to https://, but only on an HTTPS request and only for your own domain; it never touches another site's URLs, and it never changes what is stored in your database. "Send Upgrade-Insecure-Requests" instead adds a `Content-Security-Policy: upgrade-insecure-requests` header, asking the visitor's browser to upgrade every insecure request the page makes, including to other domains; it is skipped whenever your site already sends its own Content-Security-Policy header.

= What about http:// references already stored in my database? =
The "Database report" section shows a read-only count of posts whose stored content still contains an insecure http:// reference to your own site. SSL Monitor does not rewrite your database — for bulk updates, see WP-CLI's own search-replace command: https://developer.wordpress.org/cli/commands/search-replace/

== External services ==

Certificate and cipher checks make no external requests of their own: they run directly from your server against the endpoint you tell them to check, and results stay in your own WordPress database.

This plugin optionally contacts services you configure yourself, and only the ones you switch on under Settings > Alert channels:

* **Generic webhook.** If you enable it and supply an HTTPS URL, each alert (a certificate nearing or past expiry, a security-grade drop, new weak/insecure ciphers, or an endpoint going unreachable) is posted there as JSON: the endpoint's hostname and port, its current status, days remaining until certificate expiry (when known), and a short description of the alert. If you also set a shared secret, the request carries an `X-SSL-Monitor-Signature` header so the receiving end can verify it came from this site.
* **Slack.** If you enable it and supply a Slack incoming-webhook URL, the same information is posted to the channel that webhook belongs to. Data sent this way is handled under Slack's [terms of service](https://slack.com/terms-of-service) and [privacy policy](https://slack.com/trust/privacy/privacy-policy).
* **Microsoft Teams.** If you enable it and supply a Teams incoming-webhook URL, the same information is posted there as an Adaptive Card. Data sent this way is handled under Microsoft's own terms and privacy policy for the connector you configured.
* **Discord.** If you enable it and supply a Discord webhook URL, the same information is posted to that channel. Data sent this way is handled under Discord's own terms and privacy policy.

Each channel's "Send test alert" button posts a clearly labelled test payload to that channel's URL so you can confirm it is wired up correctly, without waiting for a real alert.

Only endpoints you configure are ever contacted, none are contacted until you switch a channel on, and http:// addresses are refused — every request requires https://. The three URLs and the webhook's shared secret are encrypted at rest, using a key derived from your site's own secret salts, so a database backup or export does not hand over a working webhook URL or the ability to forge a signed payload.

**AI explanations (optional).** When an administrator presses "Explain & fix with AI" on the Status tab or "Explain" for an endpoint, the [WordPress AI Client](https://make.wordpress.org/core/2026/03/24/introducing-the-ai-client-in-wordpress-7-0/) sends the target host, grade and reasons, certificate expiry, endpoint reachability, weak cipher ratings, and mixed-content resource locations from stored findings. Resource locations include the scheme, host, port and path. User information, query strings and fragments are omitted. Review the displayed findings before pressing the button. The request uses that snapshot even if a new scan finishes before the request.

WordPress chooses a compatible provider from Settings > Connectors, and that choice can change. A provider and model compatible with text generation, system instructions, and the requested token limit are required. Existing 404ops AI Connection credentials stay saved for other plugins. Configure a provider through WordPress Connectors for SSL Monitor. Endpoint explanations cached by an older version need to be requested again.

**Your own pages.** The mixed-content check fetches a sample of your own site's public pages from your server, to look for http:// resources. No other site is contacted for this.

**Domain registration lookups (RDAP).** Separately from the alert channels, and also off by default: if you turn on "Check when each monitored domain's registration expires" under Settings > Domain registration, this plugin fetches IANA's public list of domain registries from https://data.iana.org/rdap/dns.json (at most once a day), then asks the registry responsible for each registered domain behind your endpoints for that domain's public registration record (at most once per domain per day) to read its expiry date. Only the domain name is sent; the request does not identify your site. IANA's services are provided under ICANN's [privacy policy](https://www.icann.org/en/data-protection/privacy-policy); each registry's RDAP service is operated under that registry's own terms.

**Domain registration lookups over WHOIS (port 43).** Off by default, and only available with the RDAP lookups above switched on: if you also tick "Ask the registry's WHOIS server when it offers no RDAP lookup", then for a domain whose registry has no RDAP service this plugin asks IANA's WHOIS server (whois.iana.org) which WHOIS server serves that domain's top-level domain (only the top-level domain, such as "de", is sent; at most once a week per top-level domain), then asks that registry's WHOIS server, named by IANA, for the domain's public record (only the domain name is sent; at most once per domain per day, and at most 10 queries to any one server per hour). WHOIS is not encrypted. The same answers (RDAP or WHOIS) also give the domain's transfer lock, which needs no extra request. IANA's services are provided under ICANN's [privacy policy](https://www.icann.org/en/data-protection/privacy-policy); each registry's WHOIS service is operated under that registry's own terms.

**Certificate Transparency watch (Cert Spotter).** Also off by default: if you turn on "Alert when a new certificate is issued for a monitored domain" under Settings > Certificate Transparency, this plugin asks Cert Spotter (api.certspotter.com, operated by SSLMate) which publicly logged certificates exist for each registered domain behind your endpoints, every few hours (at most six-hourly per domain). Only the domain name is sent, over HTTPS, to public addresses only, with no redirects followed; the answer is public Certificate Transparency log data, and the request does not identify your site. Cert Spotter's service is provided under SSLMate's [terms of service](https://sslmate.com/terms) and [privacy policy](https://sslmate.com/privacy).

Review the terms and privacy policy of each AI provider configured in WordPress Connectors. The official provider plugins can connect to OpenAI ([service agreement](https://openai.com/policies/services-agreement/), [privacy policy](https://openai.com/policies/privacy-policy/)), Anthropic ([commercial terms](https://www.anthropic.com/legal/commercial-terms), [privacy policy](https://www.anthropic.com/legal/privacy)), or Google Gemini ([API terms](https://ai.google.dev/gemini-api/terms), [privacy policy](https://policies.google.com/privacy)). Other connectors use the policies of their service operators.

Channel provider policy references: Microsoft Teams uses the [Microsoft 365 product terms](https://www.microsoft.com/licensing/terms/productoffering/Microsoft365/all) and [Microsoft privacy statement](https://www.microsoft.com/en-us/privacy/privacystatement); review the agreement for the account and connector you configure. Discord provides its [terms of service](https://discord.com/terms) and [privacy policy](https://discord.com/privacy).

== Screenshots ==
1. The SSL Monitor dashboard shows the certificate grade and days until expiry.
2. Review the findings before requesting an AI explanation through WordPress Connectors.
3. Saved cipher results show ratings for supported TLS 1.2 and earlier suites.

== Upgrade Notice ==

= 1.15.0 =
Configure AI in Settings > Connectors. Use the matched removal tool for multisite. Before upgrading, let pending network alerts finish during a maintenance window with no site moves. This release skips earlier retries that lack verified site and network identifiers.

= 1.14.6 =
Includes five bundled draft translations. Human linguistic review is separate.

= 1.14.5 =
Improves release packaging. Monitoring behavior is unchanged.

= 1.14.1 =
Removes links that no longer work from the External services section. Text only; safe to update.

= 1.14.0 =
Adds an opt-in WHOIS fallback for domain expiry, transfer-lock alerts and fleet/network health charts. Safe to update.

= 1.13.2 =
Readme-only update. No code change.

= 1.12.2 =
Now requires WordPress 7.0 or newer and is tested up to 7.1. Safe to update.

= 1.12.0 =
Adds a web hardening audit (HSTS, security headers, CAA) to the Endpoints tab. Safe to update.

= 1.11.0 =
Adds an optional Certificate Transparency watch (off by default). Safe to update.

== Changelog ==

= 1.15.0 =
* Use the WordPress AI Client for requested explanations. Configure an AI provider in Settings > Connectors before use.
* Use the version-matched removal tool to remove SSL Monitor on multisite.
* Recheck site ownership before sending network domain alerts and preserve the alert baseline when another eligible site takes over. New network channel retries follow the original network and site.

= 1.14.7 =
* Updated: delivery retry attempts and backoff settings are included in Free, with the same defaults and absolute bounds.
* Updated: bundled shared AI client 0.4.3 with hardened connection nonce handling.
* Fixed: normalize custom Fleet, network and site action nonces before verification.

= 1.14.6 =
* Added: permission-checked, read-only stored monitoring status.
* Added: bundled Spanish, German, Japanese, French and Brazilian Portuguese draft translations, with normal WordPress loading and checked catalog files.

= 1.14.5 =
* Fixed: release helpers preserve unrelated archives during packaging.

= 1.14.4 =
* Changed: internal clean-up of database queries (table names are bound as identifiers); no change in behaviour.

= 1.14.3 =
* Changed: folder, main file and text domain renamed to match the plugin name (404ops-ssl-monitor).

= 1.14.2 =
* Updated the licence client (0.3.5): Pro keeps working after a licence expires.

= 1.14.1 =
* Fixed: removed dead links (updated the IANA privacy policy link).

= 1.14.0 =
* New: an opt-in WHOIS (port 43) fallback for domain registration expiry when a registry offers no RDAP lookup. IANA is asked about the top-level domain only; at most 10 queries per WHOIS server per hour; ambiguous dates are refused, never guessed.
* New: an alert when a monitored domain's transfer lock is removed, read from the registry's RDAP or WHOIS status at no extra request. The Domain registration column shows the lock.
* New: health-over-time charts on the Fleet tab (per client) and the Network Admin screen.
* New: an extension point for add-on sections on the Network Admin screen.

= 1.13.3 =
* Updated the bundled licence client to 0.3.4.

= 1.13.2 =
* Readme: the description states that multi-endpoint and STARTTLS (SMTP, IMAP, POP3) monitoring are included in the free plugin, replacing a stale note. No code change.

= 1.13.1 =
* Pro update packages now publish with maintenance information and one shared licence client version.

= 1.13.0 =
* Added the Pro add-on extension points and refreshed wording.

= 1.12.6 =
* Admin menu labels and page headings drop the 404ops brand prefix; the generated Composer loader is hardened for Plugin Check.

= 1.12.5 =
* Plugin URI points to the 404ops.com plugins page.

= 1.12.4 =
* Fixed: WordPress.org listing corrections. The External services section now names the Discord channel, the optional AI explanations and the mixed-content check of your own pages, and the changelog is shortened. No runtime behaviour change.

= 1.12.3 =
* Changed: Bundled libraries updated; translatable strings now use this plugin's text domain.

= 1.12.2 =
* Requires WordPress 7.0 or newer (it was 6.9); tested up to WordPress 7.1.

= 1.12.1 =
* Requires WordPress 6.9 or newer (it was 6.3); tested up to WordPress 7.1.

= 1.12.0 =
* New: web hardening audit. For each HTTPS endpoint on port 443, the Endpoints tab shows whether HTTP Strict Transport Security (HSTS) is enabled.

= 1.11.0 =
* New: Certificate Transparency watch. Optionally alerts when a new certificate is issued for a registered domain behind your endpoints. Those alerts also go to Slack, Teams, Discord and webhook channels.
