Igny8 AI SEO - Complete Technical Snapshot

Comprehensive AI-powered SEO operating system for WordPress

System Architecture

Igny8 is a sophisticated WordPress plugin that combines AI automation with configuration-driven architecture to deliver enterprise-level SEO functionality.

  • Modular Design: Independent modules with clear interfaces
  • AI-Centric: OpenAI integration for intelligent automation
  • Configuration-Driven: All UI components render from configuration files
  • Automation-First: CRON-based workflows for hands-off operation

Core Modules

Eight main modules provide comprehensive SEO functionality across the entire content lifecycle.

  • Planner: Keyword research, clustering, and content planning
  • Writer: AI-powered content generation and task management
  • Analytics: Performance tracking and SEO analytics
  • Schedules: Automated task scheduling and CRON management

Technical Stack

Built on WordPress with advanced AI integration and modern web technologies.

  • Backend: PHP 7.4+, WordPress 5.0+, MySQL 5.7+
  • AI Integration: OpenAI GPT-4, GPT-3.5-turbo
  • Frontend: Vanilla JavaScript, CSS3, HTML5
  • Database: 15 custom tables, WordPress integration

Complete File Structure

Organized file tree with detailed descriptions

igny8-ai-seo/
├── igny8.php                          # Main plugin bootstrap and initialization
├── install.php                        # Database setup and plugin activation
├── uninstall.php                      # Plugin cleanup and data removal
├── igny8-wp-load-handler.php          # CRON endpoint handler
├── CHANGELOG.md                       # Version history and changes
│
├── ai/                                # AI Integration System (5 files)
│   ├── integration.php                # API key setup and connection management
│   ├── modules-ai.php                 # Common AI interface for modules
│   ├── model-rates-config.php         # AI model pricing and rate limits
│   ├── openai-api.php                 # OpenAI API integration and AI functions
│   └── prompts-library.php            # AI prompts library and templates
│
├── assets/                            # Frontend Assets
│   ├── css/
│   │   └── core.css                   # Main stylesheet (2000+ lines)
│   ├── js/
│   │   └── core.js                    # Main JavaScript (1000+ lines)
│   ├── templates/                     # CSV templates for import/export
│   │   ├── igny8_clusters_template.csv
│   │   ├── igny8_ideas_template.csv
│   │   └── igny8_keywords_template.csv
│   └── ai-images/                     # AI-generated images
│
├── core/                              # Core System Files
│   ├── admin/                         # Admin Interface System (7 files)
│   │   ├── ajax.php                   # Centralized AJAX endpoint management
│   │   ├── global-helpers.php         # Global utility functions (50+ helpers)
│   │   ├── init.php                   # Admin initialization and settings registration
│   │   ├── menu.php                   # WordPress admin menu registration
│   │   ├── meta-boxes.php             # WordPress meta boxes integration
│   │   ├── module-manager-class.php   # Module management system
│   │   └── routing.php                # Admin page routing and content rendering
│   ├── cron/                          # CRON System (2 files)
│   │   ├── igny8-cron-handlers.php    # CRON task handlers
│   │   └── igny8-cron-master-dispatcher.php # CRON master dispatcher
│   ├── db/                            # Database System (2 files)
│   │   ├── db.php                     # Database operations, schema, and utilities
│   │   └── db-migration.php           # Version-based migration system
│   ├── pages/                        # Admin Page Templates (organized by module)
│   │   ├── analytics/                 # Analytics module pages (2 files)
│   │   │   ├── analytics.php          # Analytics and reporting interface
│   │   │   └── status.php             # System status and health monitoring
│   │   ├── cron/                      # CRON management pages
│   │   ├── help/                      # Help and documentation pages (2 files)
│   │   │   ├── docs.php               # Technical documentation page
│   │   │   └── help.php               # User guide and support page
│   │   ├── settings/                  # Settings module pages (4 files)
│   │   │   ├── general-settings.php   # General plugin settings interface
│   │   │   ├── import-export.php      # Data import/export interface
│   │   │   ├── integration.php        # API integration settings interface
│   │   │   └── schedules.php          # Scheduling and automation interface
│   │   └── thinker/                   # Thinker module pages (5 files)
│   │       ├── image-testing.php      # Image testing interface
│   │       ├── main.php               # Thinker main interface
│   │       ├── profile.php            # Thinker profile interface
│   │       ├── prompts.php            # Prompts management interface
│   │       └── strategies.php         # Strategies interface
│   └── global-layout.php              # Master UI layout template
│
├── debug/                             # Debug & Monitoring System (5 files)
│   ├── debug.php                      # Debug functionality (redirected to status)
│   ├── module-debug.php               # Module-specific debugging utilities
│   ├── monitor-helpers.php            # Monitoring helper functions
│   ├── system-testing.php             # System testing utilities
│   └── temp-function-testing.php      # Function testing utilities
│
├── docs/                              # Documentation System (8 files)
│   ├── HOW_TO_ADD_COLUMN.md           # Database column addition guide
│   ├── IGNY8_SNAPSHOT_V0.1.md       # Complete plugin snapshot
│   ├── MASTER_ARCHITECTURE.md         # Master architecture documentation
│   ├── how-tos/                       # How-to guides (5 files)
│   │   ├── 01-adding-new-pages-and-modules.md
│   │   ├── 02-adding-new-modules-to-module-manager.md
│   │   ├── 03-auto-clustering-system.md
│   │   ├── cron-management.md
│   │   └── HOW_TO_ADD_COLUMN.md
│   └── parts/                         # Architecture parts (2 files)
│       ├── AI_INTEGRATION_ARCHITECTURE.md
│       └── AUTOMATION_FLOWS.md
│
├── flows/                             # Automation & Workflow System (3 files)
│   ├── sync-ajax.php                  # Automation-specific AJAX handlers
│   ├── sync-functions.php             # Core automation logic and workflow functions
│   └── sync-hooks.php                 # Workflow hook definitions and registration
│
└── modules/                           # Module System
    ├── components/                    # Reusable UI Components (8 files)
    │   ├── actions-tpl.php            # Action buttons template
    │   ├── export-modal-tpl.php       # Export modal template
    │   ├── filters-tpl.php           # Filter controls template
    │   ├── forms-tpl.php              # Form rendering template
    │   ├── import-modal-tpl.php       # Import modal template
    │   ├── kpi-tpl.php                # KPI display template
    │   ├── pagination-tpl.php         # Pagination controls template
    │   └── table-tpl.php              # Data table template
    ├── config/                        # Configuration Files (5 files)
    │   ├── filters-config.php         # Filter configuration definitions
    │   ├── forms-config.php           # Form configuration definitions
    │   ├── import-export-config.php    # Import/export configuration
    │   ├── kpi-config.php             # KPI configuration definitions
    │   └── tables-config.php          # Table configuration definitions
    └── modules-pages/                 # Module Page Interfaces
        ├── linker.php                 # Linker module interface
        ├── optimizer.php              # Optimizer module interface
        ├── planner.php                # Planner module interface
        ├── writer.php                 # Writer module interface
        └── personalize/               # Personalization Module (7 files)
            ├── content-generation.php # Content generation interface
            ├── front-end.php          # Frontend personalization
            ├── personalize.ajax       # Personalization AJAX handlers
            ├── personalize.js         # Personalization JavaScript
            ├── personalize.php        # Personalize module main interface
            ├── rewrites.php           # Content rewriting interface
            └── Settings.php           # Personalization settings

