=== Site CliniQ ===
Contributors: bilalmahmooddev
Tags: site health, AI, SEO, security, performance
Requires at least: 6.3
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Scans your WordPress site and explains every problem in plain English — PHP errors, SEO issues, broken links, oversized images, and more.

== Description ==

**Site CliniQ** scans your WordPress site for PHP errors, SEO issues, oversized images, missing alt tags, broken links, plugin health issues, and more — then optionally uses AI to explain what is wrong and exactly how to fix it.

No more raw error logs. No more cryptic numbers. Just plain English.

**Core Features (Free)**

* **AI Auto-Fix for Plugin Errors** — Connect your site to a free Site CliniQ account and get up to 5 AI fixes per month. When a plugin causes a PHP fatal error, Site CliniQ asks the AI for a fix, applies it, and keeps your site online.
* **AI Error Diagnosis** — Reads your PHP error log and explains each error in plain English with a step-by-step fix (requires your own Claude API key).
* **Site Health Score** — A–F grade based on PHP version, memory limit, WP version, SSL, debug mode, and more.
* **Plugin Health Checker** — Flags plugins not updated in 2+ years or not tested with your current WordPress version.
* **Plugin Bloat Detector** — Ranks every plugin by JS/CSS payload so you know which one is slowing your site.
* **Update Risk Scorer** — AI reads each plugin changelog and scores the update Safe / Caution / High Risk before you click Update.
* **Image Size Audit** — Finds every image over 500 KB and shows which pages use it.
* **Alt Tag Auditor** — Scans Media Library and post content for missing alt text. Edit and save alt text directly from the plugin.
* **SEO Checks** — Site-wide scan for missing meta descriptions, H1 issues, noindex, thin content, duplicate titles, and more.
* **Broken Link Report** — Crawls up to 100 published URLs and flags 404s, 5xx errors, and long redirect chains.
* **Email Report** — Send a formatted health report to your admin email with one click.

**Source Code**

The full source code including React source files and build tools is available at:
https://bilalmahmood.dev/projects/site-cliniq

Build instructions: run `npm install && npm run build` inside the plugin folder.

**External Services**

This plugin connects to the following external services:

* **Site CliniQ server** (app.sitecliniq.com, run by the plugin author) — Needed to use the plugin: you create a free account the first time you open Site CliniQ, and it provides the AI auto-fix. Data is sent only in these cases:
  * When you connect or reconnect your site: your name, email address, optional phone number, site URL, site title, and the WordPress, PHP and Site CliniQ versions.
  * When you connect and then once a day: the list of your active plugins.
  * When a plugin causes a PHP fatal error: the error message, file path and line, stack trace, plugin name and version, WordPress and PHP versions, and the contents of the file that caused the error. The server returns a suggested fix, and the plugin can deactivate that plugin and apply the fix automatically.
  * When the Site CliniQ server asks your site which Site CliniQ versions are installed. The request must carry your site's API key.
  [Terms of Service](https://sitecliniq.com/terms)
* **Anthropic Claude API** (api.anthropic.com) — Used to generate plain English explanations and fix instructions for detected issues. Optional — the plugin works without it. Requires the user to provide their own API key in Settings. [Terms of Service](https://www.anthropic.com/legal/consumer-terms) | [Privacy Policy](https://www.anthropic.com/legal/privacy)
* **WordPress.org Plugins API** (api.wordpress.org) — Used to fetch plugin info for update risk scoring and plugin health checks. No API key required. [Privacy Policy](https://wordpress.org/about/privacy/)
* **WordPress.org Core API** (api.wordpress.org) — Used to check the latest WordPress version. No API key required. [Privacy Policy](https://wordpress.org/about/privacy/)

== Installation ==

1. Upload the `site-cliniq` folder to `/wp-content/plugins/`
2. Activate the plugin via the Plugins menu
3. Create your free account when asked (one-time connect)
4. Go to **Site CliniQ → Settings** and optionally enter your Claude API key
5. Click **Run Full Scan** on the Dashboard

== Frequently Asked Questions ==

= Do I need a Claude API key? =
No. All scans run without any API key. Adding a Claude API key (optional) unlocks AI-powered plain-English explanations and step-by-step fix instructions. Get a free key at console.anthropic.com.

= Does this work on any host? =
Yes. Site CliniQ works on any WordPress host, including shared hosting, managed WordPress, VPS, and cloud.

= Will this slow my site down? =
No. The plugin only runs when you click "Run Full Scan" from the admin dashboard. Nothing runs on the front end automatically.

= Is my data sent to external servers? =
Yes, to the Site CliniQ server, in the cases listed under External Services (connecting your account, the daily active-plugins list, and PHP fatal errors caused by a plugin). Error messages and plugin names are also sent to the Anthropic Claude API if you add your own API key and run a scan. No personally identifiable visitor data is ever sent.

= Why am I asked to connect after updating? =
Site CliniQ moved to a new server. Open the Site CliniQ page and click **Connect** once. If your site was registered before, your plan and monthly usage are kept.

= How many AI fixes do I get on the free plan? =
5 per month, per site. The count resets at the start of each month.

== Changelog ==

= 1.0.5 =
* New: Sites upgrading from 1.0.4 or older are asked to connect once to the new server.
* New: If the site is not connected to the new server, an error notice with a Connect button appears on the Site CliniQ page. The Connect form is prefilled and checks the connection before it finishes.
* New: Sites registered before the server move are reconnected automatically when they connect again, instead of failing with "already registered".
* New: Site CliniQ can now check which free and Pro versions are installed on your site (authenticated with your site's API key).
* New: Connect errors now show the real HTTP status and server message instead of a generic "Server error".
* Fix: A fatal error that was already emailed today now still reaches the AI auto-fix.
* Change: All server requests now go through one server URL setting.
* Change: The plugin now uses the new Site CliniQ server (app.sitecliniq.com).

= 1.0.3 =
* Fix: Version constant SITECL_VERSION now matches plugin header.
* Fix: Update Risk scan now runs as part of the full site scan.
* Fix: Homepage images now correctly flagged as high SEO impact in alt tag auditor.
* Fix: Email reports now include a plain-text alternative body for clients that can't render HTML.

= 1.0.0 =
* Initial release — full site scanner, AI error diagnosis, health score, plugin health checker, bloat detector, update risk scorer, image audit, alt tag auditor, SEO checks, broken link report, email report.

== Upgrade Notice ==

= 1.0.5 =
Site CliniQ moved to a new server. After updating, open the Site CliniQ page and click Connect once. Your plan and usage are kept.

= 1.0.3 =
Bug fix release — update risk scan, SEO impact scoring, and email plain-text body corrected.

= 1.0.0 =
Initial release.
