Traxs WP Registry grade A-. Low-severity findings · 1 findingWP RegistryLow-severity findings · 1 findingOpen the reportA-
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/emkowale/traxs/releases/download/v1.0.23/traxs-v1.0.23.zipTraxs — Receive Goods SPA for The Bear Traxs
A lightweight WordPress plugin that provides a mobile-first kiosk interface to list POs and receive goods, bridging data from the Eject system.
Design ground rules (non-negotiable):
- Files ≤ 100 lines each (JS/PHP/CSS) unless truly unavoidable.
- No inline CSS in JS or PHP. All styling lives in
/assets/css/. - Mobile portrait first. Buttons stacked, centered. Kiosk use.
- Color palette: background
#0e243c(navy), buttons#ffd078(yellow), accent#863d3d(brown). - Navigation uses hash routes (e.g.,
/#/,/#/pos,/#/receive?po=ID). - Security: any state-changing REST route requires
manage_woocommerce.
1) What the user sees
A. Home screen (after login → /traxs/ → /#/)
- Centered title: “Traxs” in
#ffd078. - Centered logo: Bear Traxs mark, 120px.
- Three stacked buttons (full-width up to 320px):
- Receive Goods → route to
/#/pos - Print Work Orders → route to
/#/print(placeholder) - Scan Work Order → route to
/#/scan(placeholder)
- Receive Goods → route to
- Background everywhere:
#0e243c. - Buttons:
#ffd078, no corner radius, bold, centered, stacked.
B. POs list (route /#/pos)
- Header area shows centered logo.
- Title text “POs”.
- For each finalized PO (i.e., has BT PO number
_po_number):- Render one big stacked button:
PO ######. - Tap → navigate to
/#/receive?po=<post_id>(receive screen).
- Render one big stacked button:
- Empty state: “There are no POs on order.”
C. Receive screen (route /#/receive?po=ID)
- Loads PO lines from REST.
- Table (dark theme) columns: Item / Color / Size / Ordered / Received / Action.
- Receive action opens a modal:
- Shows line summary + Remaining quantity.
- Numeric input defaults to 1 (or 0 if none remaining).
- Confirm posts to REST, updates Received count live.
- Persisted records stored in
wp_traxs_receipts.
2) Data model & sources
POs (read-only from Eject)
- Historically came from
eject_runCPT. - Now: the POs we list are CPT
eject_powhere meta_po_numberexists (the BT number). - Minimal fields needed to render list:
- post ID (used as
po_idfor lookups) - _po_number (BT number, display it)
- _vendor_name (optional, can be shown later)
- _items JSON (for lines view) – array keyed by composite line id with
{ item, color, size, qty, order_item_ids[], order_ids[] }.
- post ID (used as
Receipts (write-only by Traxs)
- Custom table
wp_traxs_receipts:idBIGINT AI PKpo_numberVARCHAR(32)po_line_idVARCHAR(191)received_qtyINTcreated_atDATETIME DEFAULT CURRENT_TIMESTAMP
- NEVER mutate
_items; we add receipt rows and compute totals by summing.
3) REST API
All routes under
/wp-json/traxs/v1/*.
UseX-WP-Noncefor auth (WordPress nonce). Writes requiremanage_woocommerce.
-
GET /traxs/v1/pos
Returns array of POs filtered toeject_powith_po_numberset.
Shape:[ {"po_post_id":123,"po_number":"BT-40779","vendor":"SanMar","items_count":10}, ... ] -
GET /traxs/v1/po-lines?po_id=POST_ID
Returns{ "lines": [...] }. Each line:{ "po_line_id":"dt6000|lime shock|2xl", "item":"DT6000", "color":"Lime Shock", "size":"2XL", "ordered_qty":12, "received_qty":7, "order_item_ids":[...], "order_ids":[...] } -
POST /traxs/v1/receive
Body:{ "po_id": POST_ID, "po_line_id": "key", "qty": 3 }
Writes towp_traxs_receipts. Returns updated line snapshot:{ "po_id":123, "po_number":"BT-40779", "po_line":{...}, "insert_id":4567 }
4) File tree (canonical layout)
traxs/
├── traxs.php
├── assets/
│ ├── css/
│ │ ├── traxs.css
│ │ └── spa-modal.css
│ └── js/
│ └── app.js
└── includes/
├── class-traxs-assets.php
├── class-traxs-install.php
├── class-traxs-eject-bridge.php
├── class-traxs-rest-pos.php
└── class-traxs-rest-receive.php
5) Build order
- Bootstrap: traxs.php
- Install: dbDelta table
- Assets: enqueue CSS globally
- Bridge: query eject_po
- REST: pos + po-lines + receive
- SPA: routes /#/ /#/pos /#/receive
- CSS: dark layout, stacked buttons, no white
6) Security & testing
- Nonce-gated REST.
- Capability
manage_woocommercefor writes. - Validate qty > 0.
- Clamp to remaining on both client + server.
7) Acceptance tests
- Activate → table created.
- /traxs/ loads SPA.
- Home screen: 3 buttons.
- POs list: shows at least one PO.
- Receive screen works.
- Permissions enforced.
Releases
10 releases. Each count is every asset in that release; expand a row for the breakdown.