=== CM Auto Alt Text ===
Contributors: bitsworld
Donate link: https://upmvc.com/
Tags: alt text, images, ai, automation, accessibility
Requires at least: 6.0
Tested up to: 6.8
Stable tag: 1.4.0
Requires PHP: 8.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Automatically generate descriptive alt text for images using multiple AI providers with intelligent fallback and cost optimization.

== Description ==

CM Auto Alt Text revolutionizes WordPress accessibility by automatically generating high-quality alt text for your images using multiple AI providers including OpenAI GPT-4 Vision, Google Cloud Vision, and Cloudmersive. The plugin features intelligent provider selection, cost optimization, and enterprise-grade performance.

### 🚀 Key Features

**Multi-Provider AI System**
* **3 AI Providers**: OpenAI GPT-4 Vision, Google Cloud Vision, Cloudmersive (Azure & AWS coming soon)
* **Intelligent Fallback**: Automatic switching between providers if one fails
* **Cost Optimization**: Smart provider selection based on usage and cost
* **Quality Scoring**: Advanced algorithm to evaluate alt text quality

**Enterprise Performance**
* **React Admin Interface**: Modern dashboard for provider management
* **Bulk Processing**: Process thousands of images with background scheduling
* **Performance Optimized**: Enterprise-grade database queries and caching
* **Real-time Statistics**: Cost tracking, usage analytics, and performance metrics

**WordPress Integration**
* **Automatic Generation**: Alt text created on image upload
* **Gutenberg Integration**: Seamless block editor support
* **Media Library**: Generate or regenerate alt text for existing images
* **WooCommerce Support**: Enhanced product image descriptions

**Accessibility & SEO**
* **WCAG 2.1 Compliance**: Improves accessibility for screen readers
* **SEO Enhancement**: Better image context for search engines
* **Context-Aware**: Considers post content, categories, and tags
* **Quality Validation**: Ensures meaningful, descriptive alt text

### 🎯 How It Works

1. **Upload Images** - Alt text is automatically generated using the best available AI provider
2. **Configure Providers** - Set up API keys and configure provider priorities in the modern React dashboard
3. **Bulk Process** - Update existing images using the bulk processing tools
4. **Monitor Performance** - Track costs, usage, and quality metrics in real-time
5. **Optimize Settings** - Fine-tune provider selection and quality parameters

### 🔧 Supported AI Providers

**OpenAI GPT-4 Vision**
* Advanced image understanding with contextual descriptions
* Supports complex scenes and artistic content
* Context-aware alt text generation

**Google Cloud Vision API**
* Powerful object detection and scene analysis  
* Excellent for product images and photography
* Fast processing with high accuracy

**Cloudmersive Image Recognition**
* Cost-effective solution with good accuracy
* Free tier: 800 API calls per month
* Reliable for standard image types

**Future Development**

*The following providers are planned for future releases:*

**Azure Computer Vision**
* Microsoft's advanced computer vision capabilities
* Enterprise-grade security and compliance
* Status: Planned for future release

**AWS Rekognition**
* Amazon's machine learning image analysis
* Scalable cloud-based processing
* Status: Planned for future release

### 💡 Use Cases

**Bloggers & Content Creators**
* Automatically describe featured images and graphics
* Improve SEO with contextual alt text
* Save hours of manual alt text writing

**E-commerce Stores**
* Generate product descriptions automatically
* Improve accessibility for visually impaired customers
* Enhance product discoverability

**News & Media Sites**
* Process hundreds of images quickly
* Maintain consistent quality across large image libraries
* Meet accessibility compliance requirements

**Enterprise Websites**
* Scale alt text generation across multiple sites
* Track costs and usage across departments
* Maintain quality standards with automated scoring

== External Services ==

This plugin integrates with multiple AI services to analyze images and generate alt text. **By using this plugin, you consent to sending image data to these external services for processing.**

### Service Providers

**Cloudmersive (Default)**
* **Provider**: PRT Systems LLC
* **API Endpoint**: https://api.cloudmersive.com/image/recognize/describe
* **Free Tier**: 800 API calls per month
* **Privacy Policy**: https://account.cloudmersive.com/privacy-policy
* **Terms of Use**: https://account.cloudmersive.com/terms-of-use

**OpenAI GPT-4 Vision**
* **Provider**: OpenAI
* **API Endpoint**: https://api.openai.com/v1/chat/completions  
* **Privacy Policy**: https://openai.com/privacy/
* **Terms of Use**: https://openai.com/terms/

**Google Cloud Vision**
* **Provider**: Google LLC
* **API Endpoint**: https://vision.googleapis.com/v1/images:annotate
* **Privacy Policy**: https://policies.google.com/privacy
* **Terms of Service**: https://cloud.google.com/terms/

### Future Providers

*The following services are planned for future integration:*

