=== ZERTI ===
Contributors: zerti
Author: ZERTI
Email: admin@zerti.shop
Tags: woocommerce, admin, orders, inventory, reports
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 2.0.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

English-first WooCommerce back-office with worldwide language support, RTL/LTR layouts, and branded PDF invoices.

== Description ==

ZERTI is a full-screen WooCommerce administration panel inside WordPress `wp-admin`. It gives store operators one place to manage orders, inventory, customers, finance, and reports—without replacing the public storefront.

The UI is **English by default** and ships with translation files for multiple admin languages. Regional settings control UI language, text direction, calendar system, and digit formatting so merchants worldwide can work in a familiar locale.

**Main areas**

* **Home** — sales dashboard, Chart.js charts, cached WooCommerce aggregates
* **Orders** — AG Grid list, filters, order detail, invoice view, status updates, print, PDF downloads
* **Inventory** — products, editor (Quill), categories, tags, brands, attributes, attribute groups, import/export, reviews
* **Finance** — payments, coupons, sales report
* **Reports** — sales report (free), standard reports and BI analytics (Pro)
* **Customer affairs** — customers, product reviews, comments
* **Bulk Action** — bulk price, stock, and delete tools (Pro)
* **Settings** — store identity, logo, invoices, regional options, visual themes, license

**Internationalization**

* Admin UI languages: English, Persian, Arabic, French, Spanish, Turkish, Dutch, Hindi, Thai, Chinese (bundled `.mo` files in `languages/`)
* Follow WordPress site language or pick a dedicated ZERTI UI language in Settings
* Automatic LTR/RTL layout from locale
* Calendars: Gregorian, Jalali (Persian), Hijri (Arabic)
* Digit formats: Western, Persian, Arabic, Devanagari, Thai (automatic or manual)

**PDFs & printing**

Server-generated PDFs (invoice, postal label, warehouse sheet) via mPDF and Dompdf. Browser print templates are also available.

**Themes & appearance**

* Dark / light mode toggle in the sidebar
* Visual themes: Zerti (default) and customizable rabbitMP
* Bootstrap-based responsive admin shell with AG Grid data tables

**Other**

* Global search across orders, customers, and products
* HPOS-compatible order queries
* REST API (`zerti/v1`) and AJAX for grids and actions

**Free vs Pro**

