Skip to content

Configuration

All plugin settings live under Settings → Plugins → P2Lab Stats. The settings page mirrors the P2Lab Stats module sidebar: each section is its own sub-page so you can deep-link from the module navigation.

The settings are organised into five groups: Dashboard, Reports, Widgets, Tasks and Advanced.

A landing page that summarises the current configuration — which widgets are enabled, which reports are cached, when the last snapshot ran. Use it as a starting point to spot misconfigurations.

Thresholds drive colour-coding and grouping in the Stock reports.

  • Low-stock threshold — products at or below this stock level are flagged as low stock.
  • Warning threshold — second tier shown as a softer warning.
  • Approaching threshold — third tier, “approaching low stock”.
  • Overstock days-of-supply — products with more days of supply than this value (based on sales velocity) appear in the Overstock report.

Default fallback filters and date presets for the sales report group — used when a user lands on a sales report without a saved profile.

Same idea, scoped to customer reports. Includes the default cohort matrix metric (revenue per active customer vs orders per active customer) and the default RFM scoring weights.

Default cross-sell minimum support / confidence thresholds and the default drill-down period.

Cross-cutting report options — date format, currency display, table page size, default sort.

Configure the KPI widget that appears above the order list.

  • Enabled — show or hide the widget.
  • Default period — preset used on first load (last 7 / 14 / 30 days, etc.). Users can change it per session afterwards.
  • Exclude today — when on, the period ends yesterday so a partial day doesn’t skew the comparison.
  • Default order states — limit the widget calculation to specific states (e.g. exclude cancelled).
  • Visible metrics — choose 4 of the 8 available order KPIs to display.

The same options scoped to the customer KPI widget. Eight customer metrics are available, four are shown at a time.

The full metric list for both widgets is in KPI list.

Daily product snapshots record each product’s price and stock so the Margins report and the Product drill-down stock/price columns work from day one.

  • Enabled — toggle the daily task.
  • Retention — how long snapshots are kept before old rows are purged. Long retention enables longer history at the cost of table size.

The snapshot history can be browsed under P2Lab Stats → Product snapshots.

Reports compute live by default. For heavy ranges (year-over-year, large catalogues) you can pre-compute them in the background.

  • Report cache — enable to pre-compute report payloads.
  • Widget cache — enable to pre-compute KPI widget data.
  • Interval (hours) — refresh frequency, 1–24 h.
  • Retention (days) — how long cached payloads stay valid.

When the cache is warm, opening a report page is instant. See Cache warming for the full picture.

Performance tunables for very large stores:

  • Query batching — process orders in chunks to keep memory usage low.
  • Export progress retention — how long completed export jobs stay visible in the Exports page before being purged.

The plugin reads three layers of configuration in this order (later overrides earlier):

  1. Plugin defaults — shipped with the codebase.
  2. System config — set under Settings → Plugins → P2Lab Stats.
  3. Saved profile — when a user loads a saved profile, its stored filters and view-mode override the defaults for the current report.

With the plugin configured, head to Your first report for an end-to-end walkthrough of the Sales Summary report.