**Azure Computer Vision**
* **Provider**: Microsoft Corporation
* **Privacy Policy**: https://privacy.microsoft.com/privacystatement
* **Status**: Future development

**AWS Rekognition**
* **Provider**: Amazon Web Services
* **Privacy Policy**: https://aws.amazon.com/privacy/
* **Status**: Future development

### Data Handling

* **Image Processing**: Images are sent to selected AI providers for analysis
* **No Permanent Storage**: Images are not permanently stored by external services
* **Generated Text**: Alt text is stored in your WordPress database
* **API Keys**: Securely stored in WordPress options table
* **Usage Tracking**: Costs and statistics stored locally

== Installation ==

### Automatic Installation

1. Go to **Plugins > Add New** in your WordPress admin
2. Search for "CM Auto Alt Text"
3. Click **Install Now** and then **Activate**
4. Navigate to **Settings > CM Auto Alt Text**
5. Configure your AI provider API keys
6. Start generating alt text automatically!

### Manual Installation

1. Download the plugin ZIP file
2. Upload to `/wp-content/plugins/cm-auto-alt-text/`
3. Activate the plugin through the **Plugins** menu
4. Configure your settings in **Settings > CM Auto Alt Text**

### Configuration

1. **Get API Keys**: Sign up for your preferred AI providers
2. **Configure Providers**: Enter API keys in the React admin dashboard
3. **Set Priorities**: Choose which providers to use first
4. **Adjust Settings**: Configure quality thresholds and cost limits
5. **Test Connection**: Verify your API keys work correctly

== Frequently Asked Questions ==

= Do I need API keys for all providers? =

No! The plugin currently supports 3 providers: OpenAI GPT-4 Vision, Google Cloud Vision, and Cloudmersive. You can use any combination. Start with Cloudmersive (free 800 calls/month) and add others as needed. Azure and AWS providers are planned for future releases.

= How does the intelligent fallback work? =

The plugin tries providers in order of priority. If one fails (API error, rate limit, etc.), it automatically tries the next available provider. This ensures reliable alt text generation.

= Can I control costs? =

Yes! The React dashboard provides real-time cost tracking, usage statistics, and spending alerts. You can set monthly limits and choose cost-effective providers for different image types.

= How accurate is the generated alt text? =

The plugin uses advanced quality scoring to evaluate alt text descriptiveness, length, and relevance. Multiple AI providers ensure high accuracy, and you can always manually edit generated text.

= Will this work with my theme/page builder? =

Yes! The plugin works with any theme or page builder because it stores alt text in WordPress's standard image metadata fields. It's compatible with Gutenberg, Classic Editor, Elementor, Divi, and others.

= What image formats are supported? =

All standard web formats: JPEG, PNG, GIF, WebP, and other WordPress-supported formats. The plugin automatically validates image compatibility before processing.

= How does bulk processing work? =

Bulk processing uses WordPress's background scheduling system to process images at 1 per second (respecting API rate limits). You can filter by date ranges and track progress in real-time.

= Can I customize the alt text style? =

Yes! Each provider offers customization options for tone, length, and detail level. The React interface provides easy configuration for each provider's specific parameters.

= Is my data secure? =

Yes! API keys are securely stored using WordPress standards. Images are only sent to providers you've configured, and no images are permanently stored by external services.

== Screenshots ==

1. **Multi-Provider Dashboard** - React-based admin interface for managing AI providers and viewing statistics
2. **Provider Configuration** - Easy setup of API keys and provider preferences with connection testing
3. **Bulk Processing Interface** - Process thousands of images with progress tracking and filtering options
4. **Media Library Integration** - Generate or regenerate alt text directly from the media library
5. **Gutenberg Block Editor** - Seamless integration with WordPress block editor for on-demand generation
6. **Statistics Dashboard** - Real-time cost tracking, usage analytics, and quality metrics
7. **Settings Panel** - Fine-tune quality thresholds, cost limits, and provider priorities

== Changelog ==

= 1.4.0 =
* **Major Release**: Multi-Provider AI System
* **New**: OpenAI GPT-4 Vision provider with advanced image understanding
* **New**: Google Cloud Vision provider with object detection capabilities  
* **New**: React-based admin dashboard for provider management
* **New**: Intelligent fallback system across multiple AI providers
* **New**: Real-time cost tracking and usage statistics
* **New**: Quality scoring algorithm for alt text evaluation
* **New**: Bulk processing with background scheduling and progress tracking
* **Enhanced**: Performance-optimized database queries for large sites
* **Enhanced**: Context-aware alt text generation using post content
* **Enhanced**: WooCommerce integration for product images
* **Enhanced**: Enterprise-grade security with proper escaping and sanitization
* **Enhanced**: Complete internationalization support with POT file
* **Improved**: WordPress 6.8 compatibility
* **Fixed**: All WordPress.org compliance issues resolved
* **Architecture**: Complete rewrite with provider abstraction and modern React UI

