Contents

AI Generator — Plugixa Recipe

The AI Generator creates complete recipes — including title, description, ingredients, grouped instructions, nutrition, and tags — from three kinds of input:

  • Topic — free-form text (“Vegan weeknight pasta with mushrooms”).
  • URL — any web page with a recipe; the scraper extracts it and the LLM rewrites.
  • Document — a PDF or DOCX file with a recipe inside.

Providers supported: OpenAI (GPT-4 family) and Google Gemini. Plug in your key, pick a model, and generate.

Configure an AI provider

Navigate to Settings → AI.

AI settings tab

  • Provider: openai or gemini.
  • API key: your secret key (stored encrypted in the plugixarecipe_settings option).
  • Model: e.g., gpt-4o-mini, gpt-4o, gemini-1.5-flash, gemini-1.5-pro.
  • Max tokens: upper limit on the response (the plugin auto-scales this for “expanded” prompts).
  • Temperature: creativity level (0–1).

Save. You can now use the generator.

Generating from a topic

Navigate to Recipes → AI Generator.

AI generator main screen

Pick the Topic tab, type a prompt, choose how many recipes you want (1–10), and click Generate.

Keyword-focused topic generation

The LLM is instructed to return a structured JSON payload. The plugin:

  1. Validates the JSON shape.
  2. Auto-repairs common truncation issues (missing closing brackets).
  3. Maps fields into a recipe preview.

Generated result

Import

Review the result. If you like it, click Import — the recipe is written to the database as draft with source = "ai" on the nutrition row.

Imported recipe confirmation

Generating from a URL

Pick the URL tab, paste any recipe page, click Generate.

URL generation

Under the hood:

  1. URLScraper fetches the page, strips navigation / ads / headers.
  2. The content is passed to the LLM with a “re-express as a clean recipe” prompt.
  3. Images / videos from the source are proposed for import.

URL generation success

Respect the source’s copyright — the plugin outputs a source_url field pointing at the original so you don’t accidentally publish scraped content as your own.

Generating from a document

Pick the Document tab, upload a PDF or DOCX.

Document upload

The plugin uses smalot/pdfparser (for PDF) and a DOCX unzipper to extract text, then hands the text to the LLM.

Document result

Common use case: migrating a Cookbook PDF into individual recipes.

Quota & errors

If your provider returns quota / auth errors, the plugin surfaces the exact message:

Quota error

Retry after resolving the provider issue. The plugin does not charge or gate beyond the Pro license — your usage is billed directly by OpenAI / Google.

Hooks (developer)

// Mutate recipes before import (e.g., inject house style).
add_filter('plugixarecipe_ai_generated_recipes', function ($recipes, $topic, $provider) {
    foreach ($recipes as &$r) {
        $r['author_name'] = 'Test Kitchen';
    }
    return $recipes;
}, 10, 3);

// Log every AI generation.
add_action('plugixarecipe_after_ai_generate', function ($recipes, $topic, $provider) {
    error_log("Generated " . count($recipes) . " recipes from {$provider} for \"{$topic}\"");
}, 10, 3);

// Customize provider config (e.g., org header for OpenAI).
add_filter('plugixarecipe_ai_provider_config', function ($config, $provider_name) {
    if ($provider_name === 'openai') {
        $config['organization'] = 'org-...';
    }
    return $config;
}, 10, 2);

See HOOKS for the full list.

Privacy

  • Your content is sent to the provider you choose (OpenAI or Google). Both have data-policy options — enable “no training” in your provider dashboard if needed.
  • The plugin does not transmit data to Plugixa’s servers — all AI calls are direct from your WordPress to the LLM provider.
  • API keys are stored in the WordPress options table. Protect wp-options access like you would any other sensitive WP data.

Quick Links