Database Architecture

15 custom tables with comprehensive relationships

Core Data Tables

  • igny8_keywords - Keyword research data with metrics
  • igny8_clusters - Content topic groupings with stored metrics
  • igny8_content_ideas - AI-generated content concepts
  • igny8_tasks - Writer workflow management
  • igny8_variations - Personalization content cache

Analytics & Tracking

  • igny8_logs - System audit trail and AI event logging
  • igny8_ai_queue - AI processing queue with retry logic
  • igny8_campaigns - Link building campaign management
  • igny8_backlinks - Backlink monitoring and tracking

WordPress Integration

  • wp_options - Plugin settings (38+ options)
  • wp_posts - Generated WordPress content
  • wp_postmeta - Custom post meta fields (6 fields)
  • wp_terms - Custom taxonomies (sectors, clusters)

Data Flow Architecture

Keywords → Clusters → Ideas → Tasks → WordPress Posts
    ↓         ↓        ↓       ↓
  Mapping → Posts ← Variations (Personalization)
    ↓
Campaigns → Sites → Backlinks

AI Integration System

OpenAI integration with cost tracking and automation

AI Functions

  • Content Generation: Blog posts, landing pages, product descriptions
  • Keyword Analysis: Intent detection, difficulty scoring, clustering
  • SEO Optimization: Meta descriptions, title optimization
  • Personalization: Audience-specific content variations

Model Configuration

  • GPT-4: Primary model for complex tasks
  • GPT-3.5-turbo: Fallback for cost optimization
  • Rate Limiting: Automatic retry with exponential backoff
  • Cost Tracking: Daily budget limits and usage monitoring

AI Queue System

  • Queue Processing: Background AI task processing
  • Retry Logic: Automatic retry for failed requests
  • Priority System: Task prioritization for efficient processing
  • Error Handling: Comprehensive error logging and recovery

Automation Workflows

Event-driven automation with CRON scheduling

Keyword Processing Workflow

// When keywords are imported/updated
igny8_handle_keyword_cluster_update($keyword_id) {
    // Update cluster metrics
    igny8_update_cluster_metrics($cluster_id);
    
    // Trigger AI clustering if enabled
    if (ai_enabled) {
        igny8_ajax_ai_cluster_keywords($keyword_ids);
    }
}

Content Generation Workflow

