WP Manifestindependent plugin directory
manifest / ecommerce / wg-temporal-access

GW Temporal Access

Genera accesos temporales de 1 hora tras una compra en WooCommerce. Consulta directa a DB.

★ 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/jeduvalenzuela/wg-temporal-access/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.

Plugin 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

  1. Drop the plugin folder into wp-content/plugins/.
  2. Activate the plugin from the WordPress admin Plugins screen.
  3. 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_URL constant and a token query 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_postmeta where meta_key = _gw_temporal_token).
  • 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_URL is a constant; update it to point to your delivery/landing URL.

License

Use and modify as needed. No license attached by default.