=== Insya Magic — AI Content Generator for ChatGPT, Claude and Gemini ===
Contributors: yasinkuyu
Tags: ai content, chatgpt, content generator, seo, article writer
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 2.2.2
Requires PHP: 7.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Generate SEO-optimized content with AI. Multi-provider support (OpenAI, Anthropic, Google), templates, image generation & WooCommerce integration.

== Description ==
## Overview of the plugin
https://youtu.be/8dvN0Wa2o18

> **Beta Version** - This plugin is currently in beta. Our goal is to help you generate SEO-optimized content with a single command and easily replace WordPress demo content using AI. We'd love your feedback to make it better!

Transform your content creation with multiple AI providers! Generate content for blog posts, articles, product descriptions, and more in seconds. Great for bloggers, marketers, and content creators who want to save time while maintaining quality.

### 🚀 Key Features

**Multi-Provider AI Support**
* OpenAI (GPT-5.x, GPT-4o, GPT-4 Turbo, GPT-3.5 Turbo)
* Anthropic (Claude 3.5 Sonnet, Claude Opus)
* Google AI (Gemini Pro, Gemini Flash)
* OpenRouter (400+ models: Llama, Mistral, DeepSeek, Qwen...)
* Independent settings for each provider (model, temperature, max tokens)

**Modern Article Generator Toolbar**
* Sleek, minimalist content generation interface
* Quick actions for meta descriptions, keywords, and images
* Real-time content preview with insert/copy options
* Provider selection on-the-fly

**Advanced Prompt System**
* 10+ built-in prompt templates
* Custom prompt builder with variables
* Page-specific templates (Landing, About, Contact, FAQ, etc.)
* Prompt history and favorites

**AI Image Generation (DALL-E)**
* Generate featured images automatically
* DALL-E 3 support with quality and style options
* Multiple sizes (square, landscape, portrait)
* Save directly to Media Library

**WooCommerce Integration**
* AI-powered product descriptions
* Short description generator
* SEO meta generator for products
* Bulk product description updates

**SEO Optimization**
* Automatic meta description generator (150-160 chars)
* AI-powered focus keyword extraction
* Full integration with Yoast SEO, Rank Math, All in One SEO
* SEO-friendly content structure with proper headings

**Page Templates**
* Landing Page
* About Us
* Contact Page
* Services
* FAQ
* Privacy Policy
* Terms & Conditions
* Portfolio
* Pricing Page

**AI Theme Wizard (NEW!)**
* Bulk content generation for entire website
* Select multiple pages and generate AI content at once
* Post type grouping with bulk select/deselect
* Custom page naming for targeted content
* Multi-language support (10+ languages)
* Real-time progress tracking with before/after preview
* Expandable diff view looking changes
* Live cost tracking during generation
* Stop & resume functionality
* Works with Elementor, Gutenberg, and Classic Editor

**Content Management**
* Complete generation history tracking
* Search and filter past generations
* Favorites system for best content
* One-click regeneration from history

**Analytics & Cost Control**
* Real-time API cost tracking
* Token usage statistics
* Daily/weekly/monthly reports
* Usage breakdown by model and action type

### 💡 Ideal For

* **Bloggers** - Generate engaging blog posts quickly
* **Content Marketers** - Scale content production
* **E-commerce Sites** - Create product descriptions
* **SEO Professionals** - Optimize content for search engines
* **Agencies** - Manage multiple client content needs
* **Developers** - Build landing pages and documentation

### 🎯 Why Choose Insya Magic?

✅ **Multi-Provider** - Use OpenAI, Claude, or Gemini based on your needs
✅ **Provider-Specific Settings** - Configure each AI independently
✅ **Modern UI** - Clean, intuitive article generation toolbar
✅ **Save Time** - Generate quality content in seconds, not hours
✅ **Optimized** - Built-in tools and plugin integrations
✅ **WooCommerce Ready** - Full e-commerce content support
✅ **Image Generation** - Create featured images with DALL-E
✅ **Template Library** - Pre-built templates for any content type
✅ **Full History** - Never lose generated content

### 📹 Video Tutorial
https://youtu.be/8dvN0Wa2o18

### 🔑 Requirements

* API key from at least one provider:
  * OpenAI: https://platform.openai.com/api-keys
  * Anthropic: https://console.anthropic.com/settings/keys
  * Google AI: https://makersuite.google.com/app/apikey
  * OpenRouter: https://openrouter.ai/keys
