PHPackages                             praison/seo-wordpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. praison/seo-wordpress

ActiveWordpress-plugin

praison/seo-wordpress
=====================

SEO Wordpress Plugin by Mervin Praison is a Powerfull Plugin which has many SEO Features. Google Authorship and Google Analytics Integration.

v4.0.18(6mo ago)07GPL-2.0-or-laterPHP

Since Oct 24Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/Praison/SEO-WordPress)[ Packagist](https://packagist.org/packages/praison/seo-wordpress)[ Docs](https://praison.com/wordpress/plugins/seo/)[ RSS](/packages/praison-seo-wordpress/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

AISEO - AI-Powered SEO Plugin for WordPress
===========================================

[](#aiseo---ai-powered-seo-plugin-for-wordpress)

[![Version](https://camo.githubusercontent.com/34e695c6016bc2a934a96bed696e29b2f2ab562a7134d65a55d00653cd506bea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c75652e737667)](https://github.com/MervinPraison/WordPressAISEO)[![WordPress](https://camo.githubusercontent.com/159156c59d31514839d607472dda5254861d319e096451373c7e198fb307347d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f576f726450726573732d352e302532422d626c75652e737667)](https://wordpress.org)[![PHP](https://camo.githubusercontent.com/46a695f7a54c084f557b0c4d071535f93bc900c7f3c5555b72cee70a1ecd670c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d372e342532422d707572706c652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/ac405d9558280126e4191a23404aec222f4a29077fe388ad9c5abb349b62de7e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d47504c2d2d322e302d677265656e2e737667)](LICENSE)

AI-powered SEO optimization for WordPress. Automatically generate meta descriptions, titles, schema markup, and comprehensive SEO analysis using OpenAI's GPT-4o-mini model.

**🤖 AI by Design** - Every feature is built with AI at its core, not as an afterthought.

---

🌟 Why AISEO?
------------

[](#-why-aiseo)

### Most Comprehensive AI SEO Plugin

[](#most-comprehensive-ai-seo-plugin)

- ✅ **34 features** (more than any competitor)
- ✅ **63+ REST API endpoints** (vs ~10-15 for competitors)
- ✅ **74+ WP-CLI commands** (vs ~15-25 for competitors)
- ✅ **40+ SEO factors analyzed** (vs ~20-30 for competitors)

### Developer-Friendly

[](#developer-friendly)

- ✅ Complete REST API for headless WordPress
- ✅ Extensive WP-CLI for automation
- ✅ Well-documented codebase (25,000+ lines)

### Security-First

[](#security-first)

- ✅ AES-256-CBC encryption
- ✅ All WordPress security best practices
- ✅ No vulnerabilities

### Performance-Optimized

[](#performance-optimized)

- ✅ Smart caching system (24-hour TTL)
- ✅ Async processing via WP-Cron
- ✅ Database query optimization

---

🚀 Features
----------

[](#-features)

### Core Features

[](#core-features)

#### 1. **AI-Powered Content Generation**

[](#1-ai-powered-content-generation)

- **AI Post Creator** - Generate complete blog posts with AI (title, content, SEO metadata)
- **Meta Title Generation** - AI-generated SEO-optimized titles (50-60 characters)
- **Meta Description Generation** - Compelling descriptions (155-160 characters)
- **Multiple Suggestions** - Get 3 AI-generated options to choose from
- **Content Analysis** - AI-powered content quality assessment (11 metrics)
- **Image SEO &amp; Alt Text** - Automatic AI-powered alt text generation
- **Advanced SEO Analysis** - Comprehensive 40+ factor analysis
- **Smart Content Rewriter** - 6 rewrite modes (improve, simplify, expand, shorten, professional, casual)
- **Meta Description Variations** - Generate 5+ variations with scoring and A/B testing support

#### 2. **SEO Analysis &amp; Optimization**

[](#2-seo-analysis--optimization)

- **Content Analysis Engine** - 11 SEO metrics with actionable recommendations
- **Enhanced Readability Analysis** - 6 readability metrics (Flesch, Gunning Fog, SMOG, etc.)
- **Advanced SEO Analysis** - 40+ factors analyzed across content, technical, and UX
- **Unified Reporting System** - Comprehensive reports combining all analyzers
- **Permalink Optimization** - Remove stop words, SEO-friendly slug suggestions
- **Internal Linking Suggestions** - AI-powered related content suggestions, orphan page detection

#### 3. **Technical SEO**

[](#3-technical-seo)

- **Schema Markup Generator** - JSON-LD for Article, BlogPosting, WebPage, FAQ, HowTo
- **Meta Tags Management** - Automatic injection of SEO meta tags in ``
- **Social Media Optimization** - Open Graph and Twitter Card tags
- **XML Sitemap Generator** - Automatic **sitemap.xml** (also available at wp-sitemap.xml) with smart caching
- **Canonical URLs** - Prevent duplicate content issues
- **Robots Meta Tags** - Control indexing and following

#### 4. **Content Management**

[](#4-content-management)

- **Bulk Editing Interface** - Edit metadata for multiple posts at once
- **Import/Export Functionality** - Import from Yoast, Rank Math, AIOSEO; Export to JSON/CSV
- **Multilingual SEO Support** - WPML, Polylang, TranslatePress compatibility
- **Custom Post Type Support** - Extend SEO to any custom post type
- **404 Monitor &amp; Redirection Manager** - Monitor errors, AI-powered redirect suggestions

#### 5. **AI-Powered Tools**

[](#5-ai-powered-tools)

- **AI-Powered FAQ Generator** - Auto-generate FAQs from content with schema markup
- **Content Outline Generator** - AI-powered content outlines with structured headings
- **Content Suggestions** - AI topic ideas, optimization tips, trending topics
- **Automated Testing System** - Comprehensive test suite for all endpoints and commands

#### 6. **Developer Features**

[](#6-developer-features)

- **REST API** - 60+ endpoints for all features
- **WP-CLI Commands** - 70+ commands for automation and batch processing
- **Caching System** - Transient cache with 24-hour TTL, Redis/Memcached compatible
- **Logging &amp; Monitoring** - Structured logging with JSON format
- **Performance Optimization** - Async processing, conditional loading, database optimization

---

📊 Implementation Status
-----------------------

[](#-implementation-status)

**Version 1.0.0 - Feature Complete!**

✅ **33 Features Implemented** (27 core + 6 bonus features)

CategoryStatusFeatures**Core Features (1-7)**✅ 7/7AI Meta Generation, Content Analysis, Schema Markup, Social Media, XML Sitemap, Permalink Optimization, Internal Linking**Phase 1 (8-11)**✅ 4/4Image SEO, Advanced Analysis (40+ factors), Bulk Editing, Import/Export**Phase 2 (12-14)**⏳ 0/3Google Search Console, Google Analytics 4, Rank Tracking (requires paid APIs)**Phase 3 (15-16)**✅ 2/2404 Monitor &amp; Redirects, Internal Linking**Phase 4 (17-21)**✅ 2/5Content Suggestions, Multilingual Support (Competitor/Keyword/Backlink require paid APIs)**Bonus Features**✅ 6/6Enhanced Readability, FAQ Generator, Content Outline, Smart Rewriter, Meta Variations, Unified Reporting**API Coverage:**

- ✅ 60+ REST API endpoints
- ✅ 70+ WP-CLI commands
- ✅ 6 database tables
- ✅ Full documentation

**See [IMPLEMENTATION-STATUS.md](IMPLEMENTATION-STATUS.md) for detailed feature breakdown.**

---

📦 Installation
--------------

[](#-installation)

### Requirements

[](#requirements)

- WordPress 5.0 or higher
- PHP 7.4 or higher
- OpenAI API key ([Get one here](https://platform.openai.com/api-keys))

### Quick Install

[](#quick-install)

1. **Download the plugin**

    ```
    cd wp-content/plugins
    git clone https://github.com/MervinPraison/WordPressAISEO.git
    ```
2. **Activate the plugin**

    ```
    wp plugin activate aiseo
    ```
3. **Configure API key**

    **Option A:** Via WordPress Admin

    - Go to Settings → AISEO
    - Enter your OpenAI API key
    - Click Save

    **Option B:** Using `.env` file (recommended for development)

    ```
    cd wp-content/plugins/aiseo
    echo "OPENAI_API_KEY=your-api-key-here" > .env
    ```

    **Option C:** Using WP-CLI

    ```
    wp eval 'AISEO_Helpers::save_api_key("your-api-key-here");'
    ```

---

🎯 Quick Start
-------------

[](#-quick-start)

### Generate SEO Metadata

[](#generate-seo-metadata)

**Via Admin Interface:**

1. Edit any post or page
2. Scroll to "AISEO - SEO Optimization" metabox
3. Click "Generate Title" or "Generate Description"
4. Review AI-generated suggestions
5. Click "Use This" to apply

**Via WP-CLI:**

```
# Generate metadata for a single post
wp aiseo generate --id=123 --meta=title,description

# Generate for all posts
wp aiseo generate --all --post-type=post
```

**Via REST API:**

```
# Generate SEO title
curl -X POST https://yoursite.test/wp-json/aiseo/v1/generate/title \
  -H "Content-Type: application/json" \
  -d '{"content": "Your post content", "keyword": "wordpress seo"}'
```

### Analyze SEO

[](#analyze-seo)

**Via WP-CLI:**

```
# Analyze single post
wp aiseo analyze --id=123

# Analyze all posts and export to CSV
wp aiseo analyze --all --format=csv > seo-report.csv
```

**Via REST API:**

```
# Analyze post SEO (11 metrics)
curl -X POST https://yoursite.test/wp-json/aiseo/v1/analyze \
  -H "Content-Type: application/json" \
  -d '{"post_id": 123}'
```

---

🔌 REST API Endpoints
--------------------

[](#-rest-api-endpoints)

All endpoints are tested and working! Perfect for browser testing, mobile apps, JavaScript integrations, and automation.

### Core Endpoints

[](#core-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/status`GETPlugin status and configuration`/wp-json/aiseo/v1/validate-key`GETValidate OpenAI API key`/wp-json/aiseo/v1/generate/title`POSTGenerate SEO title`/wp-json/aiseo/v1/generate/description`POSTGenerate meta description`/wp-json/aiseo/v1/generate/post/{id}`POSTGenerate metadata for post### Analysis Endpoints

[](#analysis-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/analyze`POSTComprehensive SEO analysis (11 metrics)`/wp-json/aiseo/v1/analyze/advanced/{id}`GETAdvanced SEO analysis (40+ factors)`/wp-json/aiseo/v1/readability/analyze/{post_id}`GETEnhanced readability analysis`/wp-json/aiseo/v1/report/unified/{id}`GETGet unified SEO report`/wp-json/aiseo/v1/report/history/{id}`GETGet historical reports### Schema &amp; Meta Endpoints

[](#schema--meta-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/schema/{id}`GETGet schema markup (JSON-LD)`/wp-json/aiseo/v1/meta-tags/{id}`GETGet all meta tags for a post`/wp-json/aiseo/v1/social-tags/{id}`GETGet social media tags (OG &amp; Twitter)`/wp-json/aiseo/v1/sitemap/stats`GETGet sitemap statistics### Image SEO Endpoints

[](#image-seo-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/image/generate-alt/{id}`POSTGenerate alt text for image`/wp-json/aiseo/v1/image/missing-alt`GETGet images missing alt text`/wp-json/aiseo/v1/image/seo-score/{id}`GETGet image SEO score### Bulk Operations Endpoints

[](#bulk-operations-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/bulk/posts`GETGet posts for bulk editing`/wp-json/aiseo/v1/bulk/update`POSTBulk update multiple posts`/wp-json/aiseo/v1/bulk/generate`POSTBulk generate metadata with AI`/wp-json/aiseo/v1/bulk/preview`POSTPreview bulk changes### Import/Export Endpoints

[](#importexport-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/export/json`GETExport metadata to JSON`/wp-json/aiseo/v1/export/csv`GETExport metadata to CSV`/wp-json/aiseo/v1/import/json`POSTImport from JSON`/wp-json/aiseo/v1/import/yoast`POSTImport from Yoast SEO`/wp-json/aiseo/v1/import/rankmath`POSTImport from Rank Math`/wp-json/aiseo/v1/import/aioseo`POSTImport from AIOSEO### Content &amp; Linking Endpoints

[](#content--linking-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/internal-linking/suggestions/{post_id}`GETGet internal linking suggestions`/wp-json/aiseo/v1/internal-linking/orphans`GETDetect orphan pages`/wp-json/aiseo/v1/content/topics`POSTGet AI topic suggestions`/wp-json/aiseo/v1/content/optimize/{post_id}`GETGet optimization tips for post`/wp-json/aiseo/v1/content/trending`GETGet trending topics`/wp-json/aiseo/v1/content/brief`POSTGenerate content brief### Redirects &amp; 404 Endpoints

[](#redirects--404-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/404/errors`GETGet 404 errors log`/wp-json/aiseo/v1/404/suggest`POSTAI-powered redirect suggestions`/wp-json/aiseo/v1/redirects/create`POSTCreate redirect`/wp-json/aiseo/v1/redirects/list`GETGet all redirects`/wp-json/aiseo/v1/redirects/delete/{id}`DELETEDelete redirect`/wp-json/aiseo/v1/redirects/import`POSTBulk import redirects from CSV`/wp-json/aiseo/v1/redirects/export`GETExport redirects to CSV### AI Tools Endpoints

[](#ai-tools-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/post/create`POSTCreate AI-generated post`/wp-json/aiseo/v1/post/bulk-create`POSTBulk create AI-generated posts`/wp-json/aiseo/v1/post/stats`GETGet post creator statistics`/wp-json/aiseo/v1/faq/generate/{post_id}`POSTGenerate FAQs from content`/wp-json/aiseo/v1/faq/get/{post_id}`GETGet saved FAQs`/wp-json/aiseo/v1/outline/generate`POSTGenerate content outline`/wp-json/aiseo/v1/rewrite/content`POSTRewrite content with AI`/wp-json/aiseo/v1/meta/variations/{post_id}`POSTGenerate meta variations### Multilingual &amp; CPT Endpoints

[](#multilingual--cpt-endpoints)

EndpointMethodDescription`/wp-json/aiseo/v1/multilingual/plugin`GETGet active multilingual plugin`/wp-json/aiseo/v1/multilingual/languages`GETGet available languages`/wp-json/aiseo/v1/multilingual/translations/{id}`GETGet post translations`/wp-json/aiseo/v1/multilingual/sync/{id}`POSTSync metadata across translations`/wp-json/aiseo/v1/cpt/list`GETList all custom post types`/wp-json/aiseo/v1/cpt/supported`GETGet supported post types`/wp-json/aiseo/v1/cpt/enable`POSTEnable SEO for post type**Full API documentation:** See [REST API Examples](#rest-api-examples) below.

---

💻 WP-CLI Commands
-----------------

[](#-wp-cli-commands)

Comprehensive command-line interface for automation and batch processing.

### Core Commands

[](#core-commands)

CommandDescription`wp aiseo generate`Generate SEO metadata (by slug, ID, or --all)`wp aiseo analyze`Analyze SEO scores with multiple output formats`wp aiseo meta`Get/update/delete specific metadata fields`wp aiseo cache`Clear AISEO caches`wp aiseo export`Export metadata to JSON### Image SEO Commands

[](#image-seo-commands)

CommandDescription`wp aiseo image generate-alt`Generate alt text for image`wp aiseo image bulk-generate`Bulk generate alt text`wp aiseo image detect-missing`Find images without alt text`wp aiseo image analyze`Analyze image SEO for post### Analysis Commands

[](#analysis-commands)

CommandDescription`wp aiseo advanced analyze`Advanced SEO analysis (40+ factors)`wp aiseo advanced bulk`Bulk advanced analysis`wp aiseo readability analyze `Enhanced readability analysis`wp aiseo readability bulk`Bulk readability analysis`wp aiseo report unified `Generate unified SEO report`wp aiseo report history `Get historical reports### Bulk Operations Commands

[](#bulk-operations-commands)

CommandDescription`wp aiseo bulk list`List posts for bulk editing`wp aiseo bulk update`Bulk update metadata`wp aiseo bulk generate`Bulk generate metadata with AI`wp aiseo bulk preview`Preview bulk changes### Import/Export Commands

[](#importexport-commands)

CommandDescription`wp aiseo export json`Export to JSON`wp aiseo export csv`Export to CSV`wp aiseo import json`Import from JSON file`wp aiseo import yoast`Import from Yoast SEO`wp aiseo import rankmath`Import from Rank Math`wp aiseo import aioseo`Import from AIOSEO### Content &amp; Linking Commands

[](#content--linking-commands)

CommandDescription`wp aiseo internal-linking suggestions `Get internal linking suggestions`wp aiseo internal-linking orphans`Detect orphan pages`wp aiseo content topics`Get AI-powered topic suggestions`wp aiseo content optimize `Get optimization tips for post`wp aiseo content trending `Get trending topics### Redirects &amp; 404 Commands

[](#redirects--404-commands)

CommandDescription`wp aiseo 404 errors`Get 404 errors log`wp aiseo 404 suggest `Get AI-powered redirect suggestions`wp aiseo redirects create  `Create redirect`wp aiseo redirects list`List all redirects`wp aiseo redirects import `Import redirects from CSV`wp aiseo redirects export`Export redirects to CSV### AI Tools Commands

[](#ai-tools-commands)

CommandDescription`wp aiseo post create`Create AI-generated post`wp aiseo post bulk-create `Bulk create posts from CSV/JSON`wp aiseo post list`List AI-generated posts`wp aiseo post stats`Get post creator statistics`wp aiseo faq generate `Generate FAQs from content`wp aiseo outline generate `Generate content outline`wp aiseo rewrite content `Rewrite post content`wp aiseo meta variations `Generate meta variations`wp aiseo permalink optimize `Optimize permalink### Multilingual &amp; CPT Commands

[](#multilingual--cpt-commands)

CommandDescription`wp aiseo multilingual plugin`Get active multilingual plugin`wp aiseo multilingual sync`Sync metadata across translations`wp aiseo cpt list`List all custom post types`wp aiseo cpt enable`Enable SEO for post type`wp aiseo cpt bulk-generate`Bulk generate metadata**Full CLI documentation:** See [WP-CLI Examples](#wp-cli-examples) below.

---

🧪 Testing
---------

[](#-testing)

### Quick Test Commands

[](#quick-test-commands)

```
# Test plugin status
curl https://yoursite.test/wp-json/aiseo/v1/status

# Test SEO analysis
curl -X POST https://yoursite.test/wp-json/aiseo/v1/analyze \
  -H "Content-Type: application/json" \
  -d '{"post_id": 123}'

# Test WP-CLI
wp aiseo analyze --id=123
```

### Complete Testing Workflow

[](#complete-testing-workflow)

```
# 1. Create test post
POST_ID=$(wp post create --post_title="Test SEO Post" \
  --post_content="Lorem ipsum dolor sit amet..." \
  --post_status=publish --porcelain)

# 2. Set focus keyword
wp aiseo meta update $POST_ID focus_keyword "wordpress seo"

# 3. Generate all metadata
wp aiseo generate --id=$POST_ID --meta=all

# 4. Analyze content
wp aiseo analyze --id=$POST_ID --format=json

# 5. Verify via REST API
curl https://yoursite.test/wp-json/aiseo/v1/meta-tags/$POST_ID
```

For comprehensive testing documentation, see [tests/TESTING.md](tests/TESTING.md).

---

🔧 Configuration
---------------

[](#-configuration)

### Plugin Options

[](#plugin-options)

OptionDefaultDescription`aiseo_api_model``gpt-4o-mini`OpenAI model to use`aiseo_api_timeout``45`API timeout in seconds`aiseo_rate_limit_per_minute``10`Requests per minute`aiseo_rate_limit_per_hour``60`Requests per hour### Update Configuration

[](#update-configuration)

```
# Change API model
wp option update aiseo_api_model "gpt-4o"

# Adjust rate limits
wp option update aiseo_rate_limit_per_minute 20
```

---

🔒 Security Features
-------------------

[](#-security-features)

- **AES-256-CBC Encryption** - API keys encrypted in database
- **Nonce Verification** - All AJAX requests protected
- **Capability Checks** - Proper WordPress permission handling
- **Input Sanitization** - XSS and SQL injection prevention
- **Output Escaping** - All output properly escaped

---

⚡ Performance
-------------

[](#-performance)

- **Caching System** - Transient cache with 24-hour TTL
- **Object Cache Support** - Redis/Memcached compatible
- **Conditional Loading** - Scripts only on relevant pages
- **Database Optimization** - Indexed queries and batch updates
- **Async Processing** - WP-Cron for background tasks

---

📊 OpenAI API Integration
------------------------

[](#-openai-api-integration)

- **GPT-4o-mini Model** - Cost-efficient AI model ($0.15/1M input tokens)
- **Rate Limiting** - 10 requests/minute, 60 requests/hour
- **Circuit Breaker** - Automatic failure handling
- **Retry Logic** - Exponential backoff (3 retries)
- **Token Tracking** - Monitor usage and costs
- **Error Handling** - Graceful degradation on API failures

### Cost Estimation

[](#cost-estimation)

- Average meta description: ~100 tokens = $0.00006
- Average SEO title: ~50 tokens = $0.00003

---

🐛 Debugging
-----------

[](#-debugging)

### Enable Debug Mode

[](#enable-debug-mode)

Add to `wp-config.php`:

```
define('AISEO_DEBUG', true);
```

### View Logs

[](#view-logs)

```
# View recent logs
wp db query "SELECT * FROM wp_aiseo_logs ORDER BY timestamp DESC LIMIT 50"

# View errors only
wp db query "SELECT * FROM wp_aiseo_logs WHERE level='ERROR' ORDER BY timestamp DESC LIMIT 20"
```

---

📚 Documentation
---------------

[](#-documentation)

- [Architecture Documentation](ARCHITECTURE.md) - Detailed technical architecture
- [Testing Guide](tests/TESTING.md) - Comprehensive testing workflows, REST API &amp; WP-CLI commands
- [Nonce Fix Summary](NONCE-FIX-SUMMARY.md) - AJAX nonce issue resolution
- [WordPress.org Checklist](WORDPRESS-ORG-CHECKLIST.md) - Publication checklist

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

---

🔧 Development Workflow
----------------------

[](#-development-workflow)

**AISEO follows a strict test-driven development workflow to ensure quality and reliability.**

### Feature Development Process

[](#feature-development-process)

For **every new feature**, follow this exact workflow:

```
1. Create Core Class → 2. Build REST API → 3. Build WP-CLI → 4. Test Both → 5. Update Docs

```

#### Step-by-Step:

[](#step-by-step)

**1. Create Core Class**

```
// Example: includes/class-aiseo-feature.php
class AISEO_Feature {
    public function process($data) {
        // Core logic here
    }
}
```

**2. Build REST API Endpoint**

```
// Add to includes/class-aiseo-rest.php
register_rest_route('aiseo/v1', '/feature/process', [
    'methods' => 'POST',
    'callback' => [$this, 'process_feature'],
    'permission_callback' => function() {
        return current_user_can('edit_posts');
    }
]);
```

**3. Build WP-CLI Command**

```
// Create: includes/cli/class-aiseo-feature-cli.php
class AISEO_Feature_CLI {
    public function process($args, $assoc_args) {
        WP_CLI::success('Feature processed!');
    }
}
WP_CLI::add_command('aiseo feature', 'AISEO_Feature_CLI');
```

**4. Test Both (CRITICAL)**

```
# Test REST API
curl -k "https://wordpress.test/wp-json/aiseo/v1/feature/process" \
  -X POST -H "Content-Type: application/json" \
  -d '{"data": "test"}'

# Test WP-CLI
wp aiseo feature process --data=test

# Both must work before proceeding!
```

**5. Update Documentation**

- Add feature to README.md (this file)
- Add REST endpoint to API section
- Add WP-CLI command to CLI section
- Add usage examples
- Update ARCHITECTURE.md with technical details

### Development Guidelines

[](#development-guidelines)

#### AI-First Approach

[](#ai-first-approach)

- ✅ **Always** use AI for content generation, analysis, and optimization
- ✅ **Focus** on features that don't require paid third-party services (except OpenAI)
- ✅ **Prioritize** free, AI-powered features over paid integrations
- ❌ **Avoid** features requiring paid APIs (SEMrush, Ahrefs, etc.) in core version

#### Code Quality Standards

[](#code-quality-standards)

```
# Generate code index for context
/opt/homebrew/bin/ctags -R --languages=PHP --output-format=json > api-index.json

# Follow WordPress Coding Standards
phpcs --standard=WordPress includes/

# Test before committing
./tests/test-all-endpoints.sh
```

#### Testing Requirements

[](#testing-requirements)

- ✅ **REST API**: Test with curl, browser, or Postman
- ✅ **WP-CLI**: Test all commands with various parameters
- ✅ **Both**: Must work simultaneously (no conflicts)
- ✅ **Documentation**: Update before marking feature complete

### Example: Complete Feature Implementation

[](#example-complete-feature-implementation)

```
# 1. Create core class
vim includes/class-aiseo-example.php

# 2. Add REST API endpoint
vim includes/class-aiseo-rest.php

# 3. Create WP-CLI command
vim includes/cli/class-aiseo-example-cli.php

# 4. Test REST API
curl -k "https://wordpress.test/wp-json/aiseo/v1/example/test"

# 5. Test WP-CLI
wp aiseo example test

# 6. Update docs
vim README.md
vim ARCHITECTURE.md

# 7. Commit
git add .
git commit -m "Add Example feature with REST API and WP-CLI"
```

### Quality Checklist

[](#quality-checklist)

Before marking any feature as "complete":

- Core class created and functional
- REST API endpoint registered and tested
- WP-CLI command registered and tested
- Both REST and CLI work without errors
- README.md updated with examples
- ARCHITECTURE.md updated with technical details
- Code follows WordPress standards
- Security checks implemented (nonces, capabilities)
- Error handling implemented
- Success/failure messages clear

---

📝 License
---------

[](#-license)

This project is licensed under the GPL-2.0-or-later License - see the [LICENSE](LICENSE) file for details.

---

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- OpenAI for the GPT-4o-mini API
- WordPress community for excellent documentation
- Yoast SEO and SEOPress for inspiration

---

📧 Support
---------

[](#-support)

- Documentation: This README and linked docs
- Issues: [GitHub Issues](https://github.com/MervinPraison/WordPressAISEO/issues)
- Website:

---

🌟 External Services
-------------------

[](#-external-services)

This plugin connects to the OpenAI API to provide AI-powered SEO features.

**Service Used:** OpenAI API ()

**Purpose:** The plugin sends post content and keywords to OpenAI to generate SEO titles, meta descriptions, content analysis, and other AI-powered features.

**Data Sent:** When a user actively uses AI generation features, the following data is transmitted:

- Post content (title and body)
- Focus keyword (if specified)
- User-specified parameters (e.g., tone, length)

**When Data is Sent:** Data is sent to OpenAI only when:

- A user actively clicks "Generate Title" or "Generate Description"
- A user runs WP-CLI commands with AI generation
- A user calls REST API endpoints for AI generation

**Privacy &amp; Terms:**

- Privacy Policy:
- Terms of Use:
- API Data Usage:

**User Control:** The plugin only connects to OpenAI when you provide an API key and explicitly use AI generation features. No data is sent without your explicit action.

---

🔐 API Authentication
--------------------

[](#-api-authentication)

### Security Notice

[](#security-notice)

As of version 1.0.0, all write operations (POST, PUT, DELETE) require authentication to protect your site from unauthorized access.

**Protected Endpoints:**

- All POST/PUT/DELETE operations (generate, update, import, etc.)
- Bulk operations
- Import/export operations
- Settings modifications

**Public Endpoints (Read-Only):**

- `/status` - Plugin status
- `/schema/{id}` - Schema markup
- `/meta-tags/{id}` - Meta tags
- `/analyze/advanced/{id}` - SEO analysis
- And other GET endpoints that only retrieve data

### Authentication Methods

[](#authentication-methods)

#### Method 1: WordPress Application Passwords (Recommended)

[](#method-1-wordpress-application-passwords-recommended)

1. **Create Application Password:**

    - Go to WordPress Admin → Users → Your Profile
    - Scroll to "Application Passwords"
    - Enter a name (e.g., "AISEO API")
    - Click "Add New Application Password"
    - Copy the generated password
2. **Use with cURL:**

```
# Using Basic Auth with Application Password
curl -X POST https://yoursite.test/wp-json/aiseo/v1/generate/title \
  --user "username:xxxx xxxx xxxx xxxx xxxx xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Your post content here",
    "keyword": "wordpress seo"
  }'
```

#### Method 2: Cookie Authentication (Browser/JavaScript)

[](#method-2-cookie-authentication-browserjavascript)

For browser-based requests, WordPress automatically handles authentication via cookies:

```
// JavaScript example (must be on same domain)
fetch('/wp-json/aiseo/v1/generate/title', {
  method: 'POST',
  credentials: 'same-origin', // Include cookies
  headers: {
    'Content-Type': 'application/json',
    'X-WP-Nonce': wpApiSettings.nonce // WordPress nonce
  },
  body: JSON.stringify({
    content: 'Your post content',
    keyword: 'wordpress seo'
  })
});
```

#### Method 3: OAuth (Advanced)

[](#method-3-oauth-advanced)

For third-party applications, use WordPress OAuth plugins like:

- WP OAuth Server
- OAuth2 Provider

### WP-CLI Authentication

[](#wp-cli-authentication)

**WP-CLI commands automatically use WordPress authentication** and are not affected by API restrictions. All commands work as normal:

```
# WP-CLI commands work without additional authentication
wp aiseo generate --id=123 --meta=title,description
wp aiseo analyze --id=123
wp aiseo bulk generate 123,456,789
```

**Why?** WP-CLI runs within the WordPress environment and has full access to all WordPress functions and capabilities.

---

REST API Examples
-----------------

[](#rest-api-examples)

### Generate SEO Title (Authenticated)

[](#generate-seo-title-authenticated)

```
# With Application Password
curl -X POST https://yoursite.test/wp-json/aiseo/v1/generate/title \
  --user "username:xxxx xxxx xxxx xxxx xxxx xxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "Your post content here",
    "keyword": "wordpress seo"
  }'
```

### Analyze Post SEO (Authenticated)

[](#analyze-post-seo-authenticated)

```
curl -X POST https://yoursite.test/wp-json/aiseo/v1/analyze \
  --user "username:xxxx xxxx xxxx xxxx xxxx xxxx" \
  -H "Content-Type: application/json" \
  -d '{"post_id": 123}'
```

### Get Schema Markup (Public - No Auth Required)

[](#get-schema-markup-public---no-auth-required)

```
# Read-only endpoints don't require authentication
curl https://yoursite.test/wp-json/aiseo/v1/schema/123
```

### Bulk Operations (Authenticated)

[](#bulk-operations-authenticated)

```
# Get posts for bulk editing (requires auth)
curl "https://yoursite.test/wp-json/aiseo/v1/bulk/posts?post_type=post&limit=10" \
  --user "username:xxxx xxxx xxxx xxxx xxxx xxxx"

# Bulk update posts (requires auth)
curl -X POST https://yoursite.test/wp-json/aiseo/v1/bulk/update \
  --user "username:xxxx xxxx xxxx xxxx xxxx xxxx" \
  -H "Content-Type: application/json" \
  -d '{"updates": [{"post_id": 123, "focus_keyword": "wordpress seo"}]}'
```

### Import/Export (Authenticated)

[](#importexport-authenticated)

```
# Export to JSON (requires auth)
curl "https://yoursite.test/wp-json/aiseo/v1/export/json?post_type=post" \
  --user "username:xxxx xxxx xxxx xxxx xxxx xxxx" \
  > export.json

# Import from Yoast SEO (requires auth)
curl -X POST https://yoursite.test/wp-json/aiseo/v1/import/yoast \
  --user "username:xxxx xxxx xxxx xxxx xxxx xxxx" \
  -H "Content-Type: application/json" \
  -d '{"post_type": "post", "overwrite": false}'
```

---

WP-CLI Examples
---------------

[](#wp-cli-examples)

### Generate Metadata

[](#generate-metadata)

```
# Single post
wp aiseo generate --id=123 --meta=title,description

# All posts
wp aiseo generate --all --post-type=post

# Dry run (preview without saving)
wp aiseo generate --id=123 --dry-run
```

### Analyze SEO

[](#analyze-seo-1)

```
# Single post
wp aiseo analyze --id=123

# All posts with JSON output
wp aiseo analyze --all --format=json

# Export to CSV
wp aiseo analyze --all --format=csv > seo-scores.csv
```

### Image SEO

[](#image-seo)

```
# Generate alt text for single image
wp aiseo image generate-alt 456

# Bulk generate alt text
wp aiseo image bulk-generate --missing-only --limit=50

# Detect images without alt text
wp aiseo image detect-missing --format=table
```

### Advanced Analysis

[](#advanced-analysis)

```
# Analyze post with 40+ SEO factors
wp aiseo advanced analyze 123

# Bulk analyze posts with scores below 70%
wp aiseo advanced bulk --min-score=70 --limit=20

# Export to CSV
wp aiseo advanced bulk --min-score=80 --format=csv > seo-report.csv
```

### Bulk Operations

[](#bulk-operations)

```
# List posts for bulk editing
wp aiseo bulk list --limit=20 --format=table

# Bulk update focus keyword
wp aiseo bulk update 123,456,789 --focus-keyword="wordpress seo"

# Bulk generate metadata
wp aiseo bulk generate 123,456,789 --meta-types=title,description
```

### Import/Export

[](#importexport)

```
# Export to JSON
wp aiseo export json --output=aiseo-export.json

# Export to CSV
wp aiseo export csv --output=aiseo-export.csv

# Import from JSON
wp aiseo import json aiseo-export.json

# Import from Yoast SEO
wp aiseo import yoast --post-type=post
```

---

📦 Publishing to WordPress.org
-----------------------------

[](#-publishing-to-wordpressorg)

This repository contains both `aiseo.php` and `seo-wordpress.php` (same content, different plugin names):

- **aiseo.php** - AISEO plugin
- **seo-wordpress.php** - Praison AI SEO plugin (for WordPress.org slug `seo-wordpress`)

### Publishing Steps

[](#publishing-steps)

```
# 1. Update version in aiseo.php, seo-wordpress.php, and readme.txt

# 2. Sync to SVN trunk
rsync -av --exclude='.git' --exclude='node_modules' --exclude='tests' --exclude='.env' --exclude='*.md' \
  /home/mervin/wordpress-plugins/WordPressAISEO/ \
  /home/mervin/wordpress-plugins/seo-wordpress-svn/trunk/ --delete

# 3. Remove dev files from SVN
rm -f trunk/.distignore trunk/.gitignore trunk/add-logging.js trunk/api-index.jsonl trunk/aiseo.php

# 4. Commit to SVN
cd /home/mervin/wordpress-plugins/seo-wordpress-svn
svn ci -m "Version X.X.X" --username mervinpraison

# 5. Create tag
svn cp trunk tags/X.X.X
svn ci -m "Tagging version X.X.X" --username mervinpraison
```

### Git Remotes

[](#git-remotes)

```
origin     -> github.com:MervinPraison/WordPressAISEO.git (main)
praison    -> github.com/Praison/seo-wordpress.git (master)
mervin-seo -> github.com/MervinPraison/seo-wordpress.git (master)
```

### Push to All Remotes

[](#push-to-all-remotes)

```
git push origin main
git push praison main:master
git push mervin-seo main:master
```

---

**Made with ❤️ by [PraisonAI](https://praison.ai)**

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance69

Regular maintenance activity

Popularity4

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

203d ago

### Community

---

Top Contributors

[![MervinPraison](https://avatars.githubusercontent.com/u/454862?v=4)](https://github.com/MervinPraison "MervinPraison (58 commits)")

### Embed Badge

![Health badge](/badges/praison-seo-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/praison-seo-wordpress/health.svg)](https://phpackages.com/packages/praison-seo-wordpress)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
