=== WebPayesh ===
Contributors: amintnt
Tags: monitoring, health, security, performance, image-optimization
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 2.5.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Smart website guardian for WordPress: health scores, uptime, images, performance, database and WooCommerce checks.

== Description ==

**WebPayesh** (وب‌پایش) is a site-care dashboard for WordPress. It helps agencies and site owners see health, performance risks, image issues, uptime history, and maintenance tasks in one admin screen — with careful, reversible tools where data is changed.

The plugin focuses on **visibility first**, then optional fixes with preview and rollback where applicable.

= Who is it for? =

* Agencies maintaining client sites under a support contract
* Store owners who need a quick WooCommerce health overview
* Admins who want image and speed guidance without installing a full suite of separate tools

== Features ==

* Unified admin dashboard (Persian UI) with health score breakdown
* Contract end date alerts (contract end date and renewal tracking for agencies)
* Configurable support contact channels (phone, WhatsApp, Telegram, etc.) — nothing hard-coded in the UI
* Quick actions log and support/problem tickets for agency workflows
* Predictive warnings (trends, major updates, disk, contract)
* Full report export for clients
* Modular codebase (v2+) under `includes/` and `admin/`

== Health Monitoring ==

* Periodic health checks (cron) covering common failure signals
* Health score categories (performance, security, maintenance, backup, mobile, SEO-oriented signals)
* Active alerts inside the plugin screen (does not strip other plugins’ admin notices)
* Optional email alerts for critical findings
* Website “profile” history: stack info, past issues, support activity

== Performance ==

* Speed checklist with clear done / not-done items aimed at sub-2s goals
* Built-in optional helpers (lazy load, page cache mode, minify/defer toggles) with **Safe Mode**
* Performance diagnosis with root-cause style hints (e.g. slow TTFB, heavy hero image)
* Emergency recovery via short-lived token + confirmation page (no public standalone `recover.php`)
* Guidance when a fix requires the host or another plugin (Redis, CDN, etc.)

== Image Optimization ==

* Media library scan: formats, oversized files, missing ALT
* WebP conversion with **Safe** (sidecar) and **Replace** modes
* Exclude list, selection checkboxes, optional resize to max dimensions
* LCP-oriented controls (preload / no-lazy) for selected attachments
* Before/after savings summary for client reporting
* Rollback paths for optimized attachments where backups exist

**Important:** Always test image tools on a staging copy. Runtime coverage should include JPG, transparent PNG, large images, and non-ASCII filenames.

== WooCommerce ==

When WooCommerce is active, WebPayesh can surface a **WooCommerce Doctor** overview, including signals such as:

* Checkout / cart related health indicators
* Failed orders and Action Scheduler backlog hints
* HPOS / webhooks / email related warnings where detectable

This is diagnostic guidance, not a replacement for WooCommerce’s own status tools.

== Database Doctor ==

Safe-leaning maintenance workflow:

1. Analyze  
2. Preview (tokenized)  
3. Snapshot  
4. Fix  
5. Verify  
6. Rollback (where a snapshot applies)

Supported operations include expired transients, post revisions, conservative “orphan option” *candidates*, and table optimize.

Orphan detection is **heuristic and conservative** (inactive plugin prefixes, never active-plugin prefixes, protected core keys). Always read the preview list before applying a fix.

== Uptime Monitoring ==

* Internal ping / uptime checks on a schedule
* Outage records (start/end) and monthly availability style reporting in the UI
* Manual ping from the admin for verification

This is **not** a substitute for an external multi-region uptime service; it complements on-site monitoring.

== Privacy ==

* **No front-end visitor tracking** in the current public release (traffic module removed from the UI). Use a dedicated analytics plugin if you need visitor statistics.
* Support contact fields are stored as WordPress options and are controlled by the site admin.
* Image optimization may store attachment post meta (e.g. backup paths, WebP paths). On uninstall, **plugin options and that post meta are removed**; generated image files on disk are **kept** so front-end URLs are not broken.
* Recovery tokens are short-lived and single-use.
* The plugin does not require an account on a third-party service to operate the core dashboard.

== Installation ==

