=== Wisewand - AI Content Writer & SEO Content Generator ===
Contributors: wisewand
Tags: ai content generator, seo content, ai writer, content automation, editorial calendar
Requires at least: 6.2
Tested up to: 6.8
Stable tag: 1.6.20
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI content creation & SEO suite. Advanced AI writing with deep SEO intelligence for dominating search rankings.

== Description ==
AI-powered content creation with SEO optimization. Generate, manage & publish blog posts with keyword research and content calendar.
Wisewand is a powerful **AI content generator** and **SEO writing assistant** that brings automated content creation directly into your WordPress dashboard. Whether you need an **AI writer** for blog posts, product pages, or SEO articles, Wisewand streamlines your **content automation** workflow with intelligent **AI writing** technology.

Transform your content marketing with this comprehensive **AI content generator** that combines **SEO content** optimization, editorial planning, and automated publishing. Create high-quality, **SEO-optimized content** with advanced keyword research, competitor analysis, and smart **blog writing automation**.

== Changelog ==

= 1.6.20 - 2025-11-29 =
* Fix: Audio Voice Settings dropdowns in Settings page now show ALL available voices (22 total)
* Improvement: Added optgroup tags to group voices by language (French 🇫🇷 / English 🇬🇧) for better UX
* Improvement: Settings page Audio Voice dropdowns now match Edit Publication modal implementation

= 1.6.19 - 2025-11-29 =
* Fix: Resolved fatal error "Call to undefined method ensure_embedding_column"
* Improvement: Finalized robust schema verification logic

= 1.6.18 - 2025-11-29 =
* Optimization: Added transient caching to database schema checks for improved performance
* Fix: Refined "Just-In-Time" self-healing logic to follow WordPress Coding Standards

= 1.6.17 - 2025-11-29 =
* Fix: Implemented "Just-In-Time" database schema correction to guarantee embedding column existence
* Improvement: Enhanced robustness of AI Semantic Deduplication against database schema drift

= 1.6.16 - 2025-11-29 =
* Fix: Resolved "Unknown column embedding" database error by forcing schema migration
* Improvement: Added robust database migration for AI Semantic Deduplication support

= 1.6.15 - 2025-11-29 =
* Fix: Reverted accidental UI change to "Add Keywords" button
* Improvement: Renamed "Find Duplicates" button to "AI Semantic Deduplication" for clarity

= 1.6.14 - 2025-11-29 =
* Fix: Resolved PHP warning "Undefined array key temperature" in OpenAI Client
* Improvement: Updated UI text for AI Semantic Deduplication feature

= 1.6.13 - 2025-11-29 =
* New: AI Semantic Deduplication - Uses OpenAI Embeddings to detect duplicates by meaning (e.g. "Car" = "Automobile")
* Improvement: Added vector storage support to keyword database
* Fix: Enhanced keyword saving process with automatic semantic checks

= 1.6.12 - 2025-11-29 =
* Fix: Resolved "Undefined variable" and "count()" errors when adding keywords in SEO Intelligence (PHP 8+ compatibility)

= 1.6.11 - 2025-11-27 =
* Fix: Prevented automatic modification of heading structure (H2->H3) during import for posts and RSS feeds
* Improvement: Preserved exact HTML structure provided by Wisewand API

= 1.6.10 - 2025-11-27 =
* Improvement: Added missing settings for Inline Images (Ratio, Brand Colors) in Settings page
* Fix: Ensure manual color settings are prioritized over auto-extraction for both Featured and Inline images
* Fix: Correctly transmit all media settings to Wisewand API

= 1.6.9 - 2025-11-27 =
* Improvement: Enabled "Article Summary" feature for all content types (previously pages only)
* Improvement: Enabled "Blockquotes" feature for all content types (previously pages only)
* Fix: Removed UI restrictions hiding summary/blockquotes in Edit Publication panel for articles

= 1.6.8 - 2025-11-26 =
* Fix: PHP 8.2 deprecation warnings in Competitor_Spy class breaking AJAX responses
* Fix: PHP warnings when debug logging categories (implode on non-array)
* Fix: "SyntaxError: Unexpected token '<'" errors in competitor analysis
* Improvement: Declared all missing class properties for PHP 8.2+ compatibility

