Client Orders Panel
Restricted WordPress/WooCommerce admin panel: Client role (client) with read-only access to own orders.
by Valentyna Baranova · github.com/valentynabaranovawp/client-orders-panel
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/valentynabaranovawp/client-orders-panel/archive/refs/heads/main.zipReadme
Client Orders Panel
Restricted WordPress/WooCommerce admin panel: Client role (client) with read-only access to own orders.
Features
- Role
client: onlyread+ custom capabilitycop_view_own_orders; nomanage_options, no content/order/product permissions. - Cabinet with three tabs: My Orders (list + read-only card), Profile, Help. Rest of admin is hidden and blocked.
- List and order card always filtered by
customer_idviawc_get_orders()— compatible with HPOS and legacy storage. - Guards: screen allowlist, write request blocking, deny-all AJAX (except allowlist),
wc*REST namespace blocking, capability deny-list viauser_has_cap. - Nonce on order card deep-link and Refresh status AJAX.
- Login rate limiting (5 attempts / 15 min) and cabinet requests (120/min).
- Critical event audit in
{prefix}cop_access_logtable (90-day retention). - Optional CSP:
define( 'COP_ENABLE_CSP', true );.
See SECURITY.md for threat model; RELEASE-CHECKLIST.md before release.
Installation
- Activate the plugin (requires active WooCommerce). Role and log table are created on activation.
- Assign the Client role to a user (Users → Edit → Role).
- Orders are linked to accounts via the order Customer field (
customer_id).
Filters
| Filter | Default | Description |
|---|---|---|
cop_allowed_ajax_actions |
heartbeat, cop_refresh_order_status |
Allowed AJAX actions for clients |
cop_allowed_write_pages |
profile.php |
Admin pages where clients may POST |
cop_login_max_attempts |
5 |
Login attempts before lockout |
cop_login_lockout_seconds |
900 |
Login lockout duration |
cop_cabinet_rate_limit |
120 |
Admin requests per minute for clients |
cop_audit_retention_days |
90 |
Audit log retention |
cop_enable_csp / cop_csp_policy |
disabled | CSP enable and policy |
Uninstall
uninstall.php moves client users to customer, removes the role and options. Log table is dropped only when COP_REMOVE_DATA = true is defined in wp-config.php.