1. Upload the `webpayesh` folder to `/wp-content/plugins/`
2. Activate **WebPayesh** through the Plugins screen
3. Open **WebPayesh** in the admin menu
4. Run a health check and (optionally) fill **Contract & support** settings

== Frequently Asked Questions ==

= Does WebPayesh replace my cache / SEO / security plugin? =

No. It monitors and can apply limited performance/image helpers. Redis, CDN, firewalls, and full SEO suites remain separate.

= Why is “Tested up to” not the absolute latest WordPress? =

That field means versions the author has verified. Bump it only after real testing on newer releases (e.g. 7.0 / 7.1).

= Can orphan option cleanup delete another plugin’s settings? =

It only lists conservative *candidates* from inactive plugin-like prefixes, never active-plugin prefixes, with preview + snapshot + rollback. Still review every name before Fix.

= What happens to WebP files if I delete the plugin? =

Database meta used by WebPayesh is removed; media files on disk remain. Clean unused files manually if needed.

= Is visitor data collected? =

Not by the traffic module in this release. It is disabled/removed from the public UI for privacy simplicity.

== Screenshots ==

1. Main dashboard with health score and alerts
2. Performance checklist and diagnosis
3. Image intelligence scan and optimization controls
4. Database Doctor analyze / preview flow
5. Uptime history and availability summary

== Changelog ==

= 2.5.2 =
* Removed debug.log management and wp-config dependency; contract renewal uses manage_options only; CSS prefixes webpayesh-; cleaned uninstall

= 2.5.1 =
* Paired ob_start/ob_get_clean for HTML minify; removed legacy SC_ class_alias; safe-mode option check hardened

= 2.5.0 =
* Review round 2: renamed all short sc_ prefixes to webpayesh_, externalized standalone page CSS, no longer modifies debug.log (copy only to uploads), remaining enqueue fixes

= 2.4.9 =
* WordPress.org review fixes: no wp-config writes, safe-mode as option, uploads for archives, menu position, contributors, escaping, enqueue inline JS, PHP syntax

= 2.4.8 =
* Plugin Check fixes: escaping, sanitization, filesystem notes, Tested up to 7.1
= 2.4.7 =
* Plugin header: removed Plugin URI/Author URI; Requires WP 6.8+ and PHP 8.1+
= 2.4.6 =
* Expanded readme for WordPress.org (features, privacy, FAQ)

= 2.4.5 =
* Support contacts fully configurable; no hard-coded phone/WhatsApp in UI

= 2.4.4 =
* Database Doctor: stricter orphan-option detection

= 2.4.3 =
* Uninstall: delete plugin post meta; keep media files on disk (documented)

= 2.4.2 =
* i18n: text domain loaders; menu/nav and access errors wrapped

= 2.4.1 =
* Text Domain `webpayesh`; Domain Path `/languages`

= 2.4.0 =
* Traffic monitor removed from public UI (privacy)

= 2.3.9 =
* Recovery: removed public recover.php; short-lived token + confirmation endpoint

= 2.3.8 =
* readme Tags limited to 5

= 2.3.7 =
* Stop suppressing core/other plugins admin notices on plugin screen

= 2.3.0 =
* Modular architecture under includes/ and admin/

= 1.23.1 =
* Plugin Check header and sanitization fixes

== Upgrade Notice ==

= 2.5.2 =
* No debug.log management; no wp-config dependency for contracts.
= 2.5.1 =
* HTML minify buffer explicitly closed; legacy class alias removed.
= 2.5.0 =
* Prefix rename (webpayesh_), no debug.log modification, external CSS for standalone pages.
= 2.4.9 =
* Review compliance: safe mode uses options, debug guidance is manual-only, menu position adjusted.
= 2.4.8 =
* Plugin Check fixes: escaping, sanitization, filesystem notes, Tested up to 7.1
= 2.4.7 =
* Plugin header: removed Plugin URI/Author URI; Requires WP 6.8+ and PHP 8.1+
= 2.4.6 =
Documentation and privacy/support clarity for public distribution. Review Database Doctor previews and test image tools on staging before bulk use.
