=== ForooshNegar – Advanced Sales Reports ===
Contributors: mrhamidreza
Donate link: https://hamidrezamoghaddam.ir/
Tags: woocommerce, reports, sales, analytics, csv
Requires at least: 6.5
Requires PHP: 7.4
Requires Plugins: woocommerce
Tested up to: 7.1
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Professional WooCommerce reporting with Jalali dates, customer and product insights, geographic analysis, and safe CSV exports.

== Description ==

ForooshNegar adds a fast, Persian-friendly reporting screen to WooCommerce. It uses WooCommerce order APIs, supports both legacy order storage and High-Performance Order Storage (HPOS), and processes report data in bounded batches to keep the WordPress admin responsive.

Features include:

* Jalali date-range filtering with order-status and payment-gateway filters.
* Sales, shipping, refund, net-revenue, daily-sales, and referral reports.
* Product performance, best-selling variations, discounts, products without sales, and stock insights.
* Customer analysis for new, returning, registered, and guest customers.
* Geographic analysis by province or state.
* UTF-8 CSV exports for orders, products, customers, and geographic data.
* Protection against spreadsheet-formula injection in CSV fields.
* A responsive RTL-ready WordPress admin interface.
* Optional scheduled aggregate reports through Bale and/or Telegram Bot APIs.

== External Service ==

The optional messenger integrations connect only after an administrator enables them and enters bot tokens plus destination chat IDs.

**Bale**

When Bale reporting is enabled, ForooshNegar connects to `https://tapi.bale.ai` and sends:

* Order and customer counts.
* Revenue, shipping, discount, and wallet totals.
* Payment gateway titles and totals.
* Names and quantities of up to three top-selling products.
* Month-to-date sales summary.

Bale service use is subject to its terms and privacy policy: https://bale.ai/terms

**Telegram**

When Telegram reporting is enabled, ForooshNegar connects to `https://api.telegram.org` and sends the same aggregate information listed above.

Telegram service use is subject to its terms and privacy policy: https://telegram.org/privacy

You can enable Bale only, Telegram only, or both at the same time.

Customer names, email addresses, phone numbers, and addresses are never sent.

== Installation ==

1. Upload the `forooshnegar` folder to `/wp-content/plugins/`, or install the ZIP through Plugins > Add New > Upload Plugin.
2. Activate ForooshNegar.
3. Ensure WooCommerce is installed and active.
4. Open WooCommerce > ForooshNegar.
5. Configure optional Bale and/or Telegram reports only if you intend to use them.

== Frequently Asked Questions ==

= Does ForooshNegar support HPOS? =

Yes. It declares compatibility with WooCommerce High-Performance Order Storage and uses WooCommerce order APIs.

= Does the plugin send customer data to Bale or Telegram? =

No. The optional integrations send only aggregate metrics, payment gateway titles, and top-product names and quantities.

= Can I use Bale and Telegram together? =

Yes. Enable one or both messengers in WooCommerce > ForooshNegar > Messenger settings.

= Why might scheduled reports run late? =

WordPress WP-Cron runs on site traffic. Configure a real server cron for predictable execution times.

= How are plugin strings translated? =

All user-facing strings use the `forooshnegar` text domain and can be translated on https://translate.wordpress.org/

== Screenshots ==

1. Jalali date filters and sales summary cards.
2. Product, customer, and geographic reports.
3. Optional Bale and Telegram integration settings.

== Changelog ==

= 1.1.0 =

* Added Telegram Bot API support alongside Bale.
* Redesigned daily report message with month-to-date summary.
* Fixed cron scheduling reliability and API response validation.
* Improved send-time UI with hour/minute labels and WordPress timezone notice.
* Tested up to WordPress 7.1.

= 1.0.1 =

* Removed bundled translation files for WordPress.org translation system compatibility.
* Removed Domain Path header.

= 1.0.0 =

* Initial public release.
