=== Tarkop Profit Manager for WooCommerce ===
Contributors: tarkop
Tags: woocommerce, profit, cogs, cost of goods, margin
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 8.2
WC tested up to: 11.1
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Know your gross profit, not only your sales. Track product costs, historical COGS, revenue, profit and margins in WooCommerce.

== Description ==

Plugin page: https://tarkop.dev/tarkop-profit-manager-for-woocommerce/

Tarkop Profit Manager for WooCommerce adds cost prices to simple products and variations, records historical cost snapshots for new orders, and turns that data into clear gross-profit reports.

Free includes:

* Cost price for simple products and individual variations.
* Historical cost snapshots stored in hidden WooCommerce order metadata.
* Revenue, COGS, gross profit and margin in orders.
* Partial and full refund-aware revenue, COGS, profit and product reports.
* Cost, profit and margin columns in the product list.
* Profit Dashboard with date ranges.
* Product Profit report.
* WooCommerce built-in product CSV import/export support for Cost price.
* HPOS compatibility using WooCommerce CRUD APIs.
* Cart and Checkout Blocks compatibility.
* Theme-independent admin interface that does not inject frontend markup into themes or Elementor layouts.
* Bundled translations for 74 WordPress locales, plus translation-ready strings and an RTL-safe admin layout.

Historical accuracy matters: old orders that do not contain a cost snapshot are clearly marked and excluded from aggregate profit totals instead of being silently recalculated using today's product cost.

== Languages ==

English is the source language. Bundled translations are included for 74 WordPress locales:

* Arabic (ar), Azerbaijani (az), Belarusian (be_BY), Bulgarian (bg_BG), Bengali (bn_BD), Bosnian (bs_BA), Catalan (ca), Czech (cs_CZ), Welsh (cy), Danish (da_DK).
* German: Austria (de_AT), Switzerland (de_CH), Germany (de_DE); Greek (el); Spanish: Argentina (es_AR), Chile (es_CL), Colombia (es_CO), Spain (es_ES), Mexico (es_MX), Peru (es_PE), Venezuela (es_VE).
* Estonian (et), Basque (eu), Persian (fa_IR), Finnish (fi), Faroese (fo); French: Belgium (fr_BE), Canada (fr_CA), Switzerland (fr_CH), France (fr_FR).
* Irish (ga), Scottish Gaelic (gd), Galician (gl_ES), Hebrew (he_IL), Hindi (hi_IN), Croatian (hr), Hungarian (hu_HU), Armenian (hy), Indonesian (id_ID), Icelandic (is_IS).
* Italian: Switzerland (it_CH), Italy (it_IT); Japanese (ja), Georgian (ka_GE), Korean (ko_KR), Luxembourgish (lb_LU), Lithuanian (lt_LT), Latvian (lv), Macedonian (mk_MK), Malay (ms_MY), Maltese (mt_MT).
* Norwegian Bokmål (nb_NO); Dutch: Belgium (nl_BE), Netherlands (nl_NL); Polish (pl_PL); Portuguese: Angola (pt_AO), Brazil (pt_BR), Portugal (pt_PT); Romansh (rm), Romanian (ro_RO), Russian (ru_RU).
* Slovak (sk_SK), Slovenian (sl_SI), Albanian (sq), Serbian Cyrillic (sr_RS), Serbian Latin (sr_RS_latin), Swedish (sv_SE), Thai (th), Turkish (tr_TR), Ukrainian (uk), Vietnamese (vi).
* Chinese: Simplified (zh_CN), Hong Kong (zh_HK), Traditional (zh_TW).

== Installation ==

1. Upload the plugin ZIP in Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Make sure WooCommerce is active.
4. Add Cost price values to products and variations.
5. Open WooCommerce > Profit Manager.

== Frequently Asked Questions ==

= Does it work with HPOS? =

Yes. Order data is read and written through WooCommerce order and order-item objects, and the plugin declares HPOS compatibility.

= Does it work with Elementor and popular themes? =

The plugin's profit interface is in WordPress/WooCommerce admin and does not alter frontend theme templates, so it is independent of Elementor and normal storefront themes.

= What happens to old orders? =

The plugin never pretends that today's cost was the historical cost. Orders without historical snapshots are clearly marked and excluded from aggregate profit totals.

= What does Revenue mean in the free version? =

Product line revenue after product discounts, excluding tax and shipping. Gross profit is Revenue minus historical COGS.

== Changelog ==

= 1.0.3 =
* Restored compatibility with historical cost data stored by earlier plugin builds under legacy meta keys.
* Preserved the original historical item cost when legacy and current snapshot keys overlap.
* Made Dashboard and Product Profit exclude incomplete historical orders consistently.
* Aligned the live product profit estimate with the tax-exclusive calculation used by PHP reports.
* Stopped order-item edits from backfilling missing historical costs with today's product cost.
* Hardened partial and full refund handling, including unallocated fee, shipping and tax refunds.

= 1.0.2 =
* Added the official plugin website URL to the plugin metadata.
* Updated release metadata for version 1.0.2.

= 1.0.1 =
* Fixed custom date range selection on the Profit Dashboard and Product Profit report.
* Restored the review/support card on the plugin dashboard with direct links to WordPress.org reviews and the support forum.
* Added the bundled translation language list to readme.txt.

= 1.0.0 =
* Initial release.
* Product and variation cost prices.
* Live Estimated profit and Estimated margin beside cost fields for simple products and variations.
* Localized help tooltips for cost and estimate fields.
* Historical order-level cost snapshots.
* Order and product profit/margin columns.
* Partial/full refund recalculation with refunded quantities reflected in COGS.
* Profit Dashboard and Product Profit report.
* WooCommerce CSV import/export integration.
* HPOS and Checkout Blocks compatibility.
* WordPress.org Plugin Check fixes for translator comments and sanitized/unslashed product cost input.