= 1.6.7 - 2025-11-25 =
* Fix: ALL checkboxes in Edit Publication now display correctly regardless of value format
* Fix: Inline images checkbox now shows checked when payload contains inline images
* Fix: Boolean values properly handled in all 20 feature checkboxes (TOC, FAQ, CTA, Images, Audio, etc.)
* Improvement: More robust checkbox state detection using !empty() instead of strict equality

= 1.6.6 - 2025-11-25 =
* Fix: Inline images settings not persisting from Settings to roadmap entries
* Improvement: Auto-enable inline images feature when count > 0 (better UX)
* Fix: Calendar entries now correctly show checked inline images checkbox when count is set in Settings

= 1.6.5 - 2025-11-25 =
* Fix: HTTP 400 errors when generating articles - boolean fields were being sent as strings
* Fix: PHP 8.2 deprecation warning for dynamic property creation
* Fix: Added 7 missing boolean fields to payload sanitization (image_use_palette, use_inlineimages, inline_images_use_palette, etc.)
* Improvement: Enhanced type safety for Wisewand API requests

= 1.6.4 - 2025-11-25 =
* Fix: Fatal error when clicking "Generate Now" - removed incorrect json_decode() calls on already-decoded arrays
* Fix: Corrected data handling in AJAX requests where jQuery automatically converts objects to arrays

= 1.6.3 - 2025-11-25 =
* Fix: Enhanced error handling for Wisewand API errors - now logs full API response for debugging
* Fix: Added Wisewand dashboard links in error messages for easier troubleshooting
* Improvement: Better error message extraction from multiple possible API response locations

= 1.6.2 - 2025-11-24 =
* Updated: Inline image pricing reduced from 0.5 to 0.25 credits per image (Wisewand API pricing change)
* Updated: Maximum cost calculation now shows 4.5 credits (down from 7.0) with all features enabled

= 1.6.1 - 2025-11-24 =
* Fix: Corrected production zip file naming to match text domain
* Documentation: Added text domain consistency guidelines

= 1.6.0 - 2025-11-24 =
* MAJOR: Implemented Repository Pattern for all database operations
* Added 7 repository classes for better code organization and maintainability
* Refactored 13+ AJAX handlers to use repositories instead of direct database queries
* Enhanced SQL security with proper table name placeholders (%i)
* Improved code quality with SOLID and DRY principles
* Better WordPress coding standards compliance
* Eliminated 100% of direct database queries from controllers
* Added transaction support for complex operations
* Improved error handling and logging
* Enterprise-grade architecture for better maintainability

= 1.5 =
* Security: Fixed critical SQL injection vulnerabilities by replacing unsafe placeholder usage with secure table name interpolation.
* Improvement: Significantly reduced debug log noise by removing excessive logging calls.
* Fix: Resolved syntax error in RSS Feed Manager.
* Cleanup: Removed unused development files from production build.

= 1.4.11 =
* Fix: Added robust self-healing to logger to prevent "Table 'wp_wisewand_logs' doesn't exist" errors.
* Improvement: Reduced debug log noise for CRON scheduling.

= 1.4.10 =
* Fix: Resolved database error "Table 'wp_wisewand_logs' doesn't exist" by improving table auto-healing logic.
* Fix: Ensure all required database tables are verified and created upon update.

= 1.4.9 =
* Fix: Ensure SEO meta data (title, description) is correctly populated for RSS imported posts.
* Fix: Ensure SEO-optimized slug from API is used for RSS imported posts.
* Improvement: Store full API output data for future reference.

= Key Features =

**AI Content Generation**
* Generate blog articles, product pages, category pages, and affiliate content
* Support for multiple content types and lengths
* Multilingual content generation (English, French, German, Spanish, Italian, Portuguese, Dutch)
* Automatic SEO optimization with meta titles and descriptions

**Editorial Calendar**
* Visual drag-and-drop calendar interface
* Scheduled content generation and publishing
* Batch content creation for efficient workflow
* Publication time range control (morning, afternoon, evening, or random)
* Draft or published post options

