Install
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/jeduvalenzuela/wg-temporal-access/archive/refs/heads/main.zipPlugin Name: GW Temporal Access Description: Generates 1-hour temporary access tokens after a WooCommerce purchase. Stores JSON in postmeta and provides REST endpoints for inspection and validation. Version: 1.0.0 Author: Eduardo Valenzuela
Description
This small WordPress plugin generates a temporary access token when an order is completed in WooCommerce. The token and related metadata (email, expiry, order ID, state) are stored as a JSON string in the order's postmeta under the key _gw_temporal_token.
Installation
- Drop the plugin folder into
wp-content/plugins/. - Activate the plugin from the WordPress admin Plugins screen.
- Ensure WooCommerce is installed and active.
Usage
- After an order completes, the plugin generates a 32-char token valid for 1 hour.
- The token URL is built from the
DELIVERY_URLconstant and atokenquery parameter. - The access link is shown on the Thank You page and included in the "customer completed order" email.
REST API Endpoints
All routes are under the namespace: /wp-json/gw-temporal-access/v1/
-
GET /db-list-tokens- Returns a list of all stored tokens (reads
wp_postmetawhere meta_key =_gw_temporal_token).
- Returns a list of all stored tokens (reads
-
GET /db-check-email?email=you@example.com- Returns tokens associated with the provided email address. Validates and indicates whether there are active tokens.
-
GET /db-validate-token?token=THE_TOKEN- Validates a specific token, checks expiry and returns token details if valid.
Notes
- This plugin reads postmeta directly for the REST endpoints. For large databases or production use, consider adding pagination, caching, or safer query patterns.
DELIVERY_URLis a constant; update it to point to your delivery/landing URL.
License
Use and modify as needed. No license attached by default.