= 1.3.7 =
* **Security**: Fixed AJAX security vulnerabilities with proper nonce verification
* **Security**: Added capability checks for all admin functions  
* **Compliance**: Added proper input sanitization and validation
* **Compliance**: Improved external service documentation and consent notices
* **Enhancement**: Added internationalization support (i18n)
* **Enhancement**: Added dismissible admin notices
* **Enhancement**: Improved error handling and user feedback
* **Code Quality**: Removed all debug code comments
* **Code Quality**: Added proper WordPress coding standards compliance

= 1.3.6 =
* Added date filter for bulk processing (e.g., "August 2024") in settings
* Improved bulk processing query efficiency

= 1.3.5 =
* Fixed bulk processing to correctly identify images with no alt text (empty or unset)
* Enhanced database query for better performance

= 1.3.4 =
* Implemented scheduled bulk processing at 1 image/second to respect Cloudmersive rate limits
* Added background processing for better user experience

= 1.3.3 =
* Added user-configurable bulk process limit in settings (1-800 images)
* Improved settings validation

= 1.3.2 =
* Fixed media modal alt text updates in Gutenberg editor
* Enhanced JavaScript for better modal integration

= 1.3.1 =
* Improved JavaScript to update alt text fields in real-time in media library
* Enhanced user experience with immediate feedback

= 1.3.0 =
* Added bulk processing for existing images
* Added "Generate Alt Text" buttons in media library
* Introduced settings page for configuration

= 1.2.0 =
* Added Gutenberg block editor integration
* Improved error handling and fallback options

= 1.1.0 =
* Added API key configuration options
* Enhanced security and validation

= 1.0.0 =
* Initial release with automatic alt text generation on image upload

== Upgrade Notice ==

= 1.4.0 =
Major update with multi-provider AI system! New React dashboard, OpenAI GPT-4 Vision support, intelligent fallback, and enterprise-grade performance. Existing Cloudmersive users: your settings will be migrated automatically.

= 1.3.7 =
Important security update! This version fixes AJAX security vulnerabilities and improves WordPress.org compliance. Please update immediately.

= 1.3.6 =
New date filtering feature for bulk processing - target specific months for more precise image updates!

= 1.3.4 =
Bulk processing now respects API rate limits with background processing. Much better user experience!

== Privacy Policy ==

This plugin sends image data to external AI services for analysis. Please review each provider's privacy policy:

* **Cloudmersive**: https://account.cloudmersive.com/privacy-policy
* **OpenAI**: https://openai.com/privacy/  
* **Google**: https://policies.google.com/privacy
* **Microsoft**: https://privacy.microsoft.com/privacystatement
* **Amazon**: https://aws.amazon.com/privacy/

Generated alt text is stored in your WordPress database. API keys are stored securely using WordPress encryption standards.

== Support ==

For support, please visit our [support page](https://upmvc.com/) or use the WordPress.org support forums.

### Getting Started
1. **Documentation**: Complete setup guides available at https://upmvc.com/docs/
2. **Video Tutorials**: Step-by-step configuration videos
3. **Community Support**: Active WordPress.org support forum
4. **Premium Support**: Priority support available for enterprise users

### Troubleshooting
* **API Errors**: Check API key configuration and account status
* **Rate Limits**: Use multiple providers for higher volume processing  
* **Quality Issues**: Adjust provider settings and quality thresholds
* **Performance**: Enable caching and database optimization features

== Technical Requirements ==

* **WordPress**: 6.0 or higher
* **PHP**: 8.0 or higher  
* **MySQL**: 5.6 or higher
* **Memory**: 128MB minimum (256MB recommended for bulk processing)
* **API Keys**: At least one configured AI provider
* **SSL**: HTTPS recommended for secure API communication

== Developer Information ==

### Hooks and Filters

The plugin provides extensive hooks for developers:

* `cm_alt_text_providers` - Filter available providers
* `cm_alt_text_quality_score` - Modify quality scoring algorithm  
* `cm_alt_text_generated` - Action when alt text is generated
* `cm_alt_text_context` - Filter image context data
* `cm_alt_text_fallback` - Customize fallback behavior

### Custom Provider Development

Developers can create custom AI providers by extending the abstract provider class:

```php
class Custom_AI_Provider extends CM_Auto_Alt_Text_Abstract_Provider {
    // Implement required methods
}
```

### REST API Endpoints

The plugin exposes REST API endpoints for headless WordPress implementations:

* `POST /wp-json/cm-auto-alt-text/v1/generate` - Generate alt text
* `GET /wp-json/cm-auto-alt-text/v1/providers` - List providers
* `GET /wp-json/cm-auto-alt-text/v1/statistics` - Usage statistics