=== AEO WP Plugin ===
Contributors: aeowpplugin
Tags: aeo, answer-engine-optimization, seo, content-optimization, ai
Requires at least: 5.9
Requires PHP: 7.4
Tested up to: 6.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Check if your WordPress website or content is Answer Engine Optimization (AEO) friendly with AI-powered recommendations.

== Description ==

AEO WP Plugin helps you optimize your WordPress site for Answer Engine Optimization. With AI-powered scanning and comprehensive analysis, you get actionable recommendations to improve your content's visibility in answer engines.

### Features

- **Website & Page Scanning**: Scan your homepage or specific posts/pages
- **AEO Score**: Get a score from 0-100 based on AEO best practices
- **Issue Detection**: Identify specific optimization issues with severity levels
- **Actionable Recommendations**: Clear, step-by-step fixes to improve your AEO score
- **Real-time Scanning**: Fast, on-demand scanning from the dashboard
- **Gutenberg Integration**: Scan posts directly from the block editor
- **Secure API Key Management**: Safely store and manage your API credentials
- **Rate Limiting**: Free tier includes 10 daily scans
- **Premium Plans**: Unlimited scans and priority support available

### Screenshots

1. Modern Admin Dashboard with AEO Score Visualization
2. Detailed Issues and Recommendations Panel
3. Gutenberg Editor Sidebar Integration
4. Settings Page for API Key Management

## Installation

1. Extract the plugin files to the `/wp-content/plugins/aeowpplugin/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to AEO WP > Settings to add your API key
4. Start scanning from the dashboard or Gutenberg editor

## Getting Started

### Step 1: Get Your API Key
Visit https://aeowpplugin.com/dashboard to get your free API key.

### Step 2: Configure the Plugin
- Navigate to **AEO WP > Settings**
- Paste your API key in the "API Key" field
- Click "Save API Key"

### Step 3: Run Your First Scan
- Go to **AEO WP > Dashboard**
- Choose scan type (Website or Specific Post/Page)
- Enter the URL you want to scan
- Click "Start Scan"
- Review the results and recommendations

### Step 4: Optimize Your Content
Follow the actionable recommendations to improve your AEO score.

## Dashboard

The main dashboard displays:
- **AEO Score Gauge**: Visual representation of your score (0-100)
- **Status Badge**: Quick status indicator (Poor, Average, Good, Excellent)
- **Issues Panel**: List of detected AEO issues with severity levels
- **Recommendations Panel**: Clear fixes to improve your score
- **Scan History**: Details about your last scan

## Gutenberg Integration

When editing posts or pages:
- Look for the **AEO WP** panel in the sidebar
- Click "Scan This Post" to analyze the current content
- View inline score and recommendations without leaving the editor
- Make improvements and re-scan as needed

## Settings

### API Configuration
- Add your API key securely using WordPress Options API
- Key is encrypted and never exposed in the frontend

### Account Information
- View your current plan type (Free or Premium)
- Check daily scans remaining
- See support level information

### Rate Limiting
- Free plan: 10 scans per day
- Premium plans: Unlimited scans with priority API access
- Upgrade at https://aeowpplugin.com/pricing

## Security Features

- **Nonce Verification**: All AJAX requests are protected with WordPress nonces
- **Input Sanitization**: All user inputs are sanitized and validated
- **Secure API Requests**: API key sent securely with Bearer token authentication
- **No Hard-coded Secrets**: All sensitive data stored in WordPress Options API
- **Escaping**: All output properly escaped to prevent XSS attacks

## API Response Format

The plugin expects the following response from the external AEO API:

```json
{
  "score": 0-100,
  "status": "Poor|Average|Good|Excellent",
  "issues": [
    {
      "title": "Issue Title",
      "description": "Issue Description",
      "severity": "low|medium|high"
    }
  ],
  "recommendations": [
    {
      "title": "Recommendation Title",
      "fix": "How to fix this"
    }
  ]
}
```

## Premium Features

Upgrade to Premium for:
- Unlimited daily scans
- Priority API access (faster response times)
- Priority email support
- Advanced analytics
- Custom reporting

Visit https://aeowpplugin.com/pricing to upgrade.

## Troubleshooting

### "API Key not configured" Error
- Go to Settings and add your API key
- Save the API key before running scans

### Rate Limit Exceeded
- You've reached your daily scan limit (10 for free tier)
- Wait 24 hours for the counter to reset
- Upgrade to Premium for unlimited scans

### Invalid or Expired API Key Error
- Check that your API key is correct
- Verify the key hasn't expired in your account dashboard
- Generate a new key if needed

### Scan Timeout
- The API took too long to respond
- Try again in a few moments
- Check your internet connection

## Support

- Documentation: https://aeowpplugin.com/docs
- Support Portal: https://aeowpplugin.com/support
- Report Issues: https://aeowpplugin.com/contact

## Credits

Developed by AEO WP Plugin
Website: https://aeowpplugin.com

## Changelog

### 1.0.0
- Initial release
- Dashboard with AEO score visualization
- Settings page for API key management
- Gutenberg editor integration
- Rate limiting for free tier
- Mock API responses for development
- Comprehensive security features

## License

This plugin is licensed under the GPL v2 or later.

== Frequently Asked Questions ==

= How often can I scan my website? =
With the free plan, you can scan 10 times per day. After 24 hours, the counter resets. Premium plans offer unlimited scans.

= Is my API key secure? =
Yes. API keys are stored securely using WordPress Options API and are never exposed on the frontend. All API communication uses secure HTTPS with Bearer token authentication.

= Can I scan multiple websites? =
Yes! You can scan your main website or any other website URL you have permission to scan.

= What does the AEO score mean? =
The score (0-100) represents how well-optimized your content is for Answer Engines. Higher scores indicate better optimization for AI-powered search results.

= Can I scan posts in the block editor? =
Yes! The plugin includes a sidebar panel in Gutenberg where you can scan and view recommendations without leaving the editor.

= What if I reach my daily scan limit? =
The dashboard will show a clear message when you've reached your limit. You can wait 24 hours for the counter to reset or upgrade to a Premium plan for unlimited scans.

== Advanced Topics ==

= Custom API Endpoint =
To use a custom API endpoint, modify the API_ENDPOINT constant in includes/api-handler.php

= Extending the Plugin =
The plugin uses hooks and filters. Documentation available at https://aeowpplugin.com/developers

= Database Requirements =
No additional database tables are created. The plugin uses WordPress Options API for data storage.

= Performance Impact =
The plugin has minimal performance impact:
- Scan requests are made asynchronously
- Dashboard loads quickly with cached data
- No frontend JavaScript by default

== Support and Feedback ==

We'd love to hear from you!
- Share feedback: https://aeowpplugin.com/feedback
- Report bugs: https://aeowpplugin.com/report-issue
- Request features: https://aeowpplugin.com/feature-request
