Opens in a new tab
Deliver toTennessee
0 0 0Cart
Get a Project Quote

Athenian Batch AI Image Generation

v0.1.0 October 6, 2026
Batch-oriented AI image generation workflows for product and catalog operations.

Overview

Product overview

Plugin: Athenian Batch Image Generation Version inspected: 0.1.0 Platform: WordPress 6.4+ PHP requirement: PHP 8.0+ Primary use case: Batch AI image creation from manual prompts, CSV imports, or AI-planned prompt rows, with generated images stored in the WordPress Media Library and bundled into downloadable ZIP archives.

---

Batch image-generation job and queue management.
WooCommerce-aware product and image-processing integration surfaces.
Admin, frontend, ZIP, and notifier workflows documented from source.
A clean baseline for later provider, artifact, and cost-control verification.

Use cases

  • Product imagery
  • Catalog enrichment
  • Batch creative workflows
  • Image generation operations

Developer

Developer starting point

This baseline documents the reviewed batch-image architecture. It does not claim that an external AI request, generated image, ZIP artifact, or product-media mutation has been exercised.

User Workflow

  1. A user visits a page containing the [athenian_batch_image_generation] shortcode.
  2. The user creates prompt rows manually, imports a CSV, or uses the AI Batch Planner.
  3. The user submits the batch with a batch name and notification email.
  4. The plugin creates a job record and one job item per prompt row.
  5. A queue worker processes pending job items through the OpenAI Images API.
  6. Successful image bytes are imported into the WordPress Media Library.
  7. Completed images are bundled into a ZIP archive.
  8. The requester receives an email when the batch is finished.
  9. Administrators can view recent batches and manually run the queue from wp-admin.

---

Technical Architecture

Bootstrap File

athenian-batch-image-generation.php defines plugin metadata, constants, activation/deactivation hooks, and loads the plugin classes.

Defined constants:

ABIG_VERSION
ABIG_PLUGIN_FILE
ABIG_PLUGIN_DIR
ABIG_PLUGIN_URL

Activation behavior:

  • Creates or updates custom database tables through ABIG_Repository::install().
  • Seeds default settings through ABIG_Settings::maybe_seed_defaults().

Deactivation behavior:

  • Unschedules the recurring abig_process_queue cron event.

Primary Classes

| File | Responsibility | | --- | --- | | includes/class-abig-plugin.php | Main service container, component wiring, cron registration, lifecycle coordination. | | includes/class-abig-settings.php | Settings defaults, registration, sanitization, and retrieval. | | includes/class-abig-repository.php | Custom table creation, job persistence, item persistence, status updates, job refresh logic. | | includes/class-abig-openai-client.php | OpenAI Responses API planner calls and OpenAI Images API generation calls. | | includes/class-abig-processor.php | Queue execution, image generation orchestration, Media Library sideloading, finalization. | | includes/class-abig-zip-builder.php | ZIP archive generation for completed image batches. | | includes/class-abig-notifier.php | Completion email creation and delivery. | | includes/class-abig-admin.php | wp-admin settings page, queue button, and recent batch table. | | includes/class-abig-shortcode.php | Frontend shortcode rendering, batch submission handling, AI planner AJAX endpoint. |

Asset Files

| File | Responsibility | | --- | --- | | assets/js/frontend.js | CSV parsing, row management, AI planner request handling, frontend table population. | | assets/js/admin.js | Manual queue processing button behavior in wp-admin. | | assets/css/frontend.css | Frontend shortcode layout and visual styling. | | assets/css/admin.css | Admin dashboard layout and visual styling. |

---

Custom Database Tables

The plugin creates two custom tables using dbDelta().

wp_abig_jobs

Stores batch-level information.

