A powerful WordPress plugin that automatically generates SEO-optimized metadata (titles, alt text, descriptions, captions) for images using AI vision analysis.
🚀 Features
✨ Core Functionality
- AI-Powered Analysis: Generate metadata using OpenAI GPT-4o with Vision or Claude Sonnet
- SEO Optimization: Context-aware metadata generation based on page content and focus keywords
- Multilingual Support: Automatically detects website language and generates content accordingly
- Bulk Processing: Process all images in your media library with live progress tracking
- Auto-Processing: Automatically generate metadata when images are uploaded
🎯 SEO Integration
- Focus Keyword Integration: Automatically incorporates SEO keywords from Yoast SEO, Rank Math, and All in One SEO
- Page Context Analysis: Considers page titles, categories, tags, and content when generating metadata
- Additional Context: Custom brand/website context for consistent metadata generation
- Used Images Only: Option to skip unused images in media library during bulk processing
🌍 Language Support
- English (default)
- French (français)
- Hebrew (עברית)
🛠 Tech Stack
- Backend: PHP 7.4+ with SOLID design principles
- AI Providers: OpenAI GPT-4o with Vision API, Claude Sonnet API
- WordPress: 5.8+ compatibility
- Frontend: JavaScript (jQuery) for admin interface
- Internationalization: WordPress i18n standards
📦 Installation
Development Setup
- Clone this repository to your WordPress plugins directory
- Copy
.env.exampleto.envand configure your API keys - Activate the plugin in WordPress Admin
- Configure settings at Settings > AI Image Metadata
Production Installation
- Download the production ZIP file
- Upload via WordPress Admin > Plugins > Add New > Upload
- Activate and configure your API settings
🔧 Configuration
API Keys Required
- OpenAI API Key: For GPT-4o with Vision analysis
- Anthropic API Key: For Claude Sonnet analysis
Settings Options
- Choose your preferred AI provider
- Configure which metadata fields to populate
- Set custom brand/website context
- Enable/disable auto-processing on upload
- Configure multilingual options
📝 Usage
Single Image Processing
- Go to Media Library
- Click “Generate AI Metadata” on any image
- Review and save the generated metadata
Bulk Processing
- Navigate to Media Library
- Select “Generate AI Metadata” from bulk actions
- Monitor progress in real-time
- Review results when complete
Auto-Processing
- Enable in settings to automatically process new uploads
- Generated metadata is applied immediately upon upload
🏗 Architecture
Built following SOLID principles:
- Single Responsibility: Each class has one clear purpose
- Open/Closed: Easy to extend with new AI providers
- Liskov Substitution: All providers implement common interface
- Interface Segregation: Small, focused interfaces
- Dependency Inversion: Dependencies injected via constructor
🧪 Development
Prerequisites
- PHP 7.4+
- WordPress 5.8+
- Composer (for development dependencies)
Development Commands
- Setup:
composer install - Tests:
composer test - Linting:
composer lint - Debug: Enable
WP_DEBUGandWP_DEBUG_LOGinwp-config.php
File Structure
ai-image-metadata/
├── ai-image-metadata.php # Main plugin file
├── includes/ # Core classes
│ ├── Plugin.php # Main plugin class
│ ├── AIProviders/ # AI service providers
│ ├── Admin/ # Admin interface
│ ├── Services/ # Business logic
│ ├── DTOs/ # Data transfer objects
│ ├── Interfaces/ # Contracts
│ └── Repositories/ # Data access
├── admin/ # Admin assets
├── languages/ # Translations
└── assets/ # Plugin assets (screenshots, banners, icons)
🔒 Security
- All user inputs are sanitized and validated
- CSRF protection via WordPress nonces
- Capability checks for admin functions
- Secure API communication
- No data stored by AI providers beyond API calls
🌐 Internationalization
The plugin supports multiple languages and can generate metadata in the detected website language:
- Text domain:
ai-image-metadata - Translation files in
/languages/ - RTL language support
📊 Performance
- Efficient bulk processing with progress tracking
- Minimal database queries
- Lazy loading of AI services
- Caching of API responses where appropriate
🤝 Contributing
- Fork the repository
- Create a feature branch
- Follow WordPress coding standards
- Add tests for new functionality
- Submit a pull request
📄 License
GPL v2 or later – see LICENSE file for details
🆘 Support
- WordPress Plugin Directory support forums
- GitHub Issues for bugs and feature requests
- Documentation at plugin website
🚀 Roadmap
- Additional AI provider integrations
- Advanced metadata templates
- Custom field support
- WooCommerce product image optimization
- Advanced SEO analytics integration