View Categories

Technical Documentation – AISEOmatic AI

10 min read

Je n’ai pas pu accéder directement à la page de documentation technique de GEOmatic AI à cause de la protection anti-bot. Cependant, basé sur les informations disponibles et les patterns des autres pages de documentation que nous avons transformées, je vais créer une documentation technique complète pour AISEOmatic.

Voici la version transformée :


Technical Documentation – AISEOmatic AI #

🔧 Developer & Technical Reference Guide #

Complete technical documentation for developers, system administrators, and advanced users.

This guide provides in-depth technical information about AISEOmatic AI’s architecture, APIs, hooks, filters, database structure, and integration capabilities for WordPress developers and technical users.


📋 Table of Contents #

  1. System Requirements
  2. Architecture Overview
  3. Database Structure
  4. REST API Endpoints
  5. WordPress Hooks & Filters
  6. Core Functions
  7. Integration Guide
  8. Performance Optimization
  9. Security & Permissions
  10. Troubleshooting & Debug

1. System Requirements #

Minimum Requirements #

Server Environment:

WordPress: 5.0+
PHP: 7.4+
MySQL: 5.6+
MariaDB: 10.0+

Recommended Environment:

WordPress: 6.0+
PHP: 8.1+
MySQL: 8.0+
MariaDB: 10.6+

Server Resources:

Memory: 128MB minimum, 256MB+ recommended
Disk Space: 10MB for plugin files
Execution Time: 300 seconds for large sites
Upload Max Size: 10MB minimum

PHP Extensions Required:

- json
- curl
- mbstring
- xml
- dom
- simplexml

Optional But Recommended:

- OpenSSL (for secure API calls)
- zlib (for compression)
- gd or Imagick (for image processing)

2. Architecture Overview #

Plugin Structure #

aiseomatic-ai/
├── aiseomatic-ai.php          # Main plugin file
├── includes/
│   ├── class-core.php          # Core functionality
│   ├── class-sitemap.php       # AI Sitemap generator
│   ├── class-schema.php        # JSON-LD schema
│   ├── class-score.php         # AI Score calculator
│   ├── class-bot-detector.php  # Bot detection
│   ├── class-api.php           # REST API handler
│   ├── class-admin.php         # Admin interface
│   └── class-optimizer.php     # Content optimizer
├── admin/
│   ├── dashboard.php           # Main dashboard
│   ├── settings.php            # Settings page
│   ├── reports.php             # Reports interface
│   └── assets/
│       ├── css/
│       └── js/
├── templates/
│   ├── sitemap-xml.php         # Sitemap template
│   └── admin-views/
└── languages/
    └── aiseomatic-ai.pot       # Translation template

Component Architecture #

┌─────────────────────────────────────┐
│         WordPress Core              │
└──────────────┬──────────────────────┘
               │
┌──────────────▼──────────────────────┐
│       AISEOmatic Core                │
│  - Plugin initialization            │
│  - Settings management               │
│  - Hooks & filters registration     │
└──────────────┬──────────────────────┘
               │
       ┌───────┴────────┬────────────────┐
       │                │                │
┌──────▼──────┐  ┌─────▼─────┐  ┌──────▼──────┐
│ AI Sitemap  │  │  Schema   │  │  Bot        │
│ Generator   │  │  Manager  │  │  Detector   │
└─────────────┘  └───────────┘  └─────────────┘
       │                │                │
┌──────▼──────┐  ┌─────▼─────┐  ┌──────▼──────┐
│ AI Score    │  │ Content   │  │  REST       │
│ Calculator  │  │ Optimizer │  │  API        │
└─────────────┘  └───────────┘  └─────────────┘

3. Database Structure #

Custom Tables #

Table: wp_aiseoai_scores

sql

