=== AI Thumbnails Maker - regenerate thumbnails & auto featured image === Contributors: wpaifactory, alexkovalevv Author: wpaifactory Author URI: https://wpaifactory.com Tags: thumbnails, ai, dall-e, midjourney, featured-image Requires at least: 6.2 Tested up to: 6.8 Requires PHP: 7.4 Stable tag: 1.1.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Regenerate thumbnails with AI and automatically create featured images. Supports DALL-E 3 and Midjourney for thumbnail generation. == Description == AI Thumbnails Maker is a comprehensive WordPress plugin that combines traditional thumbnail regeneration with cutting-edge AI image generation technology. The plugin offers two main functionalities: regenerating existing thumbnails and automatically creating featured images for posts and pages using AI services. = Key Features = **🤖 AI-Powered Generation** * Support for DALL-E 3 and Midjourney AI services * Automatic featured image generation from post titles * High-quality image generation with customizable settings * Multiple image sizes and quality options **🖼️ Auto Featured Image** * Automatically generate featured images for posts without them * Use first image in content or generate with AI * Support for all post types (posts, pages, products, custom types) * Smart prompt generation from post titles **📊 Comprehensive Statistics & Monitoring** * Track generation success rates and performance metrics * View detailed logs of all operations * Monitor AI service usage and costs * Real-time progress monitoring with pause/resume functionality **⚙️ Advanced Configuration** * Choose between AI generation and traditional regeneration * Configure AI service settings and preferences * Set up automatic processing via cron jobs * Flexible batch processing options **🔄 Smart Processing** * Regenerate all thumbnails or focus on specific images * Retry failed generations automatically * Batch processing with progress tracking * Background processing via WordPress cron **📈 Advanced Analytics Dashboard** * Real-time statistics summary * Recent operations table with image previews * Error tracking and reporting * Service usage statistics by AI provider = Use Cases = * **Theme Changes**: When switching themes with different thumbnail requirements * **Image Optimization**: Generate optimized thumbnails for better performance * **AI Enhancement**: Use AI to create more engaging thumbnail and featured images * **Bulk Processing**: Handle large numbers of images efficiently * **Quality Improvement**: Enhance existing thumbnails with AI technology * **Content Enhancement**: Automatically add featured images to posts without them * **SEO Improvement**: Ensure all posts have engaging featured images * **E-commerce**: Generate product images and thumbnails automatically * **Blog Management**: Maintain consistent visual content across your site = AI Services Supported = * **DALL-E 3**: OpenAI's latest image generation model with high-quality results * **Midjourney**: Professional-grade AI art generation with artistic styles * **Extensible**: Easy to add support for additional AI services via hooks = Requirements = * WordPress 5.0 or higher * PHP 7.4 or higher * Valid API keys for chosen AI services (DALL-E 3 or Midjourney) * Sufficient server resources for image processing * WordPress cron functionality for background processing == Installation == 1. Upload the plugin files to the `/wp-content/plugins/ai-thumbnails-maker` directory, or install the plugin through the WordPress plugins screen directly. 2. Activate the plugin through the 'Plugins' screen in WordPress 3. Navigate to Settings → AI Thumbnails Maker to configure the plugin 4. Configure your AI service API keys in the Settings tab 5. Choose your preferred settings for thumbnail regeneration and featured image generation 6. Start using the plugin: - **Regenerate Thumbnails**: Process existing images with AI or traditional methods - **Auto Featured Image**: Generate featured images for posts without them - **Settings**: Configure AI services and processing options == Frequently Asked Questions == = Do I need API keys for AI services? = Yes, you'll need valid API keys for the AI services you want to use. The plugin supports DALL-E 3 (OpenAI) and Midjourney, each requiring their own API credentials. = How much do AI services cost? = Costs vary by service and usage. DALL-E 3 typically charges per image generated, while Midjourney may have subscription-based pricing. Check each service's current pricing for accurate costs. = Can I use the plugin without AI services? = Yes! The plugin includes traditional thumbnail regeneration functionality and can generate featured images using the first image found in post content, so you can use it even without configuring AI services. = Is my data secure? = Yes, the plugin only sends necessary data to AI services for image generation. No personal or sensitive information is transmitted. = What image formats are supported? = The plugin supports all standard WordPress image formats including JPEG, PNG, WebP, and more. = Can I schedule automatic processing? = Yes, the plugin includes a built-in cron system that allows you to schedule automatic thumbnail regeneration and featured image generation at regular intervals. You can configure processing intervals from every minute to every 10 minutes. = How do I monitor AI service usage? = The plugin provides detailed statistics and usage tracking for all AI services, helping you monitor costs and performance. The statistics dashboard shows success rates, error tracking, and recent operations with image previews. = What post types are supported for featured image generation? = The plugin supports all post types including posts, pages, WooCommerce products, and custom post types. You can select which post types to process in the Auto Featured Image tab. == Development & Build Instructions == This plugin uses modern build tools for JavaScript and CSS compilation. To build the plugin from source: **Prerequisites:** - Node.js (version 18 or higher) - npm (comes with Node.js) **Build Commands:** - `npm install` - Install dependencies - `npm run build` - Build production assets and create distribution package - `npm run build:assets` - Build only production assets (JS/CSS) - `npm run build:dev` - Build development assets (with source maps) - `npm run dev` - Watch mode for development (auto-rebuild on changes) - `npm run build:package` - Create distribution package only **Build Process:** 1. JavaScript files are compiled using Vite from `src/js/` directory 2. SCSS files are compiled to CSS from `src/scss/` directory 3. Compiled assets are output to `assets/` directory (minified for production) 4. Final distribution package is created as `build/compiled/ai-thumbnails-maker-[version].zip` **Source Files:** - JavaScript: `src/js/App.js` and related modules in `modules/`, `components/`, `utils/` - SCSS: `src/scss/admin.scss` and component files in `base/`, `components/`, `layout/`, `pages/` - Build configuration: `vite.config.js`, `package.json`, `scripts/build-package.js` **Output Structure:** - `assets/js/admin.min.js` - Compiled JavaScript (production) - `assets/css/admin.min.css` - Compiled CSS (production) - `build/compiled/ai-thumbnails-maker/` - Clean plugin directory for distribution - `build/compiled/ai-thumbnails-maker-[version].zip` - Ready-to-deploy package **Features:** - Vite for fast builds and HMR (Hot Module Replacement) - Terser for JavaScript minification - Autoprefixer for CSS browser compatibility - SCSS preprocessing with modern syntax - Source maps for development - Automatic package creation with excluded dev files == Screenshots == 1. **Regenerate Thumbnails Tab**: Main interface for processing existing images with progress tracking 2. **Auto Featured Image Tab**: Interface for generating featured images with statistics dashboard 3. **Settings Tab**: Comprehensive configuration for AI services and processing options 4. **Statistics Dashboard**: Real-time monitoring with success rates and recent operations 5. **AI Service Configuration**: DALL-E 3 and Midjourney setup with connection testing 6. **Progress Monitoring**: Real-time progress bars with pause/resume functionality 7. **Recent Operations Table**: Detailed logs with image previews and status information == Changelog == = 1.1.0 = * **Fixed**: Critical JavaScript error causing buttons to malfunction (SyntaxError: Identifier 'e' has already been declared) * **Fixed**: WordPress Plugin Repository compliance - proper loading of core files with function_exists() checks * **Improved**: Smart image detection in post content with 5 different search methods * **Improved**: Enhanced featured image generation with wp-image-{id} class extraction * **Improved**: Better handling of images already in media library (avoids duplicate downloads) * **Fixed**: AJAX parameter handling for post types (string vs array) * **Removed**: Redundant "Generate with AI" button - method now selected via radio buttons * **Added**: Full implementation of all button handlers (Regenerate Featured, Retry Failed, Delete Unused) * **Added**: Complete featured image generation workflow with progress tracking * **Enhanced**: Error handling and user feedback with detailed logging * **Updated**: JavaScript build process with proper variable scoping = 1.0.0 = * Initial release * **Thumbnail Regeneration**: Support for DALL-E 3 and Midjourney AI services * **Auto Featured Image**: Automatic featured image generation for posts without them * **Multiple Generation Methods**: AI generation and first image in content methods * **Comprehensive Statistics**: Detailed monitoring and analytics dashboard * **Cron Processing**: Background processing with configurable intervals * **Advanced Configuration**: Flexible settings for AI services and processing options * **Progress Tracking**: Real-time progress monitoring with pause/resume functionality * **Error Handling**: Advanced retry mechanisms and error reporting * **Multi-Post Type Support**: Works with posts, pages, products, and custom post types * **Responsive Interface**: Modern admin interface with tabbed navigation * **WordPress Integration**: Full integration with WordPress media library and admin == Upgrade Notice == = 1.1.0 = Important update! Fixed critical JavaScript errors and WordPress standards compliance. All buttons now work correctly. Improved image detection and processing. Recommended for all users. = 1.0.0 = Initial release of AI Thumbnails Maker. Install to start using AI-powered thumbnail regeneration and automatic featured image generation. == Privacy Policy == This plugin does not collect, store, or transmit any personal data. When using AI services, only the necessary image data and generation prompts are sent to the respective AI service providers. No user information or website content is stored by the plugin. == External Services == This plugin relies on third-party external AI services for image generation functionality. The use of these services is **optional** and only occurs when you explicitly enable and configure AI-powered features. **IMPORTANT:** If you do not configure AI services or choose to use only traditional thumbnail regeneration methods, no data will be sent to any external services. = OpenAI DALL-E 3 API = **What it is:** DALL-E 3 is an advanced AI image generation service provided by OpenAI Inc. **What it's used for:** When you enable DALL-E 3 in the plugin settings and choose to generate images with AI, this service creates new featured images or thumbnails based on text prompts derived from your post titles or content. **When data is sent:** Data is sent to OpenAI's servers only when: * You manually trigger AI image generation by clicking "Generate with AI" or "Regenerate with AI" buttons * You enable automatic AI-powered featured image generation for new posts (if configured) * You initiate bulk AI regeneration of existing images **What data is sent:** * Text prompts (generated from your post titles or custom prompts) * API authentication credentials (your API key) * Image generation parameters (size, quality, style preferences) * NO personal user data, website content, or visitor information is transmitted **Data retention:** OpenAI may retain API request data according to their data retention policies. Generated images are downloaded to your WordPress site and stored locally. **Required credentials:** You must provide your own OpenAI API key, which you can obtain from https://platform.openai.com/api-keys **Service information:** * Service Provider: OpenAI, Inc. * Terms of Service: https://openai.com/policies/terms-of-use * Privacy Policy: https://openai.com/policies/privacy-policy * API Documentation: https://platform.openai.com/docs/guides/images = Midjourney API = **What it is:** Midjourney is a professional AI image generation service known for artistic and high-quality image creation. **What it's used for:** When you enable Midjourney in the plugin settings and choose to generate images with AI, this service creates new featured images or thumbnails based on text prompts. **When data is sent:** Data is sent to Midjourney's servers only when: * You manually trigger AI image generation with Midjourney selected as the service * You enable automatic AI-powered featured image generation using Midjourney (if configured) * You initiate bulk AI regeneration using Midjourney **What data is sent:** * Text prompts (generated from your post titles or custom prompts) * API authentication credentials (your API key, server ID, channel ID) * Image generation parameters (size preferences) * NO personal user data, website content, or visitor information is transmitted **Data retention:** Midjourney may retain API request data and generated images according to their policies. Generated images are downloaded to your WordPress site and stored locally. **Required credentials:** You must provide your own Midjourney API credentials including API key, Discord server ID, and channel ID. **Service information:** * Service Provider: Midjourney, Inc. * Terms of Service: https://docs.midjourney.com/docs/terms-of-service * Privacy Policy: https://docs.midjourney.com/docs/privacy-policy * Documentation: https://docs.midjourney.com/ = User Control and Consent = **You maintain complete control over external service usage:** * AI services are disabled by default and must be explicitly enabled * You can choose to use traditional thumbnail regeneration without any AI services * Each AI generation action requires your explicit action or configuration * You can disable AI services at any time in the plugin settings * Generated images are stored locally on your WordPress installation **No data is sent to external services if:** * You don't configure API keys for AI services * You choose "Use First Image in Content" method for featured images * You use only traditional thumbnail regeneration features * AI generation features are disabled in settings = Data Processing and Compliance = **GDPR Compliance:** * This plugin does not process personal data of your website visitors * Only site administrators who configure and use the plugin interact with external AI services * Generated images and operation logs are stored in your WordPress database * You can delete all plugin data by deactivating and removing the plugin **Your Responsibilities:** * Ensure you have valid licenses/subscriptions for chosen AI services * Review and comply with each AI service's terms of service and privacy policies * Ensure you have appropriate rights to generate derivative images from your content * Monitor your API usage and associated costs with each service provider For questions about data handling by AI services, please contact the respective service providers directly using the links provided above. == Support == For support, feature requests, or bug reports, please visit our support forum or contact us through the plugin's settings page. == Technical Details == **Database Tables:** * `wp_aitm_statistics` - Stores generation statistics and logs for both thumbnail regeneration and featured image generation * `wp_aitm_cron_queue` - Stores queued tasks for background processing **WordPress Hooks:** * `aitm_capability` - Filter to change required user capability * `aitm_ai_services` - Filter to add custom AI services * `aitm_settings` - Filter to modify default settings **REST API Endpoints:** * `/wp-json/aitm/v1/regenerate/{id}` - Regenerate specific attachment * `/wp-json/aitm/v1/statistics` - Get generation statistics * `/wp-json/aitm/v1/test-ai-service` - Test AI service connection * `/wp-json/aitm/v1/generate-featured-image` - Generate featured image for post **AJAX Actions:** * `aitm_regenerate_thumbnails` - Regenerate thumbnails * `aitm_generate_featured_image` - Generate featured image * `aitm_get_statistics` - Get statistics data * `aitm_save_settings` - Save plugin settings * `aitm_test_ai_service` - Test AI service connection == Development == **Contributing:** We welcome contributions! Please see our GitHub repository for development guidelines and contribution instructions. **Code Standards:** * Follows WordPress Coding Standards * Uses proper sanitization and validation * Implements proper nonce verification * Follows OOP principles **Testing:** * Compatible with WordPress 5.0+ * Tested with PHP 7.4+ * Cross-browser compatibility * Mobile responsive design == License == This plugin is licensed under the GPL v2 or later. == Credits == * Built with WordPress REST API * Uses modern JavaScript (ES6+) * Responsive CSS Grid and Flexbox * AI service integrations * WordPress best practices == Roadmap == **Planned Features:** * Additional AI service integrations (Stable Diffusion, etc.) * Advanced image analysis and content recognition * Custom prompt templates and presets * Batch optimization tools for large sites * Performance improvements and caching * Enhanced error handling and recovery * Image style consistency features * Bulk featured image generation for existing content **Future Versions:** * Version 1.1: Additional AI services and improved UI * Version 1.2: Advanced analytics and reporting * Version 1.3: Performance optimizations and caching * Version 2.0: Major feature additions and workflow improvements == Contact == For questions, support, or feature requests, please contact us through the WordPress.org support forums or visit our website. == Donate == If you find this plugin helpful, please consider making a donation to support continued development and maintenance. == Acknowledgments == Thanks to the WordPress community, AI service providers, and all contributors who make this plugin possible.