Overview of the Auto-Link System
Auto-Link is a system that automatically extracts keywords from posts and manga, then injects internal links directly into user comments. The entire process runs asynchronously via cron jobs, ensuring zero impact on real-time performance.
The processing pipeline includes tokenization, n-gram generation, prefix matching, and fallback matching to maximize keyword detection accuracy.
Keyword Extraction Mechanism
Keywords are extracted from post titles and manga alternative titles. The data is cleaned, normalized, and deduplicated before being stored in the database.
- Maximum of 20 keywords per post
- Ignore keywords that are too short
- Automatically deactivate removed keywords
All processing is handled in the background using cron scheduling to maintain optimal system performance.
Auto-Link Injection in Comments
When a user submits a comment, the system analyzes the content and applies relevant keyword linking:
- Tokenize content and generate n-grams
- Query keywords using prefix and contains matching
- Prioritize longer and more specific keywords
- Replace only the first occurrence to prevent spam
Multiple validation layers are applied, including exact match, sub-sequence match, phrase match, and word boundary detection to minimize false positives.
Shortcode-Based Rendering
The system uses the [init_manga_auto_link] shortcode to render links, allowing flexible output without modifying original content.
- Search mode: displays a search icon with trigger behavior
- Direct mode: links directly to internal URLs
- External links are blocked to prevent spam
Advanced Content and Unicode Handling
The module is optimized for multilingual environments and complex HTML structures:
- Full Unicode support, including Vietnamese characters
- Prevents replacement inside tags like a, code, and pre
- Handles flexible whitespace, including HTML entities
Bulk Comment Reprocessing
Init Manga v2.5.7 includes a reprocessing system to apply Auto-Link to existing comments:
- Processes comments in batches of 200
- Uses offset tracking to avoid duplication
- Runs entirely in the background via cron jobs
Performance Optimization
- Limits content length during processing
- Optimized database queries using keyword_lower indexing
- Minimizes unnecessary replacements
- Non-blocking architecture for high scalability
Conclusion
Init Manga v2.5.7 delivers a powerful Auto-Link system that automates internal linking, boosts SEO performance, and enhances user interaction. This update represents a significant architectural improvement for scalable manga platforms.
Comments