* WordPress 5.0 or higher
* PHP 7.0 or higher

### 🌟 Pro Tips

1. Configure multiple providers for different content types
2. Use lower temperature for factual content, higher for creative
3. Start with templates for consistent quality
4. Use meta description generator for better SEO
5. Track costs with built-in analytics

== Installation ==

1. Upload the 'ai-magic-content-generator' folder to the '/wp-content/plugins/' directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to AI Magic > Settings to configure your API keys.
4. Enable your preferred AI providers and configure their settings.
5. Start generating content from any post/page editor!

== Frequently Asked Questions ==

= Which AI provider should I use? =

Each provider has its strengths:
* **OpenAI (GPT-4o)**: Great for creative and technical content
* **Claude (Anthropic)**: Excellent for long-form, nuanced content
* **Gemini (Google)**: Fast and cost-effective for quick content

= Can I use multiple providers? =

Yes! You can enable multiple providers and switch between them based on your needs. Each provider has independent settings.

= Is the generated content SEO-friendly? =

Yes! All content is optimized for SEO with proper heading structure. Plus, we integrate with popular SEO plugins like Yoast and Rank Math.

= Can I customize the prompts? =

Absolutely! Use our prompt template system with variables, or create your own custom prompts for specific use cases.

= Does it work with WooCommerce? =

Yes! The plugin includes a dedicated WooCommerce integration for generating product descriptions, short descriptions, and SEO meta.

== Screenshots ==

1. Modern article generator toolbar
2. Multi-provider settings with individual configurations
3. Prompt templates and customization
4. WooCommerce product description generator
5. DALL-E image generation
6. Analytics dashboard

== Changelog ==

= 2.2.2 =
* Compliance update: Standardized versioning and readme headers as per WordPress directory requirements.

= 2.2.1 =
* NEW: Performance improvements and optimized AI content processing.
* FIX: Minor UI alignment issues in the wizard interface.

= 2.2.0 =
* NEW: OpenRouter API support - Access 400+ AI models through a single provider
* NEW: Support for Llama, Mistral, DeepSeek, Qwen and many more models via OpenRouter
* NEW: Free model options available through OpenRouter

= 2.1.4 =
* NEW: Generation History pagination (20 records per page)
* NEW: Date filter buttons (Today, Yesterday, Last 7 Days, Last 30 Days, All Time)
* NEW: Total records display always visible
* ENHANCEMENT: History page styling matches wizard theme with purple gradients
* ENHANCEMENT: Search input redesigned with icon and focus effects
* ENHANCEMENT: Date column now shows time alongside date

= 2.1.3 =
* ENHANCEMENT: Elementor processor now uses Document API for safe content updates
* ENHANCEMENT: Elementor processor supports 30+ text field types (editor, content, html, testimonial, etc.)
* ENHANCEMENT: Gutenberg processor uses parse_blocks/serialize_blocks instead of regex
* ENHANCEMENT: Gutenberg processor handles heading, list, quote blocks and nested content
* ENHANCEMENT: WPBakery processor supports 8 shortcode types with attribute text extraction
* NEW: Classic HTML processor for TinyMCE/Classic Editor content preservation
* NEW: Content Service now fully supports all four editor types
* FIX: Elementor content structure preservation improved with fallback mechanism

= 2.1.2 =
* NEW: Company Context Profile - Define global company information that is automatically included in all AI prompts
* NEW: Context status indicator showing active/inactive state with character count
* ENHANCEMENT: Base prompt is now applied to all AI providers (OpenAI, Anthropic, Google)
* ENHANCEMENT: Settings page reorganization with Company Context Profile section

= 2.1.1 =
* NEW: AI Title Suggestions - Generate 10 headline-style titles with one click
* NEW: "More Suggestions" button to fetch additional title batches
* NEW: Title suggestions respect Settings page language preference
* NEW: Metabox Settings tab inherits defaults from Settings page (provider, language, style, tone)
* ENHANCEMENT: Shorter, punchier title generation (max 50 chars, newspaper headline style)
* ENHANCEMENT: Inline loading spinner for title suggestions
* FIX: Title list preserved when fetching more suggestions

