Linux 软件免费装
Banner图

Profit Margin Reports for WooCommerce

开发者 emtiazzahid
更新时间 2026年8月27日 01:34
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce profit margin cost of goods sold cogs

下载

0.1.1

详情介绍:

WooCommerce ships the cost data. It does not ship the report. With the Cost of Goods Sold feature enabled, WooCommerce stores a cost for each product and stamps a cost snapshot onto every order line as the order is placed. Then it stops. WooCommerce's own documentation states that Cost of Goods Sold does not integrate with WooCommerce Analytics, and the request to build profit reporting on top of it was closed as not planned. Profit Margin Reports for WooCommerce is that missing report. It reads the cost data WooCommerce already holds and turns it into gross profit, margin, per-product profitability and a per-order profit figure. Nothing is sent anywhere, nothing is rewritten, and no number is presented as more certain than the data behind it. What you get How these numbers relate to Analytics Reports honour the same excluded order statuses as WooCommerce Analytics, and refunds are netted the way Analytics nets them: a refund reduces revenue, units and cost on the date the refund was issued. Every figure is keyed on the order creation date, because the WooCommerce line-item table these reports are built from stores no other date. WooCommerce Analytics defaults its own screens to the paid date. On most stores those are the same day and the totals agree, but on a store that takes payment later than the order is placed, such as bank transfer or invoicing, the two will legitimately disagree about which day a sale lands on. Read this before you install A profit report is only ever as good as the cost data underneath it. Here is exactly what this plugin can and cannot know. Requirements

安装:

  1. Install and activate WooCommerce 10.3 or newer.
  2. Go to WooCommerce > Settings > Advanced > Features and enable Cost of Goods Sold. Until this is on, WooCommerce records no costs at all and every report will be empty.
  3. Install this plugin from Plugins > Add New, or upload the plugin folder to /wp-content/plugins/, then activate it.
  4. Enter costs for your products. The field is Cost of goods on the Product data > General panel. To fill in many products at once, use the backfill assistant on the plugin's own screen.
  5. Open WooCommerce > Profit to view your reports.
Only orders created after step 2 carry a cost snapshot, so expect the report to start filling in from that point forward. Use estimated mode if you need an approximate picture of the period before that.

屏幕截图:

  • Product and variation profitability, sorted by gross profit, with the cost coverage of each row shown alongside so partly costed products are obvious.
  • The Profit column on the WooCommerce orders list, calculated from the cost snapshot stored on each order.
  • The backfill assistant setting product costs in bulk from a percentage of the regular price, with a preview of what will change before anything is written.

升级注意事项:

0.1.1 Enqueues the orders-list column stylesheet properly and confirms compatibility with WordPress 7.1. 0.1.0 First public release. Requires WooCommerce 10.3 or newer with both the Cost of Goods Sold feature and WooCommerce Analytics enabled. Only orders placed after Cost of Goods Sold was switched on carry cost data, so earlier orders report as uncosted unless you use estimated mode.

常见问题:

Why are my reports empty?

Work down this list, in order. The plugin's own status panel checks all of these and tells you which one is failing.

  1. The Cost of Goods Sold feature is off. It is off by default in WooCommerce. While it is off, every cost value WooCommerce returns is zero and nothing is recorded. Enable it at WooCommerce > Settings > Advanced > Features.
  2. WooCommerce Analytics is off. The reports read the Analytics lookup tables, so with Analytics disabled there is nothing to query.
  3. Your products have no cost entered. Set Cost of goods on each product, or use the backfill assistant.
  4. Your orders predate the feature being enabled. See the next question.
  5. WooCommerce has orders waiting to be imported into its Analytics tables. Run the Analytics import from WooCommerce > Status > Tools and let it finish.

Why do my old orders show no cost?

Because there is no cost stored on them. WooCommerce copies a product's cost onto the order line at the moment the order is created, which is what makes historical profit accurate even after you change a supplier price. The flip side is that orders created before the Cost of Goods Sold feature was switched on have no cost snapshot at all, and entering product costs today does not retroactively write costs onto those old orders. No plugin can recover data WooCommerce never wrote. Two things help. Coverage reporting tells you honestly how much of a period is uncosted, and estimated mode applies each product's current cost to those uncosted lines so you get an approximate figure. An estimate is always labelled as an estimate.

How does the CSV cost import work?

Upload a CSV containing a product identifier and a cost, then map which column is which. The plugin shows you every row it matched and every row it could not, and writes nothing until you confirm. The uploaded file is validated by content rather than by its name, stored under a generated filename so nothing you upload can choose where it lands, and deleted in the same request that parses it. Costs are written through WooCommerce's own product API, never by direct database writes. A template CSV of your existing products can be downloaded from the same screen; values in it are escaped so a product name or SKU beginning with an equals sign cannot execute as a formula when the file is opened in a spreadsheet.

Does this plugin send my data anywhere?

No. It makes no external HTTP requests of any kind. No telemetry, no tracking, no remote licence check, no third-party services. All calculation happens in your own database on your own server. See the Privacy section above.

Does it work with HPOS?

Yes. The plugin declares compatibility with High-Performance Order Storage and reads order data correctly under both HPOS and legacy post-based storage. It also declares compatibility with the Cost of Goods Sold feature itself.

Does it change my cost data?

No. Reporting is strictly read-only: it queries WooCommerce's tables and writes nothing back to your products or orders. The single exception is the backfill assistant, which exists specifically to write product costs, and only does so for the products you select, after you confirm, and using WooCommerce's own product API rather than direct database writes. It never touches costs already recorded on existing orders, because those are a historical record.

Do the numbers match WooCommerce Analytics?

Usually, and where they differ there is a reason worth knowing. The plugin honours the same excluded order statuses configured in your Analytics settings and nets refunds the same way. The difference is the date. These reports key every figure on the order creation date, because the WooCommerce line-item table they read stores no other date, while Analytics defaults to the paid date. If your store is paid at checkout those are the same day and the totals agree. If payment can arrive days after the order, the same sale can land on different days in the two reports.

How are refunds handled?

WooCommerce writes a refund as its own negative line, carrying negative quantity and a negative cost, dated on the day the refund was issued. Reports sum those lines along with everything else, so a refund reduces revenue, units and cost on the refund date. The refunded order is not retrospectively rewritten.

What does the coverage percentage mean?

It is the share of order lines in the current report that had a cost recorded. At 100 percent, every line was costed and the profit figure is complete. At 60 percent, four lines in ten contributed revenue but no cost, so the true cost is higher and the true profit lower than shown. Coverage is displayed rather than hidden precisely so that a partly costed report is never mistaken for a complete one.

Which orders count, and who can see the reports?

The same orders WooCommerce Analytics counts: everything except the statuses excluded in your Analytics settings, plus draft, auto-draft and trashed orders, which are never counted because they are not sales. Developers can adjust this with the profit_margin_reports_report_statuses filter. Anyone with the view_woocommerce_reports capability, which by default means shop managers and administrators. Writing costs through the backfill assistant additionally requires manage_woocommerce.

Is a very large store going to be slow?

Possibly, in this release. Reports are calculated live against your order tables on each load, with a short-lived cache. Stores with hundreds of thousands of orders may find long date ranges take a while. Pre-aggregation is planned.

更新日志:

0.1.1 Review feedback from the WordPress.org plugin team. 0.1.0 Initial release.