| Column | Purpose | | --- | --- | | id | Primary batch/job ID. | | batch_name | Human-readable batch name. | | requester_email | Email address for completion notification. | | requester_user_id | WordPress user ID when submitted by a logged-in user. | | status | Batch lifecycle status. | | source | Submission source, currently shortcode. | | total_items | Number of prompt rows in the batch. | | completed_items | Count of successfully generated images. | | failed_items | Count of failed rows. | | zip_path | Server path to ZIP archive. | | zip_url | Public URL to ZIP archive. | | completion_notified | Whether the completion email has been sent. | | started_at | First processing timestamp. | | completed_at | Completion timestamp. | | created_at | Creation timestamp. | | updated_at | Last update timestamp. |

Indexes:

  • Primary key on id.
  • Index on status.
  • Index on requester_email.

wp_abig_job_items

Stores one row per requested image.

| Column | Purpose | | --- | --- | | id | Primary item ID. | | job_id | Parent batch/job ID. | | row_index | Original row order. | | prompt | Main image prompt. | | negative_prompt | Optional negative prompt. | | size | Requested image size. | | quality | Requested image quality. | | background | Background mode. | | output_format | Output file format. | | filename | Desired extension-free filename. | | status | Item lifecycle status. | | attachment_id | WordPress Media Library attachment ID. | | generated_url | Final generated image URL. | | remote_request_id | OpenAI request ID, when returned. | | error_message | Stored failure message for failed rows. | | item_meta | JSON metadata placeholder for future extensions. | | created_at | Creation timestamp. | | updated_at | Last update timestamp. | | completed_at | Completion timestamp. |

Indexes:

  • Primary key on id.
  • Index on job_id.
  • Index on status.

---

OpenAI Integration

Planner Request

The AI Batch Planner calls:

https://api.openai.com/v1/responses

The planner model is configurable and defaults to:

gpt-4.1-mini

The plugin asks the planner to return JSON using this shape:

[
  {
    "prompt": "",
    "negative_prompt": "",
    "filename": "",
    "size": "1024x1024",
    "quality": "auto",
    "background": "auto",
    "output_format": "png"
  }
]

The response text is normalized to remove Markdown code fences before JSON parsing. Rows without a prompt are discarded.

Image Generation Request

The image worker calls:

https://api.openai.com/v1/images/generations

The image model is configurable and defaults to:

gpt-image-1

The plugin sends one generation request per job item with:

  • model
  • prompt
  • n = 1
  • size
  • quality
  • background
  • output_format
  • user = abig-job-{job_id}

The plugin expects b64_json image data, decodes it, saves it to a temporary file, and imports it into the Media Library.

Negative Prompt Handling

The plugin does not send a separate negative prompt field to the image API. Instead, it appends negative prompt guidance to the main prompt as:

Avoid: {negative_prompt}

---

Admin Settings

Default settings are stored in the abig_settings option.

| Setting | Default | Purpose | | --- | --- | --- | | openai_api_key | Empty | API key used for planner and image requests. | | image_model | gpt-image-1 | Model used for image generation. | | planner_model | gpt-4.1-mini | Model used for AI row planning. | | default_size | 1024x1024 | Default image size. | | default_quality | auto | Default quality value. | | default_background | auto | Default background mode. | | default_output_format | png | Default generated file format. | | max_rows_per_batch | 24 | Maximum rows accepted per batch. | | max_items_per_run | 3 | Maximum queue items processed per cron/manual run. | | zip_retention_days | 7 | Stored retention setting for future cleanup behavior. | | email_subject | Your Athenian image batch is ready | Completion email subject. | | email_from_name | Site name | Completion email sender name. | | email_from_address | Site admin email | Completion email sender address. |

Supported frontend/admin option values include:

| Field | Supported Values | | --- | --- | | Size | 1024x1024, 1536x1024, 1024x1536 | | Quality | auto, low, medium, high | | Background | auto, opaque, transparent | | Output format | png, jpeg, webp |

---

Hooks, Actions, and AJAX Endpoints

Shortcode

[athenian_batch_image_generation]

Cron Event

abig_process_queue

Registered schedule:

abig_every_five_minutes

The schedule runs every five minutes. On batch submission, the plugin also schedules a single event approximately 10 seconds later to begin processing promptly.

Form Submission Actions

admin_post_abig_submit_batch
admin_post_nopriv_abig_submit_batch

