=== Bizmart - Cost of Goods, Analytics, Redesigned Order and Product page ===
Contributors: fethallah01, bizmart
Tags: woocommerce, inventory, analytics, dashboard, purchase-price
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Easily track Cost of Goods and profit margins in WooCommerce. Includes a simplified product creator, fast order panel, and modern analytics.

== Description ==

Bizmart adds a powerful Cost of Goods (purchase price/cost tracking) system, a simplified product creation interface, and a modern order panel to your WooCommerce store. It is designed to be much cleaner, faster, and easier to use than default WooCommerce screens. Track margins, profits, and stock valuations in real-time right inside your WordPress admin dashboard.

**Core Features:**

* **Simplified Product Interface** - A clean, fast, and unified interface to create and manage products with Cost of Goods (purchase price) tracking. Much cleaner than default WooCommerce panels.
* **Modern Order Panel** - A streamlined orders interface allowing for quick navigation and overview of transactions, far cleaner and easier to manage than default WooCommerce tables.
* **Analytics Dashboard** - Sales, profit, and margin metrics with date-range filtering and Chart.js graphs.
* **Product Management** - Purchase price meta for all product types (simple, variable, grouped, external, digital). Inline editing, AJAX product creation, and background import with progress tracking.
* **Inventory Metrics** - Real-time stock valuation using purchase prices, with variation-aware calculations and weighted average cost (WAC) support.
* **Settings Engine** - Company info, expense categories, import preset builder, and per-option caching.
* **Trilingual UI** - English, French, and Arabic with RTL-ready admin styles and lazy-loaded translation dictionaries.
* **Addon API** - Hooks and helper functions for extending Bizmart with addon plugins (Invoices, Suppliers, Finance).

**Requirements:**

* WordPress 5.8+
* WooCommerce 5.0+
* PHP 7.4+

== External Services ==

This plugin uses the external service `placeholder.co` to load a default company logo placeholder image on the settings screen. 
- **Data sent:** None (other than the request for the static image size/color).
- **Service details:** Provided by placeholder.co. Terms and privacy details can be found on their website: https://placeholder.co/

== Installation ==

1. Upload the `bizmart-cost-of-goods` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Bizmart > Settings** to configure your company details.
4. Install any Bizmart addon plugins as needed for Invoices, Suppliers, and Finance features.

== Frequently Asked Questions ==

= Does Bizmart require WooCommerce? =

Yes. Bizmart extends WooCommerce with purchase prices, margin calculations, and an analytics dashboard. WooCommerce must be installed and active.

= Which product types are supported? =

Simple, Variable (with per-variation purchase prices), Grouped, External, and Digital/Downloadable products are all supported.

= Does Bizmart work with RTL languages? =

Yes. The admin UI is fully RTL-ready and includes built-in Arabic translations.

= Where is the data stored? =

Bizmart creates its own database tables (prefixed with bizmart_) for products, expenses, suppliers, invoices, payments, and price history. All tables are cleaned up on uninstall.

= Can I extend Bizmart? =

Yes. Bizmart provides an addon API with hooks and helper functions for building extension plugins like Invoices, Suppliers, and Finance modules.

== Screenshots ==

1. Analytics Dashboard with sales, profit, and margin metrics.
2. Products page with inline price editing.
3. Company Settings page.

== Changelog ==

= 2.2.0 =
* Feature: Products with stock management OFF but status in stock counted as qty=1 in metrics.
* Performance: Cache key bumped to v9 with automatic legacy cleanup.
* i18n: Complete Arabic translations (321 strings).
* Security: Capability checks on all form handlers.
* Security: Proper output escaping on all admin pages.

= 2.1.0 =
* Security: Unified nonce verification with backward compatibility.
* Performance: Lazy-load Arabic translations, static option cache.
* Architecture: Extracted shared helpers, addon API, activation/deactivation hooks.

= 1.1.0 =
* Initial release with Dashboard, Settings, and Product Management.

== Upgrade Notice ==

= 2.2.0 =
Security improvements and Arabic translation updates. Recommended for all users.
