=== Sanghare Margin Analytics for WooCommerce ===
Contributors: sadiosan23
Tags: woocommerce, profit, analytics, cogs, margin
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
Requires Plugins: woocommerce
WC requires at least: 10.3
Stable tag: 1.0.10
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Analyze WooCommerce net revenue, historical COGS, gross profit, gross margin and data quality directly inside WordPress.

== Description ==

Sanghare Margin Analytics for WooCommerce provides a fully functional local profitability analytics workflow for WooCommerce stores.

Core capabilities:

* Historical COGS snapshots so past margin calculations remain reproducible when product costs change.
* Net revenue, COGS, gross profit and gross margin analytics.
* Order-level and product-level profitability views.
* Refund-aware calculations.
* Profit Data Quality scoring focused on COGS coverage and reliability.
* Background backfills and recalculation audit history.
* HPOS-safe WooCommerce order APIs.
* Dedicated plugin tables for analytics data.

All analytics calculations in this WordPress.org package run locally on the site, and every included feature is available immediately after activation.

== Installation ==

1. Install and activate WooCommerce 10.3 or newer.
2. Upload or install Sanghare Margin Analytics for WooCommerce.
3. Activate the plugin.
4. Open WooCommerce > Margin Analytics.
5. Build the initial analytics dataset when prompted.
6. Review Data Quality before relying on historical profitability reports.

== Frequently Asked Questions ==

= Does the plugin modify historical product costs? =

No. Historical cost snapshots are stored separately so previously calculated orders remain reproducible.

= Is HPOS supported? =

Yes. The plugin uses WooCommerce order APIs and declares HPOS compatibility.

= Does the plugin send store analytics to an external service? =

No. This WordPress.org package performs its profitability calculations locally and does not require a remote analytics or licensing service.

= What is the Profit Data Quality Score? =

It measures the coverage and reliability of the cost data used for gross-profit analytics. It does not grade the financial performance of the store.

== Screenshots ==

1. Margin overview with revenue, gross profit and Data Quality KPIs.
2. Order profitability with historical COGS provenance.
3. Product profitability and gross-margin analysis.
4. Data Quality coverage and anomalies.
5. Diagnostics and recalculation history.

== Privacy ==

Sanghare Margin Analytics for WooCommerce processes WooCommerce profitability analytics locally in the WordPress database. The WordPress.org edition does not require a license service and does not intentionally transmit order-level revenue, COGS, margin or customer-order analytics to an external service.

== Changelog ==

= 1.0.10 =
* Added a contextual Upgrade to Pro link on Sanghare Margin Analytics admin pages.
* Added direct access to the separate Sanghare Margin Analytics Pro checkout.

= 1.0.9 =
* Resolved the final Plugin Check `WordPress.DB.PreparedSQL.NotPrepared` finding in AnalyticsRepository.
* Every `wpdb::prepare()` call now receives a literal query string with matching replacement values.

= 1.0.8 =
* Hardened dynamic analytics status/date filtering and uninstall database cleanup for Plugin Check.

= 1.0.7 =
* Rebranded the WordPress.org edition as Sanghare Margin Analytics for WooCommerce.
* Removed all licensing, premium gating and paid-feature implementation from the WordPress.org package.
* Removed bundled translation binaries so translations can be managed through translate.wordpress.org.
* Updated the WordPress.org contributor to sadiosan23.
* Kept the free package fully functional for local COGS, gross-profit and data-quality analytics.