= 2.1.0 =
* NEW: Theme Wizard - Multi-step wizard with page selection and custom naming
* NEW: Real-time progress tracking with before/after diff display
* NEW: Stop button to cancel wizard mid-process
* NEW: Live cost tracking during AI operations
* NEW: Page grouping by post type in wizard
* FIX: Meta box now visible on all public custom post types
* FIX: Theme Wizard and Layout Admin 404 errors resolved
* ENHANCEMENT: Modern card-based UI for Theme Wizard

= 2.0.2 =
* FIX: Resolved Elementor structure preservation issues by using correct JSON data handling
* FIX: Localized all JavaScript UI strings to English (removed hardcoded Turkish strings)
* ENHANCEMENT: Added "Settings" tab for better organization of plugin options
* ENHANCEMENT: Added active editor detection display in the status bar
* ENHANCEMENT: Improved "Fill Content" logic to strictly preserve existing HTML/JSON structure

= 2.0.1 =
* FIX: Resolved language support issue where non-hardcoded languages fell back to English
* FIX: Added missing max_tokens configuration for all OpenAI models
* ENHANCEMENT: Improved prompt generation logic for better multi-language support

= 2.0.0 =
* NEW FEATURE: One-Click Full Article Generator - Generate Title, Content, Tags, and SEO Meta in one click
* NEW FEATURE: Elementor Compatibility - Preserves existing Elementor structure while filling content
* NEW FEATURE: Auto-Fill Functionality - Automatically inserts generated content into Gutenberg, Classic Editor, and Elementor
* NEW FEATURE: Multi-Language Support - Generate full articles in 10+ languages (English, Turkish, Spanish, French, German, etc.)
* NEW FEATURE: Enhanced History - Direct "Edit Post" links from history dashboard
* ENHANCEMENT: Smart Content Structure Preservation - Intelligently fills content without breaking layouts
* ENHANCEMENT: Real-time Progress Tracking - Visual progress bar for multi-step generation
* ENHANCEMENT: Improved Cost Tracking - Accurate cost calculation for full article generation
* FIX: Resolved JavaScript variable initialization issues
* FIX: Improved AJAX handling for large content payloads

= 1.0.8 =
* NEW FEATURE: Multi-Provider Settings System - Each provider (OpenAI, Anthropic, Google) now has independent settings
* NEW FEATURE: Provider-specific model, temperature, and max_tokens configuration
* NEW FEATURE: Modern Minimalist Article Generator Toolbar - Complete UI redesign
* NEW FEATURE: Quick actions for meta, keywords, images, and content improvement
* NEW FEATURE: Advanced Prompt Manager with 10+ built-in templates
* NEW FEATURE: Page Templates - Landing, About, Contact, Services, FAQ, Privacy, Terms, Portfolio, Pricing
* NEW FEATURE: DALL-E Image Generation - Generate featured images automatically
* NEW FEATURE: WooCommerce Integration - Product description and SEO generation
* NEW FEATURE: Prompt Variables System - Use {{title}}, {{language}}, {{tone}}, etc.
* NEW FEATURE: Provider Manager Class for centralized provider handling
* ENHANCEMENT: Legacy settings migration for backward compatibility
* ENHANCEMENT: Improved provider selection in metabox
* ENHANCEMENT: Better error handling and user feedback
* FIX: Provider-specific settings now properly isolated

= 1.0.7 =
* NEW FEATURE: SEO Meta Description Generator
* NEW FEATURE: Focus Keyword Extraction
* NEW FEATURE: SEO Plugin Integration (Yoast, Rank Math, All in One SEO)
* NEW FEATURE: Content Templates System (6 templates)
* NEW FEATURE: Content History & Favorites
* NEW FEATURE: Analytics Dashboard
* NEW FEATURE: Cost Tracking
* ENHANCEMENT: Improved database structure
* FIX: Various bug fixes

= 1.0.6 =
* Security Fix: Resolved Privilege Escalation vulnerability
* Added nonce verification and capability checks
* Enhanced input sanitization

= 1.0.5 =
* Security improvements and bug fixes

= 1.0.4 =
* Various minor fixes and improvements

= 1.0.3 =
* Plugin name and description updated

= 1.0.2 =
* Plugin name updated

= 1.0.1 =
* Bug fixes and improvements

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.0.8 =
Major update with multi-provider settings, DALL-E image generation, WooCommerce integration, and modern UI. Your existing settings will be automatically migrated.

== Additional Notes ==

AI Content Generator supports multiple AI providers. You need an API key from at least one provider to use this plugin. API usage costs are charged directly by the respective providers based on your usage.
