WordPress plugin for integrating Tainacan with AI APIs (OpenAI, Gemini, DeepSeek, Ollama). These allows some features such as extracting metadata from uploaded content.
- Multiple AI Providers: Support for OpenAI, Google Gemini, DeepSeek, and Ollama (local)
- Compatible with Tainacan 1.0+: Uses new
PagesandAdmin Form HooksAPIs - Modern Interface: New color palette and smooth animations
- Better UX: Analysis button integrated directly in item form
- REST API: Endpoints for external integration
- Smart Cache: Cache system with manual invalidation
- Custom Prompts: Per-collection prompt customization
- Metadata Mapping: Automatic mapping of AI-extracted fields to Tainacan metadata
- EXIF Extraction: Automatic extraction of EXIF data from images
- PDF Support: Text extraction and visual analysis for PDFs
- Upload the
tainacan-aifolder to/wp-content/plugins/ - Run
composer installin the plugin folder (for PDF support) - Activate the plugin in WordPress
- Configure your API key in Tainacan > AI Tools
- Node.js 20.0+ (Active LTS recommended)
- npm 10.0+
- Composer (for PHP dependencies)
# Install PHP dependencies
composer install
# Install Node.js dependencies
npm install# Development mode (watch files, rebuild on changes)
npm start
# Production build (minified assets)
npm run build
# Lint JavaScript code
npm run lint:js
# Auto-fix JavaScript linting issues
npm run lint:js:fix
# Format JavaScript code
npm run format:js
# Or use the general format command (includes JS and CSS)
npm run format
# Lint CSS/Styles
npm run lint:css
# Update WordPress package dependencies
npm run packages-update
# Generate plugin ZIP for WordPress.org
npm run plugin-zipBuilt assets are output to build/:
- JavaScript:
build/js/*.min.js - CSS:
build/css/*.min.css
The plugin automatically detects built assets and uses them when available, falling back to source files in src/ for development.
When preparing a release for WordPress.org:
- Run
npm run buildto generate production assets - Run
npm run plugin-zipto create a distribution-ready ZIP - The
.distignorefile ensures only necessary files are included
Important: The .distignore file ensures only necessary files are included. The ZIP will contain:
includes/directory with all PHP classes and admin templateslib/directory (embedded third-party libraries)languages/directory (translations)build/directory with compiled JS/CSStainacan-ai.php(main plugin file)readme.txt(WordPress.org readme)
- WordPress 6.5+
- PHP 8.0+
- Tainacan 1.0+
- AI Provider API key (OpenAI, Gemini, DeepSeek, or Ollama)
- Configure your API key in plugin settings
- Edit a Tainacan item with an attached document
- In the "AI Metadata Extractor" section, click Analyze Document
- Copy extracted metadata to desired fields or use automatic filling
Images: JPG, PNG, GIF, WebP
Documents: PDF, TXT, HTML
POST /wp-json/tainacan-ai/v1/analyze/{attachment_id}
GET /wp-json/tainacan-ai/v1/status
DELETE /wp-json/tainacan-ai/v1/cache/{attachment_id}
tainacan-ai/
├── tainacan-ai.php # Main plugin file
├── includes/
│ ├── AdminPage.php # Admin page class (Tainacan Pages API)
│ ├── ItemFormHook.php # Form integration (Admin Form Hooks)
│ ├── DocumentAnalyzer.php # Document analysis
│ ├── API.php # REST API endpoints
│ ├── CollectionPrompts.php # Custom prompts manager
│ ├── UsageLogger.php # Usage statistics logger
│ ├── ExifExtractor.php # EXIF data extractor
│ ├── AI/ # AI provider implementations
│ │ ├── AbstractAIProvider.php
│ │ ├── AIProviderFactory.php
│ │ └── Providers/ # Provider classes (OpenAI, Gemini, etc.)
│ └── admin/ # Admin-specific templates
│ └── admin-page.php # Settings page template
├── lib/ # Embedded third-party libraries
│ └── PdfParser/ # PDF parsing library
├── src/ # Source assets (not included in ZIP)
│ ├── css/ # Source CSS files
│ └── js/ # Source JavaScript files
├── build/ # Built assets (included in ZIP)
│ ├── css/ # Compiled CSS files
│ └── js/ # Compiled JavaScript files
└── languages/ # Translations
GPL v2 or later