Skip to content

Install and set up

Requirements

  • WordPress 6.0 or newer and PHP 7.4 or newer (8.x recommended).
  • Pretty permalinks switched on (for example /%postname%/). Keystone's REST routes live under /wp-json/og-keystone/v1.
  • For selling: WooCommerce and a payment gateway of your choice. Easy Digital Downloads is supported as an optional add-on.
  • The PHP sodium extension (for signed answers and encrypted key recovery).
  • Do not let a page cache serve a page that contains [ogk_account] to logged-in users. Most caching plugins skip logged-in users by default.

Install the plugin

  1. Back up the site.
  2. Plugins > Add New > Upload Plugin, choose the OG Keystone zip, install and activate.
  3. Open OG Keystone in the admin menu. The Dashboard loads first.

Add the secrets to wp-config.php

Secrets go in wp-config.php, never in the database or the screens. Generate each value once and keep a copy in your password manager.

// Recovery encryption key: lets Keystone show a customer their key and store connector secrets.
define('OG_KEYSTONE_ENC_KEY', '<long random string>');

// Optional but recommended: keyed hash for licence key lookup.
define('OG_KEYSTONE_HASH_SECRET', '<long random string>');

// Release files outside the web root (strongly recommended).
define('OG_KEYSTONE_RELEASES_DIR', '/var/www/ogk-releases');
Constant Purpose
OG_KEYSTONE_ENC_KEY Encrypts recoverable licence keys and webhook / connector secrets. Without it a customer can never be shown their key again. Losing it loses those keys; back it up.
OG_KEYSTONE_HASH_SECRET Makes licence key lookup hashes an HMAC. Older plain hashes are re-hashed on first use once set.
OG_KEYSTONE_RELEASES_DIR Folder for release files. Put it outside the web root.
OG_KEYSTONE_SIGNING_SECRET / OG_KEYSTONE_SIGNING_PUBLIC Ed25519 key pair for signed answers. Plugins check answers with the public key.
OG_KEYSTONE_S3_KEY / OG_KEYSTONE_S3_SECRET Access key for S3-compatible download storage.
OG_KEYSTONE_RUN_AS standalone, server or connector (also set in Settings > Connectors).
OG_KEYSTONE_SERVER_URL, OG_KEYSTONE_CONNECTOR_KEY, OG_KEYSTONE_CONNECTOR_SECRET Connector-mode credentials. See Run modes.

The full list is in the Reference.

First-run checklist

  1. Settings > Security: confirm the recovery encryption key is detected.
  2. Downloads: check there is no red storage warning. A red banner means release files can be fetched without a licence; set OG_KEYSTONE_RELEASES_DIR.
  3. Products and tiers: create your product and its tiers.
  4. Settings > Customer portal: decide what customers may see and do (see Portal).
  5. Put [ogk_account] on a page, or enable the My Account Licences tab.
  6. Place a test order (a free or tiny order) and check the licence, the email and the order note. Refund it and check everything is taken back.
  7. Check the log (Logs) shows the order events.

Upgrade, backup and uninstall

  • Back up the database and the releases folder, plus the values of the constants above. Without OG_KEYSTONE_ENC_KEY encrypted keys cannot be recovered.
  • Upgrade by uploading the new zip over the old plugin (or through your deployment process). Database migrations run automatically on load. Never auto-update a plugin on a live shop without testing it first.
  • Uninstall: deleting the plugin only clears its scheduled jobs and keeps all data, unless og_keystone_remove_data_on_uninstall is true, in which case its tables and options are removed too.

Scheduled jobs

The plugin uses WordPress cron: expiring memberships daily, granting tier allowances and expiring credit hourly, subscription checks, and the connector order retry queue. On a busy shop set up a real system cron calling wp-cron.php rather than relying on visitor traffic.