=== MM AI Post Generator ===
Contributors: maulikmakwana2008
Donate link: https://profiles.wordpress.org/maulikmakwana2008/
Tags: ai, content generation, blog posts, automation, writing assistant
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.1
Stable tag: 1.0.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI-powered plugin to generate SEO-optimized blog posts and content automatically using OpenAI, Groq, or compatible AI APIs.

== Description ==

MM AI Post Generator is a powerful WordPress plugin that revolutionizes content creation by leveraging advanced AI technology. Generate high-quality, SEO-optimized blog posts, articles, and web content automatically using your preferred AI provider.

### ✨ Key Features

**🎯 AI-Powered Content Generation**
- Generate complete blog posts from keywords or topics
- SEO-optimized titles and meta descriptions
- FAQ schema markup generation
- Customizable tone and content length

**🔧 Multiple AI Provider Support**
- OpenAI (GPT-3.5, GPT-4)
- Groq (fast inference)
- Any OpenAI-compatible API

**🎨 WordPress Integration**
- Native Gutenberg block support
- Admin dashboard for content generation
- Automatic post creation and publishing
- SEO optimization features

**⚡ Performance & Security**
- Intelligent caching system
- Rate limiting protection
- Comprehensive error handling
- Secure API key storage

**📊 Advanced Features**
- System health diagnostics
- Detailed logging and debugging
- Rate limiting controls
- Backup and restore functionality

### 🚀 Use Cases

- **Content Marketers**: Generate blog posts quickly and efficiently
- **SEO Specialists**: Create optimized content for better rankings
- **Business Owners**: Maintain consistent content publishing
- **Agencies**: Scale content production for multiple clients
- **Bloggers**: Overcome writer's block with AI assistance

== Installation ==

### Automatic Installation (Recommended)

1. Log in to your WordPress admin dashboard
2. Navigate to **Plugins > Add New**
3. Search for "MM AI Post Generator"
4. Click **Install Now** and then **Activate**

### Manual Installation

1. Download the plugin zip file
2. Extract the contents to your computer
3. Upload the `mm-ai-post-generator` folder to `/wp-content/plugins/`
4. Activate the plugin through the **Plugins** menu in WordPress

### System Requirements

**Minimum Requirements:**
- WordPress 5.8 or higher
- PHP 7.4 or higher
- MySQL 5.6 or higher
- cURL PHP extension
- JSON PHP extension
- OpenSSL PHP extension

**Recommended:**
- WordPress 6.0 or higher
- PHP 8.0 or higher
- 128MB+ memory limit
- Pretty permalinks enabled

== Configuration ==

### Step 1: API Configuration