These allow both logged-in and logged-out submissions when the shortcode is available on a page.

Frontend Planner AJAX Actions

wp_ajax_abig_generate_prompt_rows
wp_ajax_nopriv_abig_generate_prompt_rows

These generate prompt rows from a creative brief.

Admin Queue AJAX Action

wp_ajax_abig_process_queue_now

This is protected by manage_options capability and the abig_process_queue_now nonce.

---

Security and Validation Notes

The plugin includes several important baseline safeguards:

  • Direct file access guards with ABSPATH checks.
  • WordPress nonce checks for batch submission and AJAX actions.
  • manage_options capability check for manual queue execution.
  • Sanitization for settings, prompts, email addresses, filenames, and planner output rows.
  • Use of WordPress Media Library sideloading APIs.
  • Use of wp_safe_redirect() after frontend submission.
  • API failures are captured as WP_Error objects and stored on failed rows.

Important Access-Control Considerations

The shortcode submission endpoint and AI planner endpoint both include logged-out variants. This is useful for public or customer-facing portals, but it also means page-level access control should be handled intentionally.

Recommended production options:

  • Place the shortcode behind a membership, account, or client portal page when generation should not be public.
  • Add role-based shortcode access controls if only certain users should submit batches.
  • Add rate limiting, CAPTCHA, Turnstile, or credit/account checks for public-facing use.
  • Add per-user or per-email batch history and quotas.
  • Add stronger validation against unsupported size, quality, background, or output format values server-side.

ZIP Access Consideration

ZIP files are currently written to the public uploads directory. This is convenient for download delivery, but a stricter portal may need signed URLs, expiring download tokens, or a permission-checked download endpoint.

---

Example CSV Template

prompt,negative_prompt,filename,size,quality,background,output_format
"Premium powder coating product hero image on a dark industrial workbench","blurry, distorted text, low quality","powder-hero-dark-industrial","1024x1024","high","opaque","png"
"Transparent-background product cutout of a powder coating sample jar","shadow artifacts, extra labels","powder-sample-cutout","1024x1024","high","transparent","png"
"Lifestyle image of a creator packing custom printed merchandise","messy hands, watermark, unreadable logo","creator-packaging-lifestyle","1536x1024","auto","opaque","webp"

---

Implementation Strengths

  • Clean class-based plugin structure.
  • Dedicated repository layer for custom database operations.
  • Clear separation between admin UI, frontend shortcode UI, OpenAI client, processor, ZIP builder, and notifier.
  • Queue-backed architecture instead of long-running frontend requests.
  • Media Library integration for generated assets.
  • ZIP delivery for completed batches.
  • AI planner adds value before image generation by helping teams structure prompts.
  • Configurable model, generation defaults, queue limits, and email settings.
  • Recent batch visibility in wp-admin.
  • PHP syntax verified successfully across all plugin PHP files in the inspected package.

---

Install

Source and dependencies
  • Reviewed source folder: athenian-batch-image-generation
  • Plugin version reviewed: 0.1.0
  • Local source inventory: 20 files (temporary, test, and Git metadata excluded).
  • GitHub baseline: https://github.com/Athenian-Brands/athenian-batch-image-generation at main / 71b2f14e4469e3c8b4944d4fc190393bdb514fe5.
  • WordPress and WooCommerce.
  • OpenAI or external image-provider credentials, paid requests, generated artifacts, and product-media writes require separate verification.

Configuration

Implementation reference sections
  • Technical & Marketing Overview — see the linked technical reference excerpt.
  • Executive Summary — see the linked technical reference excerpt.
  • Marketing Positioning — see the linked technical reference excerpt.
  • Core Feature Highlights — see the linked technical reference excerpt.
  • User Workflow — see the linked technical reference excerpt.
  • Technical Architecture — see the linked technical reference excerpt.
  • Custom Database Tables — see the linked technical reference excerpt.
  • Status Lifecycle — see the linked technical reference excerpt.
  • OpenAI Integration — see the linked technical reference excerpt.
  • Admin Settings — see the linked technical reference excerpt.
  • Hooks, Actions, and AJAX Endpoints — see the linked technical reference excerpt.
  • Security and Validation Notes — see the linked technical reference excerpt.
  • Operational Requirements — see the linked technical reference excerpt.
  • Example CSV Template — see the linked technical reference excerpt.