**SEO Intelligence**
* Keyword research with search volume and difficulty metrics
* Competitor analysis and keyword gap identification
* Keyword clustering and cannibalization prevention
* Integration with DataForSEO for comprehensive keyword data
* Priority scoring for content planning

**Smart Automation**
* Automated CRON jobs for content generation and publishing
* Configurable lead time for content preparation
* Automatic retry logic for failed operations
* Webhook support for real-time content delivery

**Multilingual Support**
* Full WPML and Polylang integration
* Language-specific author assignment
* Automatic category matching across languages
* Custom language meta fallback

**Security & Compatibility**
* HMAC signature authentication for webhooks
* CSRF protection with WordPress nonces
* Rate limiting for API endpoints
* IP-based access control
* Compatible with WordPress 6.0+ and PHP 8.0+
* MariaDB 11.4+ and MySQL 5.5.3+ support

**Developer Friendly**
* REST API endpoints for custom integrations
* Extensive action and filter hooks
* Comprehensive logging system
* PSR-4 autoloading architecture
* Well-documented codebase

= Requirements =

* **Wisewand Account Required** - Sign up at [wisewand.ai](https://wisewand.ai)
* WordPress 6.2 or higher
* PHP 8.0 or higher
* MySQL 5.5.3+ or MariaDB 5.5+
* HTTPS recommended for webhook security

= External Services =

This plugin connects to the following external services to provide its functionality. All external connections require user-provided API keys and are not enabled by default.

**1. Wisewand API** (https://api.wisewand.ai)
* **Purpose:** AI content generation and retrieval
* **Data Sent:** API key, content generation requests (keywords, topics, language preferences), content settings
* **Required:** Yes (core functionality)
* **Privacy Policy:** https://wisewand.ai/privacy
* **Terms of Service:** https://wisewand.ai/terms
* **When:** API calls are made when you generate content, import articles, or check content status

**2. DataForSEO API** (https://api.dataforseo.com)
* **Purpose:** SEO keyword research and analysis
* **Data Sent:** API credentials, keywords, domain names for analysis, location data for search results
* **Required:** No (optional SEO features only)
* **Privacy Policy:** https://dataforseo.com/privacy-policy
* **Terms of Service:** https://dataforseo.com/terms-of-service
* **When:** API calls are made only when you use the keyword research features

**3. OpenAI API** (https://api.openai.com)
* **Purpose:** AI-powered category matching for content organization
* **Data Sent:** API key, keywords, category names and descriptions for AI matching
* **Required:** No (optional category matching feature only)
* **Privacy Policy:** https://openai.com/privacy
* **Terms of Service:** https://openai.com/terms
* **When:** API calls are made only when you use AI category matching features

**4. ElevenLabs API** (https://api.elevenlabs.io)
* **Purpose:** Audio/voice preview samples for AI-generated audio content
* **Data Sent:** No data sent to ElevenLabs directly by this plugin. Preview URLs reference audio samples hosted by ElevenLabs for voice selection UI
* **Required:** No (optional audio generation feature only, preview links not loaded automatically)
* **Privacy Policy:** https://elevenlabs.io/privacy
* **Terms of Service:** https://elevenlabs.io/terms
* **When:** Preview URLs are displayed only when configuring audio voice settings. No automatic external requests.

**5. Google Cloud Storage** (https://storage.googleapis.com)
* **Purpose:** Hosting audio files for ElevenLabs voice previews
* **Data Sent:** No data sent by this plugin. Preview URLs reference audio samples hosted on Google Cloud Storage for voice selection UI
* **Required:** No (optional audio generation feature only, preview links not loaded automatically)
* **Privacy Policy:** https://cloud.google.com/terms/cloud-privacy-notice
* **Terms of Service:** https://cloud.google.com/terms
* **When:** Preview URLs are displayed only when configuring audio voice settings. No automatic external requests.

**6. Amazon Web Services S3** (https://amazonaws.com)
* **Purpose:** Hosting audio files for ElevenLabs voice previews
* **Data Sent:** No data sent by this plugin. Preview URLs reference audio samples hosted on AWS S3 for voice selection UI
* **Required:** No (optional audio generation feature only, preview links not loaded automatically)
* **Privacy Policy:** https://aws.amazon.com/privacy/
* **Terms of Service:** https://aws.amazon.com/service-terms/
* **When:** Preview URLs are displayed only when configuring audio voice settings. No automatic external requests.

**Important Privacy Notes:**
* All API keys (where applicable) are stored locally in your WordPress database
* No data is sent to external services without your explicit action (generating content, researching keywords, etc.)
* This plugin does NOT include any tracking, analytics, or telemetry
* You must review and accept each service provider's terms before using their features
* Disable any optional API integration at any time through plugin settings

By using this plugin and connecting to these external services (where applicable), you acknowledge that data will be transmitted to these third-party services according to their respective privacy policies and terms of service.

= Use Cases =

* **Content Marketing Teams** - Plan and automate content calendars with AI assistance
* **SEO Agencies** - Manage multiple client sites with centralized content generation
* **Bloggers** - Maintain consistent publishing schedules with automated content
* **E-commerce Sites** - Generate product and category pages at scale
* **Multilingual Sites** - Create content in multiple languages effortlessly

== Installation ==

= Automatic Installation =

1. Log in to your WordPress admin panel
2. Navigate to Plugins > Add New
3. Search for "Wisewand"
4. Click "Install Now" and then "Activate"

= Manual Installation =

1. Download the plugin ZIP file
2. Log in to your WordPress admin panel
3. Navigate to Plugins > Add New > Upload Plugin
4. Choose the ZIP file and click "Install Now"
5. Click "Activate Plugin"

= Configuration =

1. After activation, go to **Wisewand > Settings**
2. Enter your Wisewand API key (get one at https://wisewand.ai)
3. Configure default settings:
   - Default authors for each language
   - Publication preferences
   - CRON automation settings
4. (Optional) Configure DataForSEO API for keyword research
5. (Optional) Configure OpenAI API for enhanced category matching
6. Start generating content!

== Frequently Asked Questions ==

= Is this an AI content generator for WordPress? =

Yes! Wisewand is a complete AI content generator and AI writing assistant built specifically for WordPress. It automates blog writing, SEO content creation, and editorial planning with advanced AI technology.

= Can I use this as an AI writer for blog posts? =

Absolutely! Wisewand functions as an AI writer and blog writer that generates SEO-optimized blog posts, articles, product pages, and more. Perfect for content automation and maintaining consistent publishing schedules.

= Does this AI content generator support SEO? =

Yes, Wisewand is designed as an SEO content generator with built-in keyword research, competitor analysis, SEO optimization, and automated meta descriptions. It's the perfect AI SEO writing tool for content marketers.

= Do I need a Wisewand account? =

Yes, this plugin requires a Wisewand account and API key. Sign up for free at https://wisewand.ai to get started.

= What content types are supported? =

The plugin supports:
* Blog articles
* Product pages
* Category pages
* Affiliate/comparison content
* Custom content types

= Does it work with multilingual plugins? =

Yes, the plugin has built-in support for:
* WPML (WordPress Multilingual)
* Polylang
* Custom language meta fields

= Can I schedule content in advance? =

Absolutely! The editorial calendar allows you to:
* Schedule content days, weeks, or months in advance
* Set publication time ranges (morning, afternoon, evening)
* Batch-create content for efficient workflows
* Automatically publish at scheduled times

= Is it compatible with SEO plugins? =

Yes, Wisewand works seamlessly with:
* Yoast SEO
* Rank Math
* All in One SEO
* SEOPress
* The SEO Framework

The plugin automatically sets meta titles, descriptions, and focus keywords.

= How does the CRON automation work? =

The plugin includes two CRON jobs:
* **15-minute status check** - Monitors content generation progress
* **Daily processing** - Generates and publishes scheduled content

You can customize lead time, retry attempts, and time windows in settings.

= Is my data secure? =

Yes, security is a top priority:
* HMAC signature authentication for webhooks
* WordPress nonce protection for all forms
* Rate limiting to prevent abuse
* IP-based access control
* Secure API key storage
* No external tracking or analytics

= Can I import existing content? =

Yes, the plugin can:
* Import content from Wisewand articles
* Update existing WordPress posts
* Merge new content with existing posts
* Preserve or replace content based on settings

= What happens if content generation fails? =

The plugin has built-in resilience:
* Automatic retry logic (configurable attempts)
* Detailed error logging
* Admin notifications for failures
* Manual retry options in the dashboard

= Does it support custom post types? =

Yes, you can configure:
* Target post type for each content piece
* Custom taxonomies
* Custom fields
* Any WordPress-registered post type

= Can multiple users access the plugin? =

Yes, the plugin respects WordPress capabilities:
* Authors can manage assigned content
* Editors can manage all content
* Administrators have full access
* Customizable via WordPress roles

== Screenshots ==

1. Editorial Calendar - Visual drag-and-drop interface for planning content
2. SEO Intelligence Dashboard - Keyword research and competitor analysis
3. Content Generation Settings - Configure AI parameters and preferences
4. Articles Management - Monitor generation status and import content
5. Settings Panel - API configuration and automation options
6. Dashboard Overview - Quick stats and recent activity

== Changelog ==

= 1.4.9 - 2025-11-22 =
**SEO & Import Enhancements**
* NEW: Added explicit slug extraction from Wisewand API to ensure SEO-optimized URLs
* IMPROVEMENT: Added robust fallbacks for SEO title and description in RSS imports
* IMPROVEMENT: Enhanced full data storage for imported content

= 1.4.2 - 2025-11-18 =
**WordPress.org Compliance - Security & Standards**
* SECURITY: Fixed 14 SQL injection vulnerabilities using proper $wpdb->prepare() with placeholders
* SECURITY: Added sanitization for all JSON-decoded POST data (6 instances)
* SECURITY: Added nonce verification for project management forms
* COMPLIANCE: Updated text domain to match plugin slug (1,354 instances)
* COMPLIANCE: Converted 14 inline style/script tags to wp_add_inline_style/script()
* COMPLIANCE: Added external services documentation (Google Cloud Storage, AWS S3)
* COMPLIANCE: Wrapped 258 debug functions in WP_DEBUG checks
* COMPLIANCE: Updated FullCalendar library version reference to 6.1.19
* COMPLIANCE: Trimmed changelog from 72,488 to 3,937 characters (94.6% reduction)
* COMPLIANCE: Added translator comments for all placeholder strings
* COMPLIANCE: Added phpcs:ignore directives with explanations for intentional patterns
* COMPLIANCE: Excluded deployment scripts from production package

= 1.4.1 - 2025-11-17 =
**WordPress.org Submission - Minor Fixes**
* Fixed documentation and asset optimization for WordPress.org directory submission
* Improved readme.txt formatting and changelog organization
* Enhanced plugin description and feature highlights
* Updated screenshots and banner assets

= 1.4.0 - 2025-11-17 =
**Major Feature Update - Production Ready**
* NEW: Advanced RSS feed import with scheduled publication
* NEW: AI-powered category matching for automated content organization
* Enhanced editorial calendar with visual scheduling interface
* Improved SEO Intelligence dashboard with keyword clustering
* Complete security audit with SQL injection prevention
* Performance optimizations for large-scale content operations
* Full WPML and Polylang multilingual support

= 1.3.15 - 2025-11-17 =
**CRITICAL: PHP Warning Fix in Competitor Spy**
* Fixed "Undefined array key 'difficulty'" warning in keyword analysis
* Added null safety checks for DataForSEO API responses
* Competitor analysis now handles missing difficulty scores gracefully

= 1.3.14 - 2025-11-17 =
**CRITICAL: Select-All Checkbox Bug**
* Fixed select-all selecting hidden/filtered keywords
* Bulk operations now only affect visible keywords
* Prevents accidental mass deletion of filtered-out keywords

= 1.3.13 - 2025-11-17 =
**CRITICAL: Batch Keyword Import Fix**
* Fixed escaped newline bug causing "0 saved, 254 failed" errors
* Batch imports of 255+ keywords now work correctly
* Added failed count tracking and display

= 1.3.12 - 2025-11-17 =
**Enhanced Batch Debugging**
* Added comprehensive error logging for batch operations
* AJAX responses now include complete statistics
* Better visibility into keyword import failures

= 1.3.10 - 2025-11-16 =
**CRITICAL: Batch Import Fixed**
* Fixed "0 saved" issue for large keyword batches
* Updated duplicate detection to match database constraints
* Batch imports of 356+ keywords now succeed

= 1.3.9 - 2025-11-16 =
**CRITICAL: AJAX Import Handler**
* Fixed nonce mismatch causing silent failures
* Restored all article import functionality
* Fixed bulk operations and content generation

= 1.3.6 - 2025-11-15 =
**SECURITY & PERFORMANCE: WordPress.org Compliance**
* SECURITY: Fixed 17 SQL injection vulnerabilities
* SECURITY: Enhanced webhook authentication (now requires secret)
* SECURITY: Comprehensive XSS protection
* PERFORMANCE: 93% complexity reduction in hook registration
* PERFORMANCE: Added query LIMIT clauses (5-10x faster)
* Code quality improvements and better error handling

= 1.3.x Series (2025-11-12 to 2025-11-15) =
Multiple critical fixes and improvements including:
* RSS category selection fixes (Crypto News bug)
* Settings persistence improvements with verification
* Calendar timezone display corrections
* Post scheduling reliability enhancements
* Enhanced checkbox capture system
* Publication time control accuracy
* Complete settings save verification

= 1.2.x Series (2025-11-10 to 2025-11-11) =
Major updates to RSS automation:
* WordPress native scheduling implementation
* Smart rate limit handling with exponential backoff
* Beautiful gradient progress UI for sync operations
* Enhanced inter-article delays
* Cleanup button functionality
* Time range boundary fixes
* Timezone support improvements

= 1.0.x Series (2025-11-07 to 2025-11-09) =
Foundation releases with core features:
* Database architecture improvements
* RSS discovery and import workflow
* Editorial calendar integration
* Rate limiting and bulk operations
* Enhanced logging and error handling
* Multiple critical bug fixes

= 1.0.0 - 2025-10-20 =
**Initial Release**
* AI content generator and SEO writing assistant
* Editorial calendar with drag-and-drop interface
* SEO Intelligence with keyword research
* Multilingual support (7 languages)
* Automated CRON-based publishing
* WordPress.org compliant security
* REST API and webhook support

== Upgrade Notice ==

= 1.0.0 =
Initial release of Wisewand plugin. No upgrade needed - fresh installation only.

== Privacy & Data Handling ==

This plugin sends data to external services for content generation:

**Data Sent to Wisewand API:**
* Keywords and content requirements you specify
* Language and country preferences
* SEO parameters (meta titles, descriptions)
* Publication settings

**Data Sent to DataForSEO (Optional):**
* Keywords for research
* Domain names for analysis
* Language and location codes

**Data Sent to OpenAI (Optional):**
* Category names and descriptions
* Keywords for AI matching

**Data Sent to ElevenLabs (Optional):**
* No data sent directly by this plugin
* Preview URLs reference audio samples for voice selection only
* Actual audio generation handled by Wisewand API

**Data Storage:**
* All API keys are stored in your WordPress database
* Generated content is stored in your WordPress database
* No user behavior is tracked
* No analytics or telemetry is collected
* No data is shared with third parties except the APIs you configure

For detailed privacy information, visit:
* Wisewand: https://wisewand.ai/privacy
* DataForSEO: https://dataforseo.com/privacy-policy
* OpenAI: https://openai.com/privacy
* ElevenLabs: https://elevenlabs.io/privacy

== Support ==

For support, documentation, and feature requests:

* Documentation: https://wisewand.ai/docs
* Support: https://wisewand.ai/support
* GitHub: https://github.com/wisewand/wordpress-plugin (if applicable)

== Credits ==

Developed by the Wisewand team.

Special thanks to:
* WordPress community for excellent documentation
* FullCalendar library for calendar functionality
* All beta testers and early adopters