The free plugin covers daily shop, inventory, finance, and sales-report work. [ZERTI Pro](https://zerti.shop) (optional license) unlocks list/Excel exports, bulk actions, standard reports, BI reports with Excel export, and order creation from the panel.

**External services**

This plugin may contact external services only in the cases below. Core store operations (orders, inventory, reports) run on your server and do not require outbound connectivity.

* **ZERTI Pro license server** (`https://license.zerti.shop`) — Used when you enter or validate a Pro license key. Sends your license key, site URL (domain), plugin version, WordPress version, and PHP version. No customer orders or payment data are transmitted. [Terms of use](https://zerti.shop/terms/), [privacy policy](https://zerti.shop/privacy-policy/).

* **Gravatar** (`https://gravatar.com`) — Used on the customer detail screen to display the customer avatar via WordPress `get_avatar_url()`. Sends an MD5 hash of the customer email address when that view is opened. [Automattic terms](https://wordpress.com/tos/), [privacy policy](https://automattic.com/privacy/).

* **Google Maps** (`https://www.google.com/maps`) — Optional. When “Show customer location on Google Maps” is enabled under Settings → Postal label PDF, order geolocation coordinates (latitude and longitude, when available from the order) are included in a link to Google Maps on the order detail view and postal PDF. The browser or PDF reader opens that link; ZERTI does not send order data to Google except through that user-initiated URL. [Google terms](https://policies.google.com/terms), [privacy policy](https://policies.google.com/privacy).

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via the WordPress Plugins screen.
2. Ensure **WooCommerce** is installed and active.
3. If `vendor/` is not included, run `composer install --no-dev --optimize-autoloader` on PHP 7.4+.
4. Activate the plugin through the **Plugins** menu.
5. Open **ZERTI** from the admin menu and complete **Settings** (identity, regional language, logo, invoices).

**Requirements**

* WordPress 6.0+
* WooCommerce (active)
* PHP 7.4+ with `mysqli`, `mbstring`, `json`, `dom`, `gd`, and `zlib`
* Writable `wp-content/uploads/` (PDF temp files)

== Frequently Asked Questions ==

= Does ZERTI replace WooCommerce? =

No. ZERTI is an alternative admin UI. WooCommerce remains required for cart, checkout, and storefront behavior.

= Which language does ZERTI use? =

English is the source language. Choose **ZERTI UI language** under Settings → Regional Settings, or leave it on **Site default** to follow WordPress. Drop additional `zerti-{locale}.mo` files into the plugin `languages/` folder to extend translations.

= Does ZERTI support RTL languages? =

Yes. Arabic and Persian (and other RTL locales) switch the admin panel to RTL automatically, including Bootstrap RTL styles when needed.

= Is an internet connection required? =

Core features work without ongoing connectivity. Pro license activation and periodic validation require outbound HTTPS to `https://license.zerti.shop`.

= Which PDF engine is used? =

Invoices and related documents are generated on the server with mPDF and/or Dompdf (bundled in `vendor/`).

= Is HPOS supported? =

Yes. ZERTI supports WooCommerce High-Performance Order Storage and legacy order storage.

== Screenshots ==

1. ZERTI admin home dashboard
2. Orders grid and order detail
3. PDF invoice
4. Inventory product editor
5. Settings, regional language, and themes

== Changelog ==

= 2.0.5 =
* Fix: product add/edit editor failed to load in the inventory panel

= 2.0.4 =
* Pro add-on: unlock Pro panels immediately after license activation without a full page refresh

= 2.0.3 =
* Pro add-on: unlicensed clicks on Bulk Action, Standard reports, BI reports, and New order open Settings license tab

= 2.0.2 =
* Fix: Pro component template paths when ZERTI Pro add-on is active
* Pro preview and Get Pro badge clicks open Settings license tab when unlicensed (Pro add-on)
* Free plugin: Get Pro sidebar link opens zerti.shop directly with no license checks

= 1.4.0 =
* Sidebar: static “Get Pro Version” link when ZERTI Pro add-on is not installed (no license logic in free plugin)

= 1.3.9 =
* WordPress.org: remove all license, Pro gating, and trialware scaffolding from the free plugin (moved to ZERTI Pro add-on)

= 1.3.8 =
* WordPress.org: move all list/Excel grid exports to ZERTI Pro (no trialware in free plugin)
* Remove screenshot PNG files from plugin zip (upload via WordPress.org SVN assets)

= 1.3.7 =
* Security: per-product capability check on inventory grid quick-update
* Fix: register missing coupon delete AJAX handler
* Harden component template includes against path traversal via filter
* Performance: tab-conditional admin asset loading with client-side lazy bundles
* i18n: English source string for SQL export search-blocked message
* Add uninstall.php to remove plugin options, transients, and capabilities
* Release build compiles translation MO files

= 1.3.6 =
* Plugin Check: fix nonce warning in zerti_unslash_post_array(); load Dompdf CSS via Stylesheet API (no link tag in PHP output)

= 1.3.5 =
* WordPress.org review: remove PDF trialware footer, wp_enqueue all admin bundles, PDF CSS via engine API, input sanitization hardening, prefixed PHP polyfills

= 1.3.4 =
* Sanitize PDF download document type query parameter (`zerti_doc`)

= 1.3.3 =
* WordPress.org review: entry-point nonce/capability checks, input sanitization helpers, escape-at-output fixes, print asset enqueues, external services readme disclosures

= 1.3.2 =
* Plugin Check compliance: PHPCS fixes for AJAX handlers, settings, mPDF PSR shim, and i18n translators comments

= 1.3.1 =
* Licensed sidebar badge: token prefix, remaining days, and translations for all admin languages
* License badge digits follow Regional Settings digit format
* WordPress.org review fixes: security, sanitization, PDF CSS extraction, library updates, mPDF patch

= 1.3.0 =
* Align version with ZERTI Pro add-on (both at 1.3.0)
* Plugin Check and release build script hardening

= 1.2.10 =
* Fix production PDF error when release zip omitted dev-only Composer autoload files (regenerate autoload during release build)

= 1.2.9 =
* Split Pro licensing and premium features into the separate ZERTI Pro add-on plugin (WordPress.org free build contains no license server code)
* Fix critical error on sites without ZERTI Pro (`zerti_sanitize_license_key` free stub)

= 1.2.8 =
* Improve production PDF library loading with safer autoload fallback and engine selection
* Fix filesystem-incompatible PDF font filenames (remove spaces from XB Riyaz files)
* Prefix WooCommerce-localized JS globals to satisfy Plugin Check naming rules

= 1.2.7 =
* Fix fatal activation error on PHP 7.4 hosts (replace PHP 8 match expressions; add str_contains polyfill)

= 1.2.6 =
* Fix WordPress release zip packaging (forward-slash paths for reliable install and activation)
* Add CLI release build script for WordPress.org-compatible zips

= 1.2.5 =
* Fix product publish/save in add/edit product editor when opening Inventory via SPA navigation
* Show "Applying…" loading state on the Publish/Update button while saving

= 1.2.4 =
* Maintenance and bug-fix release

= 1.2.1 =
* English-first admin UI with bundled translations for 10 locales
* Regional settings: UI language, digits, calendar, and direction
* Visual themes (Zerti + rabbitMP) and dark/light mode
* Reports area: sales report, standard reports, BI reports (Pro)
* Finance: coupons panel, payments grid
* Customer affairs: customers, reviews, comments
* Global search and PDF layout improvements
* WordPress.org packaging: GPLv2 license text, readme, and credits

== Upgrade Notice ==

= 1.4.0 =
* Sidebar: static “Get Pro Version” link when ZERTI Pro add-on is not installed (no license logic in free plugin)

= 1.3.9 =
* WordPress.org: remove all license, Pro gating, and trialware scaffolding from the free plugin (moved to ZERTI Pro add-on)

= 1.3.8 =
List/Excel grid exports are Pro-only; free plugin no longer ships export code or screenshot PNGs in the zip.

= 1.3.7 =
Security, performance, and WordPress.org packaging improvements (uninstall cleanup, lazy assets, i18n).

= 1.3.4 =
Sanitizes PDF download document type input for Plugin Check compliance.

= 1.3.3 =
WordPress.org review remediation: security, sanitization, escaping, and readme disclosures.

= 1.3.2 =
Plugin Check compliance and coding-standards fixes.

= 1.3.1 =
Licensed badge improvements, digit-format support, and WordPress.org review fixes.

= 1.3.0 =
ZERTI and ZERTI Pro are now released together at version 1.3.0.

= 1.2.10 =
Fixes “ZERTI PDF library is not available” on sites installed from the WordPress.org release zip.

= 1.2.9 =
Pro features now require the ZERTI Pro add-on plugin. Fixes a critical error after the free/Pro split.

= 1.2.8 =
Improves production PDF generation reliability and fixes WordPress.org Plugin Check compatibility issues.

= 1.2.7 =
Fixes plugin activation on servers running PHP 7.4.

= 1.2.6 =
Fixes release zip install/activation on WordPress hosts.

= 1.2.5 =
Fixes product save in the editor and improves publish button feedback.

= 1.2.4 =
Maintenance and bug-fix release.

= 1.2.1 =
Multilingual admin UI, reports, themes, and WordPress.org license packaging.

== Credits ==

ZERTI is free software licensed under the **GNU General Public License v2 or later**. See `license.txt` in this plugin directory.

**PHP libraries (Composer, bundled in `vendor/`)**

* [mPDF](https://mpdf.github.io/) — GPL-2.0
* [mPDF QR Code](https://github.com/mpdf/qrcode) — GPL-2.0
* [Dompdf](https://github.com/dompdf/dompdf) — LGPL-2.1
* [thecodingmachine/safe](https://github.com/thecodingmachine/safe) — MIT

**JavaScript and CSS (bundled in `assets/`)**

* [Bootstrap](https://getbootstrap.com/) 5.3.8 — MIT
* [Font Awesome Free](https://fontawesome.com/) 6.5.1 — MIT (code), SIL OFL 1.1 (fonts), CC BY 4.0 (icons)
* [AG Grid Community](https://www.ag-grid.com/) — MIT
* [Chart.js](https://www.chartjs.org/) 4.5.1 — MIT
* [Quill](https://quilljs.com/) — BSD-3-Clause
* [Select2](https://select2.org/) — MIT (styles; script from WooCommerce where applicable)
* [Vazirmatn](https://github.com/rastikerdar/vazirmatn) — SIL Open Font License 1.1

Third-party licenses are GPL-compatible. Source for bundled libraries is included in this plugin or available from the upstream projects listed above.