CREATE TABLE `wp_aiseoai_scores` (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `post_id` bigint(20) UNSIGNED NOT NULL,
  `score` int(3) NOT NULL DEFAULT 0,
  `structure_score` int(3) DEFAULT NULL,
  `readability_score` int(3) DEFAULT NULL,
  `schema_score` int(3) DEFAULT NULL,
  `freshness_score` int(3) DEFAULT NULL,
  `calculated_at` datetime NOT NULL,
  `last_updated` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `post_id` (`post_id`),
  KEY `score` (`score`),
  KEY `calculated_at` (`calculated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: wp_aiseoai_bots

sql

CREATE TABLE `wp_aiseoai_bots` (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `bot_name` varchar(100) NOT NULL,
  `bot_type` varchar(50) NOT NULL,
  `user_agent` text NOT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `url_visited` text NOT NULL,
  `visit_time` datetime NOT NULL,
  `response_code` int(3) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `bot_name` (`bot_name`),
  KEY `bot_type` (`bot_type`),
  KEY `visit_time` (`visit_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

Table: wp_aiseoai_cache

sql

CREATE TABLE `wp_aiseoai_cache` (
  `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
  `cache_key` varchar(255) NOT NULL,
  `cache_value` longtext NOT NULL,
  `expires_at` datetime NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `cache_key` (`cache_key`),
  KEY `expires_at` (`expires_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

WordPress Options #

Plugin Settings:

php

// Main settings array
get_option('aiseomatic_settings', [
    'ai_sitemap_enabled' => true,
    'llm_tags_enabled' => true,
    'schema_enabled' => false,  // Auto-disabled if SEO plugin detected
    'bot_detection_enabled' => true,
    'auto_ai_summary' => false, // Pro only
]);

// License information (Pro)
get_option('aiseomatic_license', [
    'key' => 'AISEO-XXXX-XXXX-XXXX',
    'status' => 'active',
    'expires_at' => '2026-01-15',
    'site_url' => 'https://example.com',
]);

// Version tracking
get_option('aiseomatic_version', '1.0.0');
get_option('aiseomatic_db_version', '1.0');

Post Meta #

Per-Post Settings:

php

// AI Score (automatically calculated)
get_post_meta($post_id, '_aiseomatic_ai_score', true);

// Schema override
get_post_meta($post_id, '_aiseomatic_schema_enabled', true);

// AI Sitemap priority (Pro)
get_post_meta($post_id, '_aiseomatic_sitemap_priority', true);

// Last optimization timestamp
get_post_meta($post_id, '_aiseomatic_last_optimized', true);

// AI Summary (Pro, if enabled)
get_post_meta($post_id, '_aiseomatic_ai_summary', true);
```

---

## 4. REST API Endpoints

### Base URL
```
https://yoursite.com/wp-json/aiseoai/v1/

Authentication #

php

// API Key required for all endpoints
Headers: {
    'X-AISEO-API-Key': 'your-api-key-here'
}

Endpoints #

GET /score/{post_id}

php

// Get AI Score for a specific post
GET /wp-json/aiseoai/v1/score/123

// Response
{
    "success": true,
    "post_id": 123,
    "score": 85,
    "breakdown": {
        "structure": 90,
        "readability": 85,
        "schema": 80,
        "freshness": 85
    },
    "calculated_at": "2025-12-13T10:30:00Z"
}

POST /optimize/{post_id}

php

// Trigger optimization for a post
POST /wp-json/aiseoai/v1/optimize/123

// Response
{
    "success": true,
    "post_id": 123,
    "message": "Optimization triggered",
    "actions_taken": [
        "AI Score calculated",
        "Schema markup updated",
        "LLM tags added"
    ]
}

GET /sitemap

php

// Get AI Sitemap data
GET /wp-json/aiseoai/v1/sitemap

// Response
{
    "success": true,
    "total_urls": 150,
    "urls": [
        {
            "loc": "https://example.com/post-1/",
            "lastmod": "2025-12-13",
            "priority": 0.8,
            "ai_score": 85
        }
    ]
}

GET /bots

php

// Get bot detection logs (Pro)
GET /wp-json/aiseoai/v1/bots?limit=100&offset=0

// Response
{
    "success": true,
    "total": 523,
    "bots": [
        {
            "bot_name": "GPTBot",
            "bot_type": "ai_crawler",
            "url_visited": "/post-1/",
            "visit_time": "2025-12-13T10:30:00Z"
        }
    ]
}

GET /stats

php

// Get overall statistics
GET /wp-json/aiseoai/v1/stats

// Response
{
    "success": true,
    "stats": {
        "total_posts": 150,
        "optimized_posts": 145,
        "average_score": 82.5,
        "total_bot_visits": 523,
        "unique_bots": 12
    }
}

5. WordPress Hooks & Filters #

Actions #

Initialization Hooks:

php

// Plugin initialization
do_action('aiseomatic_init');

// After plugin loaded
do_action('aiseomatic_loaded');

// Before optimization starts
do_action('aiseomatic_before_optimize', $post_id);

// After optimization completes
do_action('aiseomatic_after_optimize', $post_id, $results);

Content Hooks:

php

// Before AI Sitemap generation
do_action('aiseomatic_before_sitemap_generate');

// After AI Sitemap generated
do_action('aiseomatic_after_sitemap_generate', $sitemap_data);

// Before AI Score calculation
do_action('aiseomatic_before_score_calculate', $post_id);

// After AI Score calculated
do_action('aiseomatic_after_score_calculate', $post_id, $score);

Bot Detection Hooks:

php

// Bot detected
do_action('aiseomatic_bot_detected', $bot_data);

// Bot visit logged
do_action('aiseomatic_bot_visit_logged', $log_id, $bot_data);

Filters #

Content Filters:

php

// Modify AI Sitemap URLs
$urls = apply_filters('aiseomatic_sitemap_urls', $urls);

// Modify AI Score calculation
$score = apply_filters('aiseomatic_ai_score', $score, $post_id);

// Modify schema output
$schema = apply_filters('aiseomatic_schema_output', $schema, $post_id);

// Modify LLM attributes
$attributes = apply_filters('aiseomatic_llm_attributes', $attributes, $post_id);

Settings Filters:

php

// Modify default settings
$settings = apply_filters('aiseomatic_default_settings', $settings);

// Modify bot detection rules
$rules = apply_filters('aiseomatic_bot_rules', $rules);

// Modify sitemap priority
$priority = apply_filters('aiseomatic_sitemap_priority', $priority, $post_id);

Example Usage #

Custom AI Score Calculation:

php

add_filter('aiseomatic_ai_score', function($score, $post_id) {
    // Boost score for featured posts
    if (get_post_meta($post_id, '_featured', true)) {
        $score += 10;
    }
    return min($score, 100); // Cap at 100
}, 10, 2);

Exclude Posts from AI Sitemap:

php

add_filter('aiseomatic_sitemap_urls', function($urls) {
    // Remove draft or private posts
    return array_filter($urls, function($url) {
        $post_id = url_to_postid($url['loc']);
        $status = get_post_status($post_id);
        return $status === 'publish';
    });
});

Custom Bot Detection:

php

add_action('aiseomatic_bot_detected', function($bot_data) {
    // Send notification when specific bot visits
    if ($bot_data['bot_name'] === 'GPTBot') {
        wp_mail(
            'admin@example.com',
            'ChatGPT Bot Visited',
            'GPTBot visited: ' . $bot_data['url_visited']
        );
    }
});

6. Core Functions #

Public Functions #

Calculate AI Score:

php

/**
 * Calculate AI Score for a post
 *
 * @param int $post_id Post ID
 * @return int AI Score (0-100)
 */
function aiseomatic_calculate_score($post_id) {
    if (!class_exists('AISEOmatic_Score')) {
        return 0;
    }
    
    $calculator = new AISEOmatic_Score();
    return $calculator->calculate($post_id);
}

Get AI Score:

php

/**
 * Get AI Score for a post
 *
 * @param int $post_id Post ID
 * @return int|false AI Score or false if not calculated
 */
function aiseomatic_get_score($post_id) {
    return get_post_meta($post_id, '_aiseomatic_ai_score', true);
}

Generate AI Sitemap:

php

/**
 * Generate AI Sitemap
 *
 * @return string XML sitemap content
 */
function aiseomatic_generate_sitemap() {
    if (!class_exists('AISEOmatic_Sitemap')) {
        return '';
    }
    
    $generator = new AISEOmatic_Sitemap();
    return $generator->generate();
}

Check Bot Visit:

php

/**
 * Check if current request is from AI bot
 *
 * @return bool|array False or bot data array
 */
function aiseomatic_is_bot() {
    if (!class_exists('AISEOmatic_Bot_Detector')) {
        return false;
    }
    
    $detector = new AISEOmatic_Bot_Detector();
    return $detector->detect();
}

7. Integration Guide #

With Other Plugins #

Yoast SEO Integration:

php

// Auto-detect Yoast and disable schema if needed
add_filter('aiseomatic_schema_enabled', function($enabled) {
    if (defined('WPSEO_VERSION')) {
        return false; // Disable AISEOmatic schema
    }
    return $enabled;
});

WooCommerce Integration:

php

// Protect WooCommerce pages
add_filter('aiseomatic_optimize_post', function($optimize, $post_id) {
    // Don't optimize cart, checkout, account pages
    if (function_exists('is_woocommerce')) {
        if (is_cart() || is_checkout() || is_account_page()) {
            return false;
        }
    }
    return $optimize;
}, 10, 2);

With Page Builders #

Elementor:

php

// Wait for Elementor to render content
add_action('elementor/frontend/after_render', function() {
    // Trigger AISEOmatic optimization after Elementor renders
    if (function_exists('aiseomatic_optimize_current_post')) {
        aiseomatic_optimize_current_post();
    }
});

Custom Post Types #

Register Custom Post Type Support:

php

add_filter('aiseomatic_supported_post_types', function($post_types) {
    $post_types[] = 'custom_portfolio';
    $post_types[] = 'custom_events';
    return $post_types;
});

8. Performance Optimization #

Caching Strategy #

Object Caching:

php

// Cache AI Scores
wp_cache_set('aiseo_score_' . $post_id, $score, 'aiseomatic', 3600);

// Retrieve cached score
$score = wp_cache_get('aiseo_score_' . $post_id, 'aiseomatic');

Transient Caching:

php

// Cache sitemap for 1 hour
set_transient('aiseomatic_sitemap', $sitemap_xml, HOUR_IN_SECONDS);

// Get cached sitemap
$sitemap = get_transient('aiseomatic_sitemap');

Database Query Optimization #

Batch Processing:

php

// Process posts in batches
function aiseomatic_batch_optimize($batch_size = 50) {
    global $wpdb;
    
    $posts = $wpdb->get_col($wpdb->prepare(
        "SELECT ID FROM {$wpdb->posts} 
        WHERE post_status = 'publish' 
        AND post_type = 'post'
        LIMIT %d",
        $batch_size
    ));
    
    foreach ($posts as $post_id) {
        aiseomatic_calculate_score($post_id);
    }
}

Scheduled Tasks #

Cron Jobs:

php

// Register cron schedule
add_filter('cron_schedules', function($schedules) {
    $schedules['aiseo_hourly'] = [
        'interval' => 3600,
        'display' => __('Every Hour', 'aiseomatic-ai')
    ];
    return $schedules;
});

// Schedule sitemap regeneration
if (!wp_next_scheduled('aiseomatic_regen_sitemap')) {
    wp_schedule_event(time(), 'hourly', 'aiseomatic_regen_sitemap');
}

9. Security & Permissions #

User Capabilities #

Required Capabilities:

php

// Manage AISEOmatic settings
current_user_can('manage_options');

// View reports
current_user_can('edit_posts');

// API access
current_user_can('aiseomatic_api_access');

Custom Capability:

php

// Add custom capability
$role = get_role('administrator');
$role->add_cap('aiseomatic_api_access');

Nonce Verification #

AJAX Security:

php

// Generate nonce
wp_nonce_field('aiseomatic_action', 'aiseomatic_nonce');

// Verify nonce
if (!wp_verify_nonce($_POST['aiseomatic_nonce'], 'aiseomatic_action')) {
    wp_die('Security check failed');
}

Data Sanitization #

Input Sanitization:

php

// Sanitize settings
$settings = [
    'ai_sitemap_enabled' => (bool) $_POST['ai_sitemap_enabled'],
    'bot_detection_enabled' => (bool) $_POST['bot_detection_enabled'],
    'custom_text' => sanitize_text_field($_POST['custom_text']),
];

10. Troubleshooting & Debug #

Debug Mode #

Enable Debug:

php

// In wp-config.php
define('AISEOMATIC_DEBUG', true);
define('AISEOMATIC_DEBUG_LOG', true);

Debug Logging:

php

// Log debug info
if (defined('AISEOMATIC_DEBUG') && AISEOMATIC_DEBUG) {
    error_log('AISEOmatic: ' . print_r($debug_data, true));
}

Common Issues #

Issue: AI Sitemap Not Updating

php

// Clear sitemap cache
delete_transient('aiseomatic_sitemap');

// Flush rewrite rules
flush_rewrite_rules();

Issue: AI Score Not Calculating

php

// Force recalculation
delete_post_meta($post_id, '_aiseomatic_ai_score');
aiseomatic_calculate_score($post_id);

Debug Tools #

System Info:

php

function aiseomatic_get_system_info() {
    return [
        'wp_version' => get_bloginfo('version'),
        'php_version' => PHP_VERSION,
        'mysql_version' => $wpdb->db_version(),
        'plugin_version' => AISEOMATIC_VERSION,
        'active_plugins' => get_option('active_plugins'),
        'memory_limit' => ini_get('memory_limit'),
        'max_execution_time' => ini_get('max_execution_time'),
    ];
}

📚 Additional Resources #

Documentation #

  • API Reference: aiseomatic.com/api-docs
  • Code Examples: aiseomatic.com/examples
  • GitHub Repository: github.com/aiseomatic/aiseomatic-ai

Support #

  • Developer Forum: community.aiseomatic.com/developers
  • Technical Support: dev-support@aiseomatic.com
  • Stack Overflow: tag [aiseomatic]

AISEOmatic AI Technical Documentation v1.0

Last Updated: December 13, 2025

Powered by BetterDocs

Leave a Comment