Create unlimited decks and register card images, upright meanings, reversed meanings, keywords, and Yes/No/Maybe metadata.
Hedomi Tarot
Build interactive tarot spreads, personalize readings with AI, and sell reading credits through WooCommerce.
This manual is based on the source code supplied for version 0.3.0. It covers decks, cards, spreads, OpenAI settings, paid readings, credit behavior, publishing, privacy, troubleshooting, and extension points.
Contents
1. Overview
Hedomi Tarot is an independent WordPress plugin for creating tarot decks, registering cards and meanings, designing interactive spreads, generating traditional or AI-personalized interpretations, and selling access to individual spreads through WooCommerce reading credits.
1.1 Included features
Add unlimited positions, name each position, write its context, and drag cards to set X and Y coordinates.
Let visitors select cards, generate them automatically on the server, or offer both options.
Use the visitor question, card, position, orientation, keywords, and administrator-written meanings to create a connected reading.
Connect a spread to a product, grant credits after payment, and consume one credit after a successful reading.
Keep the traditional interpretation available when OpenAI is unavailable, according to the configured AI behavior.
- Optional visitor question.
- Optional reversed cards with configurable probability.
- Card-style or tab-style results.
- Configurable card-back image, card width, colors, instructions, and button labels.
- AI response language, tone, length, practical guidance, synthesis, and additional instructions.
- AI consent notice, privacy text, disclaimer, diagnostics, and hourly visitor limit.
- Free or paid access configured separately for each spread.
- Multiple reading credits per purchased product quantity.
- Automatic customer return to the tarot page after checkout.
- Administrator payment bypass for previews and configuration tests.
- AJAX nonce validation and server-side verification that selected cards belong to the configured deck.
1.2 Not yet included
- Ready-made commercial deck artwork or copyrighted card texts.
- CSV or JSON deck import and export.
- Shared credit wallets across different spreads.
- Recurring subscription products and automatic monthly credit renewal.
- Customer reading history.
- PDF generation and email delivery.
- Built-in presets such as Celtic Cross or Horseshoe.
- Frontend credit purchase quantity selector inside the spread panel.
2. Requirements and installation
2.1 Requirements
| Component | Status | Notes |
|---|---|---|
| WordPress 6.2 or newer | Required | Declared in the plugin header. |
| PHP 7.4 or newer | Required | Declared in the plugin header. |
| WooCommerce | Optional | Required only for paid spreads and reading credits. |
| OpenAI API account | Optional | Required only for AI-personalized interpretations. ChatGPT subscriptions and API billing are separate. |
| SSL/HTTPS | Recommended | Strongly recommended for checkout, login, API use, and personal-data handling. |
2.2 Installation
- In WordPress, open Plugins → Add New Plugin → Upload Plugin.
- Select the Hedomi Tarot 0.3.0 ZIP file.
- Click Install Now, then Activate.
- Open Hedomi Tarot → Decks and create a deck.
- Create cards and assign them to the deck.
- Create a spread and insert its shortcode on a WordPress page.
- Configure AI and WooCommerce only after the traditional reading works correctly.
2.3 Updating
- Back up the database and plugin files before replacing a version.
- Use WordPress's replace-current-version option when uploading the new ZIP.
- Do not delete decks, cards, or spreads before updating; they are stored in the WordPress database.
- After updating, clear page cache, object cache, and browser cache.
- Retest one free spread, one AI spread, and one paid customer checkout.
3. Quick start
- Create one deck.
- Create at least three published cards and assign all of them to that deck.
- Add a Featured Image, upright meaning, and reversed meaning to each card.
- Create a spread with three positions.
- Select the deck and choose manual, automatic, or both selection modes.
- Publish the spread.
- Copy the generated shortcode, for example
[hedomi_tarot id="123"]. - Paste the shortcode into a page and test the traditional reading.
- Configure OpenAI under Hedomi Tarot → AI Settings, if required.
- Create and connect a WooCommerce product if the spread will be paid.
4. Decks and cards
4.1 Creating a deck
- Open Hedomi Tarot → Decks.
- Enter a deck name and optional description.
- Save the deck.
Decks are stored as the hedomi_tarot_deck taxonomy. A spread uses one selected deck, and the server verifies that every selected card belongs to it.
4.2 Creating cards
- Open Hedomi Tarot → Cards → Add New.
- Use the post title as the card name.
- Set the card artwork as the Featured Image.
- Assign the card to a deck.
- Write the upright meaning.
- Write the reversed meaning.
- Add optional keywords.
- Select Yes, No, or Maybe when this metadata is useful.
- Publish the card.
If a reversed meaning is empty, the plugin falls back to the upright meaning when the card is selected in reversed orientation.
4.3 Image guidelines
- Use one consistent aspect ratio across the complete deck.
- Keep card artwork large enough for high-density screens, but compress it for web delivery.
- Use WebP or optimized JPEG where transparency is not required.
- Add meaningful Media Library alternative text.
- Use only artwork that you own or are licensed to distribute.
- The separate card-back image is configured in the spread settings.
5. Creating spreads
A spread controls the deck, the number and location of cards, selection behavior, result format, appearance, AI use, and payment access.
5.1 Spread settings
| Field | Purpose |
|---|---|
| Deck | Selects the card source for the spread. |
| Selection mode | Manual, automatic, or both. |
| Allow reversed cards | Enables reversed orientation. |
| Reversed chance | Percentage chance from 0 to 100 for each selected card. |
| Result layout | Reading cards or tabs. |
| Card width | Frontend card width, constrained by the plugin to 70–240 pixels. |
| Accent color | Main interactive color for the spread. |
| Background color | Spread section background. |
| Card back | Image shown before cards are revealed. |
| Reveal button text | Custom label for generating the reading. |
| Shuffle button text | Custom label for restarting or shuffling. |
| Use AI personalized interpretations | Allows this spread to use the global AI configuration. |
| Access type | Free reading or paid with WooCommerce credit. |
| WooCommerce product | Product that grants credits for this spread. |
| Credits per purchased quantity | Credits granted for each purchased product unit. |
| Purchase button text | Label shown in the locked reading panel. |
| Locked reading message | Message shown when a customer has no reading credit. |
| Instructions | Introductory guidance displayed to visitors. |
5.2 Positions
Add one row for each card required by the reading.
| Position field | Meaning |
|---|---|
| Position name | Human-readable label such as Past, Present, Future, Challenge, or Advice. |
| Context / question | Explains what this position represents. It is also sent to the AI when personalization is active. |
| X % | Horizontal center position inside the spread area. |
| Y % | Vertical center position inside the spread area. |
| Rotation | Visual rotation in degrees. |
| Row order | Controls position order and reveal order. |
5.3 Visual editor
The visual layout preview allows the administrator to drag the position cards. The plugin updates the X and Y percentages automatically. Use the table fields for precise adjustments and rotation.
Example: three-card spread
| Name | Context | X | Y | Rotation |
|---|---|---|---|---|
| Past | What shaped the current situation | 20 | 50 | -4 |
| Present | The central energy now | 50 | 50 | 0 |
| Future | The direction currently developing | 80 | 50 | 4 |
6. AI personalized readings
AI personalization is optional. Traditional card meanings remain part of the plugin and can be used without an API key.
6.1 Saving the API key
- Create an API key in the OpenAI API platform.
- Open Hedomi Tarot → AI Settings.
- Paste the key into OpenAI API key.
- Click Save API key.
- Confirm that the page reports a saved key and its storage source.
- Click Save and run real API test.
The key is stored separately in the non-autoloaded WordPress option:
hedomi_tarot_openai_api_keyFor stronger separation from the database, define a non-empty constant in wp-config.php:
define(
'HEDOMI_TAROT_OPENAI_API_KEY',
getenv( 'OPENAI_API_KEY' )
);A non-empty constant overrides the database key. An empty constant does not prevent the plugin from using the saved database value.
6.2 AI settings
| Setting | Purpose |
|---|---|
| Enable AI readings | Global switch for personalized generation. |
| Model | Responses API model name. The current build defaults to gpt-5.6-luna, but the field is intentionally configurable. |
| Response language | Automatic or a selected language: English, Portuguese, Spanish, German, Russian, French, or Italian. |
| Tone | Warm and reflective, direct and practical, gentle and spiritual, or professional and neutral. |
| Maximum output tokens | Controls the maximum response length, from 500 to 6000. |
| Use AI only with a question | Avoids API generation when the visitor leaves the question field empty. |
| Include practical guidance | Adds a practical reflection for each card. |
| Include overall synthesis | Adds a connected reading and closing reflection. |
| Traditional fallback | Shows saved meanings when generation fails. |
| Hourly limit per visitor | Plugin-level control for API cost and abuse. Use 0 to disable this limit. |
| Additional instructions | Optional brand voice or interpretation rules, limited to 3000 characters. |
| Require consent | Requires the visitor to confirm that the question and cards may be sent to OpenAI. |
| Privacy notice | Explains external data processing. |
| Consent label | Text displayed next to the consent checkbox. |
| Reading disclaimer | Disclaimer displayed with the personalized result. |
6.3 Reading behavior
The plugin sends one request for the complete spread. The request includes:
- visitor question;
- spread title;
- card names;
- upright or reversed orientation;
- position names and contexts;
- keywords and Yes/No/Maybe metadata;
- the traditional meanings written by the site administrator.
The AI is instructed to treat the administrator's card meanings as authoritative, relate every card to the exact question and position, avoid guaranteed predictions, and return structured content for each position plus an optional overall synthesis.
6.4 Diagnostics
The real connection test makes a small generation request. It verifies the key, model, billing/quota, Responses API access, and outbound connection from the WordPress host.
| Diagnostic | Meaning |
|---|---|
insufficient_quota | The key was recognized, but the API project lacks usable credit or billing. |
invalid_api_key | The key is invalid, incomplete, revoked, or belongs to the wrong project. |
model_not_found | The selected model is unavailable to the project or the name is incorrect. |
rate_limit_exceeded | The API usage or request limit was reached. |
| HTTP timeout / connection error | The host may block external requests, DNS may have failed, or the connection exceeded the timeout. |
The diagnostic panel stores sanitized information such as time, context, HTTP status, OpenAI error code, and request ID. It does not display the secret key.
7. WooCommerce payments and reading credits
Version 0.3.0 supports the model one WooCommerce product purchase grants one or more credits for one spread. Every completed reading uses one credit.
7.1 Creating the WooCommerce product
- Install and activate WooCommerce.
- Open Products → Add New.
- Create a Simple product.
- Enable Virtual.
- Set the price.
- Publish the product.
A simple, virtual, in-stock product can be added directly to checkout from the spread purchase button. Other product types send the visitor to the product page.
7.2 Connecting a spread to the product
- Edit the tarot spread.
- Find Payment and reading credits.
- Set Access type to Paid with WooCommerce credit.
- Select the WooCommerce product.
- Set Credits per purchased quantity.
- Edit the purchase button and locked message when needed.
- Update the spread.
Example:
Product quantity: 3
Credits per purchased quantity: 2
Credits granted: 3 × 2 = 6 readings7.3 Customer flow
The order return URL is restricted to the same website host. After checkout, the plugin appends hedomi_tarot_purchase=success to the tarot page URL.
7.4 Reading-credit rules
- Credits belong to a specific customer and a specific spread.
- Credits are granted only once per WooCommerce order.
- Product quantity multiplies the configured credits per purchase.
- One successful reading consumes one credit.
- A temporary two-minute user/spread lock prevents simultaneous requests from consuming the same balance.
- Administrators with
manage_optionsbypass payment and do not consume credits. - If AI was attempted and failed, the plugin releases the lock and keeps the credit.
- If AI is not required or succeeds, the generated reading consumes the credit.
- Order notes record every credit grant and the resulting balance.
Credit storage
The balance is stored in WordPress user metadata:
_hedomi_tarot_credits_SPREADIDFor example, the balance for spread ID 123 is stored under _hedomi_tarot_credits_123.
7.5 Testing payments
- Do not test the paid customer flow while logged in as an administrator; administrators bypass payment.
- Use a non-administrator test account or a private browser window.
- Enable a WooCommerce test payment method or gateway sandbox.
- Buy the linked product.
- Confirm the customer returns to the tarot page.
- Open the WooCommerce order and verify the Hedomi Tarot credit note.
- Generate one reading and confirm that the visible balance decreases by one.
- Attempt a second reading when no credit remains and confirm the purchase panel returns.
Manual credit inspection
Developers can inspect the user metadata in the database or with WP-CLI. Direct database changes should be made only with a backup and an understanding of the spread-specific metadata key.
8. Publishing and frontend experience
8.1 Shortcode
[hedomi_tarot id="123"]Replace 123 with the published spread ID. The shortcode can be used in the block editor, classic editor, shortcode widgets, Elementor shortcode widgets, and most page builders that execute WordPress shortcodes.
8.2 Card selection
- Manual: the visitor selects the required number of unique cards.
- Automatic: the server shuffles the valid deck card IDs and selects the required amount.
- Both: the interface provides the supported manual and automatic paths.
The server rejects duplicate selections, the wrong number of cards, unpublished spreads, cards from another deck, and decks that contain fewer cards than the spread requires.
8.3 Results
Every reading can include:
- spread title and visitor question;
- card image, name, orientation, position, and position context;
- traditional meaning and keywords;
- AI-personalized interpretation and practical guidance;
- overall synthesis, closing reflection, and disclaimer;
- AI availability notice;
- payment notice and remaining credits;
- purchase button when another credit is required.
9. Customization
Most common visual options are configured separately for each spread:
- card-back image;
- card width;
- accent and background colors;
- instructions;
- reveal and shuffle button labels;
- purchase button label and locked message;
- position names, descriptions, coordinates, and rotation;
- result layout.
9.1 CSS customization
Add custom CSS in a child theme or a dedicated CSS plugin rather than editing Hedomi Tarot files directly. Inspect the frontend output to target the hedomi-tarot class namespace.
9.2 Translation
The plugin uses the hedomi-tarot text domain. Interface strings can be translated with WordPress translation tools. Text fields saved in the spread and AI settings are controlled directly by the site administrator.
10. Security, privacy, and copyright
10.1 Security measures in this build
- Reading AJAX uses a WordPress nonce.
- Spread IDs, card IDs, product IDs, and numeric settings are sanitized.
- Selected cards are validated against the configured deck.
- Paid AJAX requests verify login and available credit on the server.
- Credit granting is marked on the order to prevent duplicate grants.
- A temporary user/spread lock reduces simultaneous-credit consumption.
- Return URLs are limited to the same website host.
- The API key is not sent to the frontend.
10.2 Personal data
Depending on the enabled features, the website can process:
- visitor questions;
- selected cards and generated interpretations;
- anonymous visitor identifiers used for hourly limits;
- WordPress account information;
- WooCommerce order and billing data;
- spread-specific user credit balances.
When AI is enabled, the question and reading context are sent to OpenAI. Update the site's privacy notice and collect consent where required.
10.3 Copyright
Do not distribute copyrighted deck artwork or interpretations without permission. The fact that a deck is widely available online does not automatically make it public domain.
11. Troubleshooting
| Problem | Checks |
|---|---|
| The shortcode displays an unavailable message | Confirm the spread is published and the shortcode ID is correct. |
| The deck does not contain enough cards | Publish at least as many deck cards as the number of spread positions. |
| Cards cannot be selected | Confirm the selection mode, card publication status, deck assignment, and JavaScript console. |
| AI key appears not to save | Click Save API key, reload the page, and check the displayed key ending and storage source. A quota error confirms that a saved key was read and authenticated. |
insufficient_quota | Add or activate OpenAI API billing/credits for the project. ChatGPT Plus does not supply API quota. |
| Traditional meanings appear instead of AI | Review Last API diagnostic, confirm AI is globally enabled and enabled on the spread, and verify consent and hourly limit. |
| WooCommerce product is not available in the spread | Activate WooCommerce and publish a product. |
| The customer sees the purchase panel after paying | Confirm the customer is logged into the account linked to the order, the order reached Payment Complete, Processing, or Completed, and the product is linked to the same spread. |
| Credits were not granted | Open the order notes. Confirm the order has a WordPress user ID or an email matching a WordPress account. |
| Credits were granted twice | Check whether the order meta _hedomi_tarot_credits_granted was removed or modified. The normal flow grants only once. |
| Admin cannot test the purchase lock | Administrators intentionally bypass payment. Test with a normal customer account. |
| Another request is being processed | Wait for the two-minute lock to expire or finish the first request. This protects the balance from parallel consumption. |
| Credit is not consumed after AI failure | This is intentional in version 0.3.0 when AI was attempted and failed. |
| Checkout does not create an account | Confirm the cart includes a product connected to a paid Hedomi Tarot spread and no checkout customization overrides the WooCommerce registration filters. |
| Return after payment goes to the wrong page | Start checkout from the spread purchase button and confirm caching or a gateway plugin is not replacing the WooCommerce return URL. |
11.1 Support checklist
- WordPress, PHP, WooCommerce, and Hedomi Tarot versions.
- Spread ID and linked product ID.
- Whether the tester is administrator or customer.
- Order number and order status.
- Order notes related to Hedomi Tarot.
- Visible customer credit balance.
- Last API diagnostic status and code.
- Browser console errors and WordPress debug-log entries.
12. Technical reference
12.1 Plugin structure
| Path | Responsibility |
|---|---|
hedomi-tarot.php | Plugin header, constants, bootstrap, and activation hook. |
class-hedomi-tarot-plugin.php | Loads classes and initializes post types, AI settings, WooCommerce, admin, and frontend. |
class-hedomi-tarot-post-types.php | Registers cards, spreads, and deck taxonomy. |
class-hedomi-tarot-admin.php | Card fields, spread settings, visual builder, media controls, payment fields, and metadata saving. |
class-hedomi-tarot-frontend.php | Shortcode rendering, access panel, card selection, AJAX reading generation, AI merging, and credit consumption. |
class-hedomi-tarot-ai-settings.php | API key storage, settings page, real connection test, and diagnostics. |
class-hedomi-tarot-ai.php | OpenAI Responses API request, structured output, prompts, sanitization, and rate control. |
class-hedomi-tarot-woocommerce.php | Purchase URLs, checkout account rules, order context, credit grants, balance, locks, consumption, and return URL. |
class-hedomi-tarot-helpers.php | Spread configuration, sanitization, deck-card lookup, and card meanings. |
assets/js/frontend.js | Frontend interactions, AJAX requests, results, AI notices, and payment-balance updates. |
assets/js/admin.js | Position rows, drag-and-drop preview, media selection, and admin interactions. |
12.2 Data storage
| Data | Storage |
|---|---|
| Cards | Custom post type hedomi_tarot_card. |
| Spreads | Custom post type hedomi_tarot_spread. |
| Decks | Taxonomy hedomi_tarot_deck. |
| AI settings | Option hedomi_tarot_ai_settings. |
| API key | Separate option hedomi_tarot_openai_api_key, unless overridden by HEDOMI_TAROT_OPENAI_API_KEY. |
| Last AI diagnostic | Option hedomi_tarot_ai_diagnostic. |
| Customer credit | User meta _hedomi_tarot_credits_SPREADID. |
| Credit lock | User meta _hedomi_tarot_credit_lock_SPREADID. |
| Granted-order marker | Order meta _hedomi_tarot_credits_granted. |
| Spread context on order item | Order-item meta _hedomi_tarot_spread_id. |
| Return URL on order item | Order-item meta _hedomi_tarot_return_url. |
Main card metadata
_hedomi_tarot_normal_meaning
_hedomi_tarot_reversed_meaning
_hedomi_tarot_keywords
_hedomi_tarot_yes_noMain payment metadata on a spread
_hedomi_tarot_payment_mode
_hedomi_tarot_product_id
_hedomi_tarot_credits_per_purchase
_hedomi_tarot_purchase_button_text
_hedomi_tarot_purchase_message12.3 Hooks
| Hook | Type | Purpose |
|---|---|---|
hedomi_tarot_user_can_read | Filter | Allows external code to deny a reading before cards are generated. |
hedomi_tarot_bypass_payment | Filter | Customizes payment bypass. Administrators bypass by default. |
hedomi_tarot_reading_generated | Action | Runs after a successful reading payload is prepared. |
hedomi_tarot_credits_granted | Action | Runs when credits are added to a user's spread balance. |
hedomi_tarot_credit_consumed | Action | Runs after one reading credit is consumed. |
Access-control example
add_filter(
'hedomi_tarot_user_can_read',
function ( $allowed, $spread_id, $user_id ) {
if ( 123 === (int) $spread_id && ! $user_id ) {
return false;
}
return $allowed;
},
10,
3
);13. Suggested roadmap
| Feature | Status | Recommended direction |
|---|---|---|
| Traditional readings | Included | Continue improving position-specific meanings. |
| AI personalization | Included | Add usage analytics and per-spread prompt presets. |
| Single-spread WooCommerce credits | Included | Add customer-facing credit history. |
| Shared credit packages | Planned | One wallet usable across selected spreads. |
| Subscriptions | Planned | Grant credits on successful recurring renewal. |
| Reading history | Planned | Save question, cards, result, date, and remaining balance in My Account. |
| PDF and email | Planned | Generate branded reports and email them to customers. |
| Deck import/export | Planned | Use validated JSON/CSV packages with image-mapping support. |
14. Release notes
Version 0.3.0
- Free or paid access for each spread.
- WooCommerce product connection.
- Credits per purchased product quantity.
- Required checkout account registration for tarot products.
- Idempotent credit grant on payment complete, Processing, or Completed status.
- Spread-specific customer credit balances.
- One-credit consumption after a successful reading.
- Temporary credit lock against simultaneous requests.
- Credit retention when required AI personalization fails.
- Return to the tarot page after checkout.
- Administrator preview bypass.
Version 0.2.3
- Dedicated OpenAI API key storage.
- Migration from previous settings-array storage.
- Real API generation test and sanitized diagnostics.
- AI personalization per card, practical guidance, synthesis, privacy consent, fallback, and hourly limit.
Version 0.1.0
- Decks, cards, spreads, visual position builder, manual and automatic selection, reversed cards, result layouts, shortcode, and secure reading AJAX.