PHPackages                             renzojohnson/wc-hpos-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. renzojohnson/wc-hpos-helper

ActiveLibrary[Database &amp; ORM](/categories/database)

renzojohnson/wc-hpos-helper
===========================

WooCommerce HPOS data integrity toolkit. Audit orders, subscriptions, and customer data after High-Performance Order Storage migration. Detect orphaned records, zero-value fields, and sync mismatches. Zero dependencies.

v0.26.02.24(4mo ago)00MITPHPPHP ^8.4

Since Feb 24Pushed 4mo agoCompare

[ Source](https://github.com/renzojohnson/wc-hpos-helper)[ Packagist](https://packagist.org/packages/renzojohnson/wc-hpos-helper)[ Docs](https://renzojohnson.com)[ RSS](/packages/renzojohnson-wc-hpos-helper/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

WC HPOS Helper
==============

[](#wc-hpos-helper)

[![Latest Version](https://camo.githubusercontent.com/dddfaedaef62a0d854001c1527b8f1dbcf944b45c7945403186aa79db5e6265a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72656e7a6f6a6f686e736f6e2f77632d68706f732d68656c7065722e737667)](https://packagist.org/packages/renzojohnson/wc-hpos-helper)[![PHP Version](https://camo.githubusercontent.com/f4e8ee35bb53cdd407141b3cd82c1e0cd604da098ad8589baddecdbb60cc641e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f72656e7a6f6a6f686e736f6e2f77632d68706f732d68656c7065722e737667)](https://packagist.org/packages/renzojohnson/wc-hpos-helper)[![License](https://camo.githubusercontent.com/3913e3ebebf46b2703553377da550a9c8ae981f781a4ba7dee97384ebd9a52de/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f72656e7a6f6a6f686e736f6e2f77632d68706f732d68656c7065722e737667)](https://github.com/renzojohnson/wc-hpos-helper/blob/main/LICENSE)

WooCommerce HPOS data integrity toolkit. Audit orders, subscriptions, and customer data after High-Performance Order Storage migration. Detect orphaned records, zero-value fields, and sync mismatches.

**Author:** [Renzo Johnson](https://renzojohnson.com)

Requirements
------------

[](#requirements)

- PHP 8.4+
- PDO MySQL extension
- JSON extension

Installation
------------

[](#installation)

```
composer require renzojohnson/wc-hpos-helper
```

Usage
-----

[](#usage)

```
use RenzoJohnson\WcHposHelper\HposHelper;

$helper = new HposHelper(
    dsn: 'mysql:host=localhost;dbname=wordpress',
    user: 'root',
    pass: 'secret',
);

// Full audit
$report = $helper->audit();
echo $report->toJson();

// Individual audits
$orderResult = $helper->auditOrders();
$subResult = $helper->auditSubscriptions();
$customerResult = $helper->auditCustomers();
$metaResult = $helper->auditMeta();

// Check HPOS status
$helper->isHposEnabled();  // bool
$helper->isSyncEnabled();  // bool
```

### Custom Table Prefix

[](#custom-table-prefix)

```
// Standard WordPress
$helper = new HposHelper($dsn, $user, $pass, prefix: 'wp_');

// Multisite (site 2)
$helper = new HposHelper($dsn, $user, $pass, prefix: 'wp_2_');

// Custom prefix
$helper = new HposHelper($dsn, $user, $pass, prefix: 'mysite_');
```

### Sample Limit

[](#sample-limit)

```
$helper = new HposHelper($dsn, $user, $pass);
$helper->setSampleLimit(100); // Default is 50
```

Audits
------

[](#audits)

### Order Audit

[](#order-audit)

Compares `wp_wc_orders` against `wp_posts` for mismatches in parent ID, customer ID, status, and totals. Only checks `shop_order` type. Status is normalized (lowercase, `wc-` prefix stripped). Totals use decimal-safe comparison.

### Subscription Audit

[](#subscription-audit)

Checks subscriptions for `customer_id = 0` on active subscriptions (error) and `parent_order_id = 0` on cancelled subscriptions (warning). Detects orphaned renewal orders pointing to non-existent subscriptions.

### Customer Audit

[](#customer-audit)

Verifies `wp_wc_customer_lookup` matches order billing data. Checks email consistency and flags guest lookup rows and missing emails as warnings.

### Meta Sync Audit

[](#meta-sync-audit)

Compares 12 canonical meta keys between HPOS and legacy tables. HPOS is treated as authoritative. Reports value mismatches and missing keys in the posts table.

Report Format
-------------

[](#report-format)

```
{
    "generated_at": "2026-02-24T15:00:00+00:00",
    "prefix": "wp_",
    "hpos_enabled": true,
    "sync_enabled": true,
    "summary": {
        "total_checked": 350,
        "total_mismatches": 5,
        "total_warnings": 3,
        "audits_passed": 2,
        "audits_failed": 1,
        "audits_skipped": 1,
        "overall_passed": false
    },
    "results": [...]
}
```

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/renzojohnson/wc-hpos-helper)
- [GitHub](https://github.com/renzojohnson/wc-hpos-helper)
- [Issues](https://github.com/renzojohnson/wc-hpos-helper/issues)
- [Author](https://renzojohnson.com)

License
-------

[](#license)

MIT License. Copyright (c) 2026 [Renzo Johnson](https://renzojohnson.com).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance76

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

129d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e1b69733e3d1fd486158d322c23d99281623046b3c357529c9930e50d73fcda?d=identicon)[renzo.johnson](/maintainers/renzo.johnson)

---

Top Contributors

[![renzojohnson](https://avatars.githubusercontent.com/u/4695400?v=4)](https://github.com/renzojohnson "renzojohnson (3 commits)")

---

Tags

auditdata-integritydatabasehigh-performance-order-storagehposmigrationphpwoocommercewoocommerce-subscriptionsphpmigrationdatabaseAuditwoocommercewoocommerce-subscriptionsdata-integrityhigh-performance-order-storagehpos

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/renzojohnson-wc-hpos-helper/health.svg)

```
[![Health](https://phpackages.com/badges/renzojohnson-wc-hpos-helper/health.svg)](https://phpackages.com/packages/renzojohnson-wc-hpos-helper)
```

###  Alternatives

[sonata-project/entity-audit-bundle

Audit for Doctrine Entities

6421.1M1](/packages/sonata-project-entity-audit-bundle)[awssat/laravel-sync-migration

Laravel tool helps to sync migrations without refreshing the database

10823.4k](/packages/awssat-laravel-sync-migration)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
