Skip to content

System status

Payments Hub adds its own section to WooCommerce → Status → System status, so you can see which version of the package a site runs without shell or Composer access. The section is also included in Get system report, which makes it easy to paste into a support ticket.

Row Where it comes from
Package version Composer's own metadata — the version actually installed in vendor/, not what composer.json asks for. Installs from a branch also show the short commit, e.g. dev-master (f913a31).
Database version The migration version the paymenthub_ tables are on (see Migrations).

The lookup itself lives in base-plugin — Barberklingen\BasePlugin\Helpers\PackageVersion — so every package reports its version the same way. It reads Composer 2's runtime API and falls back to vendor/composer/installed.json, which is all a site built by Composer 1 leaves behind.

If the version reads Unknown, neither source could be found — typically because the package was copied into vendor/ by hand instead of installed with Composer.

Note that the version comes from Composer, so a site where files have been copied into vendor/ manually (e.g. with update-local-vendor-*.sh) still reports the version Composer installed, not the state of the copied files.

Reading the version in code

use Subscribed\PaymentsHub\Core\Utilities\VersionUtil;

VersionUtil::getPackageVersion();      // "2.4.1", "dev-master" or null
VersionUtil::getPackageReference();    // commit hash, or null
VersionUtil::describePackageVersion(); // "2.4.1" or "dev-master (f913a31)", empty when unresolved
VersionUtil::getDatabaseVersion();     // "2.1.0"

VersionUtil only knows this package's name and its database version; the version resolution is delegated to base-plugin's helper.

Adding your own rows

A plugin can extend the section with its own information:

add_filter( 'payments-hub/system-status/rows', function ( array $rows ): array {
    $rows[] = [
        'label' => 'Frisbii environment',
        'tip'   => 'Which Frisbii account the site is configured against.',
        'value' => getenv( 'FRISBII_ENVIRONMENT' ) ?: 'unknown',
    ];

    return $rows;
} );

Each row takes a label, a value and an optional tip (rendered as a WooCommerce help tip). Values are escaped on output.