Usage

Detected extension surface
  • Shortcodes detected in local PHP source: 1
  • Static action/filter hooks detected in local PHP source: 13
  • REST route registrations detected in local PHP source: 0

Shortcodes

Detected shortcodes
  • athenian_batch_image_generation — includes/class-abig-shortcode.php

REST Endpoints

Detected REST routes
  • No register_rest_route calls were detected by the baseline scanner.

Hooks

Detected hooks
  • abig_process_queue — includes/class-abig-plugin.php
  • admin_enqueue_scripts — includes/class-abig-admin.php
  • admin_init — includes/class-abig-settings.php
  • admin_menu — includes/class-abig-admin.php
  • admin_post_abig_submit_batch — includes/class-abig-shortcode.php
  • admin_post_nopriv_abig_submit_batch — includes/class-abig-shortcode.php
  • cron_schedules — includes/class-abig-plugin.php
  • init — includes/class-abig-plugin.php
  • plugins_loaded — athenian-batch-image-generation.php
  • wp_ajax_abig_generate_prompt_rows — includes/class-abig-shortcode.php
  • wp_ajax_abig_process_queue_now — includes/class-abig-plugin.php
  • wp_ajax_nopriv_abig_generate_prompt_rows — includes/class-abig-shortcode.php
  • wp_enqueue_scripts — includes/class-abig-shortcode.php

Data Model

Persistence and integration boundary
  • Custom Database Tables — described in the local technical reference.
  • OpenAI Integration — described in the local technical reference.
  • Admin Settings — described in the local technical reference.

API Reference

Source inventory and provenance
  • Local source digest: 75a9a5ce9191f5d12a865af46cd0ffdcbcb90d1f2f7d8cfacf49eb5bcf05e55e
  • Repository URL: https://github.com/Athenian-Brands/athenian-batch-image-generation
  • Repository reference: main
  • Repository commit: 71b2f14e4469e3c8b4944d4fc190393bdb514fe5
  • Source files include: README.md, assets/css/admin.css, assets/css/frontend.css, assets/js/admin.js, assets/js/frontend.js, athenian-batch-image-generation-icon.png, athenian-batch-image-generation.php, athenian-batch-image-generation.zip, docs/athenian-platform-marketing.md, docs/athenian-platform-technical.md, docs/technical-marketing.md, includes/class-abig-admin.php, includes/class-abig-notifier.php, includes/class-abig-openai-client.php, includes/class-abig-plugin.php, includes/class-abig-processor.php, includes/class-abig-repository.php, includes/class-abig-settings.php, includes/class-abig-shortcode.php, includes/class-abig-zip-builder.php

Troubleshooting

Baseline review boundary
  • This baseline documents the reviewed batch-image architecture. It does not claim that an external AI request, generated image, ZIP artifact, or product-media mutation has been exercised.

  • Confirm the deployed plugin version, active dependencies, and current repository tree before using implementation details as a release contract.
  • Treat payment, carrier, vendor, shipment, inventory, account, credential, tax, AI, and external-provider behavior as integration-dependent until exercised in the target environment.

FAQ

What is this page intended to establish?

A versioned, product-linked starting point for iterative developer documentation. It combines the local implementation reference with a detected-code inventory and a committed GitHub baseline.

Is the linked repository baseline verified?

Yes. The repository URL, ref, and commit recorded on this page were verified from the clean GitHub baseline prepared for this documentation pass. That does not by itself prove fleet deployment parity.

What remains for release-grade documentation?

Reconcile the recorded source baseline with the deployed plugin version, then exercise the relevant authenticated, store, provider, payment, tax, carrier, or generated-artifact paths in the target environment.

Changelog

0.1.0 2026-10-06