1. Navigate to **MM AI Post Generator > Settings** in your WordPress admin
2. Enter your AI API credentials:
   - **API Key**: Your OpenAI or compatible API key
   - **API URL**: Endpoint URL (default: https://api.openai.com/v1)
   - **API Model**: AI model to use (e.g., gpt-3.5-turbo)

### Step 2: Default Settings

Configure your preferred defaults:
- **Default Tone**: Professional, Casual, Informative, Friendly, or Formal
- **Default Length**: Short (300-500 words), Medium (500-1000 words), or Long (1000+ words)
- **FAQ Schema**: Enable/disable automatic FAQ generation
- **Cache Duration**: How long to cache generated content

### Step 3: Advanced Settings

Fine-tune performance:
- **Rate Limiting**: Control API usage (requests per hour)
- **Cache Settings**: Optimize for your server resources

== Usage ==

### Method : Admin Dashboard

1. Go to **MM AI Post Generator > Generate Content**
2. Fill in the content details:
   - **Keywords/Topic**: Main topic or keywords
   - **Target Audience**: Describe your audience (optional)
   - **Tone**: Select writing style
   - **Content Length**: Choose article length
   - **Post Type**: Where to save the content
3. Click **Generate Content**
4. Review and edit the generated content
5. Click **Insert as Draft Post** to save

== API Providers ==

### OpenAI
- **URL**: `https://api.openai.com/v1`
- **Models**: `gpt-3.5-turbo`, `gpt-4`, `gpt-4-turbo-preview`
- **Best for**: High-quality content, complex topics

### Groq
- **URL**: `https://api.groq.com/openai/v1`
- **Models**: `mixtral-8x7b-32768`, `llama2-70b-4096`
- **Best for**: Fast generation, cost-effective

### Other Providers
Any OpenAI-compatible API endpoint is supported. Configure the URL and model accordingly.

== External services ==

This plugin relies on external AI API services to generate content. When you use MM AI Post Generator, your site will communicate with these services as configured in the plugin settings.

### OpenAI

- **What it is used for**: Generating blog post titles, meta descriptions, full article content, and FAQs.
- **When data is sent**:
  - When you click **Generate Content** in the MM AI Post Generator interface.
  - When you trigger content generation via the REST API.
- **What data is sent**:
  - Your prompt parameters, including:
    - Keywords / topic
    - Optional target audience description
    - Desired tone and content length
    - (Optionally) language or other configuration fields you provide in the form
  - The plugin also sends system instructions that describe the desired JSON response format.
  - Your **API key** is used only in the HTTP Authorization header to authenticate with the OpenAI API.
- **Where it is sent**:
  - To the OpenAI API at `https://api.openai.com/v1` (or the URL you configure).
- **Legal**:
  - OpenAI Terms of Use: https://openai.com/policies/terms-of-use
  - OpenAI Privacy Policy: https://openai.com/policies/privacy-policy

### Groq

- **What it is used for**: As an alternative AI provider for generating the same types of content as OpenAI (titles, meta descriptions, article body, FAQs).
- **When data is sent**:
  - When you configure the API URL to a Groq endpoint and click **Generate Content**, or when you call the REST API.
- **What data is sent**:
  - The same prompt parameters as above (keywords/topic, tone, length, audience, etc.).
  - System instructions describing the desired JSON response format.
  - Your Groq-compatible **API key** in the HTTP Authorization header.
- **Where it is sent**:
  - To the Groq OpenAI-compatible API at `https://api.groq.com/openai/v1` (or the URL you configure).
- **Legal**:
  - Groq Terms of Use: https://groq.com/terms-of-use/
  - Groq Privacy Policy: https://groq.com/privacy-policy/

== Frequently Asked Questions ==

### General Questions

**Q: How much does API usage cost?**
A: Costs vary by provider. OpenAI charges per token, Groq offers competitive pricing. Monitor your usage in your API provider's dashboard.

**Q: Can I edit generated content?**
A: Yes! All generated content is editable. Review and modify before publishing.

**Q: Does this work with my theme?**
A: Yes, the plugin works with any WordPress theme that supports standard post types.

**Q: Can I generate content in other languages?**
A: Yes, specify the language in your content prompts or target audience field.

### Technical Questions

**Q: How does caching work?**
A: The plugin caches generated content to reduce API calls. Configure cache duration in settings.

**Q: Is my API key secure?**
A: Yes, API keys are encrypted and stored securely. Never logged or exposed.

**Q: Can I use multiple API providers?**
A: Currently one provider at a time, but you can switch between them.

**Q: What's the rate limiting for?**
A: Prevents API quota exhaustion and ensures fair usage across your site.

== Screenshots ==

1. **Settings Page** - Configure your AI provider and preferences
2. **Settings Page** - Configure your AI provider and preferences
3. **Content Generator** - Generate content with advanced options
4. **Content Generator** - Generate content with advanced options
5. **Content Generator** - Generate content with advanced options
6. **Gutenberg Block** - Create content directly in the editor
7. Key word input section


== Changelog ==

= 1.0.1 =
* Some suggestd changes

= 1.0.0 =
* Initial release
* AI-powered content generation
* Multiple AI provider support (OpenAI, Groq)
* Gutenberg block integration
* Admin dashboard interface
* SEO optimization features
* Rate limiting and caching
* System diagnostics
* Comprehensive logging
* Security hardening

== Upgrade Notice ==

= 1.0.0 =
Initial release. Configure your API settings and start generating content!

== License ==

This plugin is licensed under the GPL v2 or later.

    MM AI Post Generator
    Copyright (C) 2024, Maulik Makwana

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <https://www.gnu.org/licenses/>.