/** * Internal Linking Suggester * * This module analyzes WordPress content to suggest relevant internal linking * opportunities based on semantic analysis, keyword matching, and content clustering. * It helps improve site architecture, user navigation, and SEO link equity distribution. * * Features: * - Semantic content analysis for relevance scoring * - Keyword-based link suggestions with confidence metrics * - Topic clustering for hub-and-spoke content architecture * - Anchor text optimization recommendations * - Link density and distribution analysis * - Context-aware link placement suggestions * * @since 2.7.0 */ import { WordPressClient } from "../../../client/api.js"; import type { InternalLinkSuggestion, SEOToolParams } from "../../../types/seo.js"; import type { WordPressPost } from "../../../types/wordpress.js"; /** * Configuration for internal linking suggestions */ interface LinkingSuggestionConfig { /** Maximum number of suggestions to return */ maxSuggestions: number; /** Minimum relevance score threshold (0-100) */ minRelevanceScore: number; /** Maximum links per post to suggest */ maxLinksPerPost: number; /** Enable semantic analysis */ useSemanticAnalysis: boolean; /** Include category-based suggestions */ includeCategoryMatches: boolean; /** Include tag-based suggestions */ includeTagMatches: boolean; /** Minimum word count for target posts */ minWordCount: number; /** Exclude posts older than X days */ maxPostAge: number; /** Enable contextual placement suggestions */ enableContextualPlacement: boolean; } /** * Topic cluster information */ interface TopicCluster { /** Cluster identifier */ clusterId: string; /** Main topic/theme */ topic: string; /** Posts in this cluster */ posts: Array<{ postId: number; title: string; url: string; relevanceScore: number; isHub: boolean; }>; /** Cluster coherence score */ coherenceScore: number; /** Suggested hub post (if any) */ hubPost?: number; } /** * Internal Linking Suggester Class */ export declare class InternalLinkingSuggester { private client; private logger; private config; constructor(client: WordPressClient, config?: Partial); /** * Generate internal linking suggestions for a specific post */ generateSuggestions(sourcePost: WordPressPost, params: SEOToolParams): Promise; /** * Analyze content clustering for site-wide link architecture */ analyzeContentClusters(params: SEOToolParams): Promise; /** * Get bulk linking suggestions for multiple posts */ generateBulkSuggestions(postIds: number[], params: SEOToolParams): Promise>; /** * Analyze post content for relevance scoring */ private analyzePostContent; /** * Get candidate posts for internal linking */ private getCandidatePosts; /** * Get all published posts */ getAllPosts(params: SEOToolParams): Promise; /** * Calculate relevance scores between source and candidate posts */ private calculateRelevanceScores; /** * Enhance suggestions with contextual placement information */ private enhanceWithContextualPlacement; /** * Create topic clusters from analyzed posts */ private createTopicClusters; /** * Identify hub post for a cluster */ private identifyHubPost; /** * Extract plain text from HTML content */ private extractTextContent; /** * Count words in text */ private countWords; /** * Extract keywords with TF-IDF scoring */ private extractKeywords; /** * Check if word is a stop word */ private isStopWord; /** * Extract main topics from content */ private extractTopics; /** * Categorize content based on keywords and patterns */ private categorizeContent; /** * Generate semantic fingerprint for similarity comparison */ private generateSemanticFingerprint; /** * Calculate reading level (simplified Flesch-Kincaid) */ private calculateReadingLevel; /** * Count syllables in a word (simplified) */ private countSyllables; /** * Calculate keyword similarity between two posts */ private calculateKeywordSimilarity; /** * Calculate topic similarity between two posts */ private calculateTopicSimilarity; /** * Calculate semantic similarity using fingerprints */ private calculateSemanticSimilarity; /** * Generate suggested anchor text for a link */ private generateAnchorText; /** * Generate human-readable reason for suggestion */ private generateSuggestionReason; /** * Find optimal placements for internal links within content */ private findOptimalPlacements; /** * Get current configuration */ getConfig(): LinkingSuggestionConfig; /** * Update configuration */ updateConfig(config: Partial): void; } export {}; //# sourceMappingURL=InternalLinkingSuggester.d.ts.map