WP Manifestindependent plugin directory
manifest / ecommerce / dahu-order-notes

Dahu Order Notes

Tell handwritten WooCommerce order notes apart from auto-generated ones

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/dahu-concept/dahu-order-notes/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Makes the WooCommerce order notes a person actually wrote stand out from the ones WooCommerce and its extensions generate on their own.

Developed and maintained by Hugo Vial-Jaime — Dahu-Concept.

The problem

On a busy shop, the order notes panel fills up with machine-generated entries — status changes, stock movements, refunds, tracking numbers, invoice events. The one note that matters, the one a colleague typed about this particular customer, is buried among them.

WooCommerce already styles customer notes and system notes differently. What it cannot style is the third category: notes generated by code while a staff member is logged in. Changing an order status from the admin screen produces a note attributed to that person, indistinguishable in the markup from a note they typed themselves.

Dahu Order Notes identifies those, and leaves the hand-written ones highlighted.

How detection works

Automatic notes can only be recognised by their wording. Hardcoding that wording would tie the plugin to one language, so instead it rebuilds its patterns at runtime from WooCommerce's own translatable strings:

__( 'Order status changed from %1$s to %2$s.', 'woocommerce' )

Placeholders become wildcards, the rest is matched literally. A French shop therefore matches État de la commande modifié de …, a German one Bestellstatus geändert von …, with no configuration and no translation file of its own.

Note content is normalised before matching — HTML stripped, entities decoded, every kind of whitespace flattened — because WooCommerce notes routinely carry non-breaking spaces, which French typography puts before every colon.

Features

  • Highlights hand-written private notes on the order screen
  • Locale-independent detection, rebuilt from WooCommerce's own translations
  • Configurable highlight colours
  • Additional phrases configurable from the settings screen, no code required
  • dahu_order_notes_auto_patterns filter for developers
  • Works with both legacy order storage and High-Performance Order Storage
  • Never writes to the database; deactivating leaves no trace

Requirements

WordPress 6.0 or later
PHP 7.4 or later
WooCommerce 7.0 or later
HPOS Compatible

Installation

  1. Download the latest release, or clone this repository into wp-content/plugins/.
  2. Activate the plugin through the Plugins screen.
  3. Optionally adjust the colours under WooCommerce → Dahu Order Notes.

Highlighting is on by default.

Configuration

Setting Effect
Highlighting Turns the highlight on or off.
Hand-written note colour Background of notes identified as hand-written.
Customer note header colour Background of the header on notes sent to the customer.
Additional automatic notes One phrase per line. Any note starting with one of them is treated as automatic. Plain text, not regular expressions.

For developers

Add your own patterns, as complete PCRE expressions:

add_filter( 'dahu_order_notes_auto_patterns', function ( array $patterns ) {
    $patterns[] = '/^Tracking number added/i';
    return $patterns;
} );

Change the admin screens the highlight applies to:

add_filter( 'dahu_order_notes_order_screens', function ( array $screens ) {
    $screens[] = 'my_custom_order_screen';
    return $screens;
} );

External services

This plugin does not contact any external service.

Changelog

2.0.0

  • First public release.
  • Detection patterns rebuilt from WooCommerce's translated strings instead of a hardcoded French list.
  • Settings field to declare additional automatic notes without code.
  • Styles enqueued properly instead of printed in the admin head.
  • Colour values re-validated at output time.
  • Uninstall routine added, including multisite.
  • Marker class renamed to dahu-auto-note.

License

MIT — see LICENSE.