# SEO.AI Publisher

Connect your WordPress site to the SEO.AI platform to automatically receive and publish optimized blog content.

## Description

SEO.AI Publisher is a WordPress plugin that creates a secure REST API endpoint allowing the SEO.AI platform to automatically publish content to your WordPress site. It supports features like:

- Secure OAuth 2.0 authentication with PKCE
- HMAC-based request verification
- Automatic post creation and updates
- Featured image handling
- Category and tag management
- SEO metadata support (Yoast SEO, Rank Math, All in One SEO)

## Installation

1. Upload the `seoai-publisher` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Navigate to the SEO.AI Publisher settings page
4. Enter your API key from the SEO.AI platform
5. Click "Connect Now" to authenticate your site

## Configuration

### Getting Your API Key

1. Log in to your SEO.AI account
2. Navigate to Settings > API Keys
3. Create a new API key for your WordPress site
4. Copy the key

### Connecting Your Site

1. Go to **SEO.AI Publisher** in your WordPress admin
2. Paste your API key
3. Click **Connect Now**
4. You'll be redirected to authorize the connection
5. Once authorized, your site will be connected

## Features

### Post Creation

The API supports creating posts with:

- Title, content, and excerpt
- Custom slug
- Post status
- Author assignment
- External ID for tracking
- Featured images
- Categories and tags
- SEO metadata

### Security

- OAuth 2.0 with PKCE for secure authentication
- HMAC signature verification for API requests
- Timestamp validation to prevent replay attacks
- Secure random key generation
- Input sanitization and validation

### SEO Plugin Support

The plugin automatically integrates with popular SEO plugins:

- Yoast SEO
- Rank Math
- All in One SEO

### Media Handling

- Automatic image download and attachment
- Duplicate detection to prevent re-downloading
- Image type validation
- Size limits (10MB max)
- Featured image support

## Troubleshooting

### Connection Issues

1. Verify your API key is correct
2. Check that your site is accessible from the internet
3. Ensure SSL is properly configured

## Support

For support, please visit [https://seo.ai/support](https://seo.ai/support)

## License

This plugin is licensed under the GPLv2 or later.

## Credits

Developed by SEO.AI Team