// When content ideas are created
igny8_create_task_from_idea($idea_id) {
    // Create writer task
    $task_id = create_task($idea_data);
    
    // Generate content if AI enabled
    if (ai_enabled) {
        igny8_ajax_ai_generate_content($task_id);
    }
    
    // Update metrics
    igny8_update_idea_metrics($idea_id);
}

Cluster Management Workflow

// When clusters are created/updated
igny8_auto_create_cluster_term($cluster_id) {
    // Create WordPress taxonomy term
    $term_id = wp_insert_term($cluster_name, 'clusters');
    
    // Link cluster to term
    update_cluster_term_id($cluster_id, $term_id);
    
    // Update metrics
    igny8_update_cluster_metrics($cluster_id);
}

Configuration System

Configuration-driven UI with reusable components

Table Configuration

Dynamic table rendering with sorting, filtering, and pagination based on configuration files.

  • Column Definitions: Field types, labels, and display options
  • Sorting & Filtering: Configurable sort and filter options
  • Actions: Bulk operations and individual record actions
  • Pagination: Configurable page sizes and navigation

Form Configuration

Dynamic form generation with validation and field types based on configuration.

  • Field Types: Text, number, select, textarea, date, etc.
  • Validation: Required fields, data types, and custom validation
  • Lookup Fields: Foreign key relationships and dropdown options
  • Conditional Logic: Show/hide fields based on other field values

KPI Configuration

Dynamic metrics display with charts and trend indicators based on configuration.

  • Metric Types: Count, sum, average, percentage calculations
  • Visualization: Charts, graphs, and trend indicators
  • Filtering: Date ranges and conditional filtering
  • Real-time Updates: Live data updates and caching

Security & Performance

Enterprise-level security and optimization

Security Measures

  • Nonce Verification: All AJAX requests protected with WordPress nonces
  • Capability Checks: User permission validation for all operations
  • Data Sanitization: All input data sanitized and validated
  • SQL Injection Protection: Prepared statements for all database queries

Performance Optimizations

  • Conditional Loading: Admin assets only loaded when needed
  • Database Indexing: Optimized indexes on frequently queried fields
  • Caching: WordPress transients for expensive operations
  • Lazy Loading: AJAX-based data loading for large datasets

Monitoring & Debugging

  • Real-time Monitoring: Live system health monitoring
  • Module Debug: Individual module performance tracking
  • Error Logging: Comprehensive error tracking and reporting
  • Performance Metrics: Response times and resource usage

API Reference

Complete function and endpoint documentation

Core Functions

Database Functions
  • igny8_create_all_tables() - Create all database tables
  • igny8_register_taxonomies() - Register custom taxonomies
  • igny8_register_post_meta() - Register custom post meta
  • igny8_install_database() - Complete plugin installation
Admin Functions
  • igny8_get_cluster_options() - Get cluster dropdown options
  • igny8_get_sector_options() - Get sector dropdown options
  • igny8_render_table() - Render dynamic tables
  • igny8_render_filters() - Render filter controls

AI Functions

Content Generation
  • igny8_generate_blog_post() - Generate blog post content
  • igny8_generate_landing_page() - Generate landing page content
  • igny8_generate_product_description() - Generate product content
  • igny8_generate_seo_meta() - Generate SEO meta data
AI Analysis
  • igny8_ai_analyze_keywords() - Analyze keywords using AI
  • igny8_ai_cluster_keywords() - Cluster keywords using AI
  • igny8_ai_generate_ideas() - Generate content ideas
  • igny8_ai_optimize_content() - Optimize existing content

Automation Functions

Workflow Functions
  • igny8_update_cluster_metrics() - Update cluster metrics
  • igny8_update_idea_metrics() - Update idea metrics
  • igny8_workflow_triggers() - Trigger workflow automation
  • igny8_bulk_delete_keywords() - Bulk delete keywords
AJAX Endpoints
  • wp_ajax_igny8_get_table_data - Get table data
  • wp_ajax_igny8_save_record - Save/update record
  • wp_ajax_igny8_ai_generate_content - AI content generation
  • wp_ajax_igny8_bulk_action - Perform bulk actions

Development Workflow

Guidelines for extending and maintaining the plugin

Adding New Modules

  1. Create module page in modules/modules-pages/
  2. Update module manager in core/admin/module-manager-class.php
  3. Add table, form, and filter configurations
  4. Register routes in core/admin/routing.php
  5. Add menu items in core/admin/menu.php

Adding New Tables

  1. Add database schema to core/db/db.php
  2. Create migration in core/db/db-migration.php
  3. Add table configuration to modules/config/tables-config.php
  4. Add form configuration to modules/config/forms-config.php
  5. Add filter configuration to modules/config/filters-config.php

Adding AI Features

  1. Add prompt template to ai/prompts-library.php
  2. Add AI handler to ai/modules-ai.php
  3. Add queue processing to flows/sync-functions.php
  4. Add AJAX endpoint to flows/sync-ajax.php