| @@ -99,15 +99,106 @@ | ||
| 99 | 99 | * @param string $target_keyword Target keyword |
| 100 | 100 | * @param string $content_type Type of content |
| 101 | 101 | * @param string $tone Desired tone |
| 102 | 102 | * @param string $provider AI provider |
| 103 | + * @param string $language Target output language (empty = infer from content) | |
| 103 | 104 | * @return string Formatted prompt |
| 104 | 105 | */ |
| 105 | - public function build_seo_prompt(string $content, string $target_keyword, string $content_type, string $tone, string $provider = 'openai'): string { | |
| 106 | - return $this->get_seo_prompts()->build_seo_prompt($content, $target_keyword, $content_type, $tone, $provider); | |
| 106 | + public function build_seo_prompt(string $content, string $target_keyword, string $content_type, string $tone, string $provider = 'openai', string $language = ''): string { | |
| 107 | + return $this->get_seo_prompts()->build_seo_prompt($content, $target_keyword, $content_type, $tone, $provider, $language); | |
| 107 | 108 | } |
| 108 | 109 | |
| 109 | 110 | /** |
| 111 | + * Build a focused SEO title improvement prompt. | |
| 112 | + * | |
| 113 | + * @since 1.14.0 | |
| 114 | + * | |
| 115 | + * @param string $content Post content for context. | |
| 116 | + * @param string $current_title The current SEO title. | |
| 117 | + * @param string $target_keyword Target/focus keyword. | |
| 118 | + * @param string $content_type Type of content. | |
| 119 | + * @param string $tone Desired tone. | |
| 120 | + * @param string $suggestion The suggestion the new title must address. | |
| 121 | + * @param string $provider AI provider. | |
| 122 | + * @param array $sentiment_words Emotion/sentiment words the title check rewards. | |
| 123 | + * @param array $power_words Power words the title check rewards. | |
| 124 | + * @param string $language Target output language (empty = infer from content) | |
| 125 | + * @return string Formatted prompt | |
| 126 | + */ | |
| 127 | + public function build_title_improvement_prompt(string $content, string $current_title, string $target_keyword, string $content_type, string $tone, string $suggestion, string $provider = 'openai', array $sentiment_words = [], array $power_words = [], string $language = ''): string { | |
| 128 | + return $this->get_seo_prompts()->build_title_improvement_prompt($content, $current_title, $target_keyword, $content_type, $tone, $suggestion, $provider, $sentiment_words, $power_words, $language); | |
| 129 | + } | |
| 130 | + | |
| 131 | + /** | |
| 132 | + * Build a focused meta-description improvement prompt. | |
| 133 | + * | |
| 134 | + * @since 1.14.0 | |
| 135 | + * | |
| 136 | + * @param string $content Post content for context. | |
| 137 | + * @param string $current_desc The current meta description. | |
| 138 | + * @param string $target_keyword Target/focus keyword. | |
| 139 | + * @param string $content_type Type of content. | |
| 140 | + * @param string $tone Desired tone. | |
| 141 | + * @param string $suggestion The suggestion the description must address. | |
| 142 | + * @param string $provider AI provider. | |
| 143 | + * @param string $language Target output language (empty = infer from content) | |
| 144 | + * @return string Formatted prompt | |
| 145 | + */ | |
| 146 | + public function build_meta_description_improvement_prompt(string $content, string $current_desc, string $target_keyword, string $content_type, string $tone, string $suggestion, string $provider = 'openai', string $language = ''): string { | |
| 147 | + return $this->get_seo_prompts()->build_meta_description_improvement_prompt($content, $current_desc, $target_keyword, $content_type, $tone, $suggestion, $provider, $language); | |
| 148 | + } | |
| 149 | + | |
| 150 | + /** | |
| 151 | + * Build a prompt that explains why a specific SEO suggestion matters for a | |
| 152 | + * given post and how to resolve it (the "Explain with AI" copilot action). | |
| 153 | + * | |
| 154 | + * @since 1.18.0 | |
| 155 | + * | |
| 156 | + * @param string $suggestion The SEO suggestion to explain. | |
| 157 | + * @param string $content Post content for context. | |
| 158 | + * @param string $title Post/SEO title for context. | |
| 159 | + * @param string $target_keyword Focus keyword (may be empty). | |
| 160 | + * @param string $content_type Type of content. | |
| 161 | + * @param string $provider AI provider. | |
| 162 | + * @return string Formatted prompt | |
| 163 | + */ | |
| 164 | + public function build_suggestion_explanation_prompt(string $suggestion, string $content, string $title, string $target_keyword, string $content_type, string $provider = 'openai'): string { | |
| 165 | + return $this->get_seo_prompts()->build_suggestion_explanation_prompt($suggestion, $content, $title, $target_keyword, $content_type, $provider); | |
| 166 | + } | |
| 167 | + | |
| 168 | + /** | |
| 169 | + * Build a prompt proposing one authoritative external source to cite. | |
| 170 | + * | |
| 171 | + * @since 1.14.0 | |
| 172 | + * | |
| 173 | + * @param string $content Post content for context. | |
| 174 | + * @param string $target_keyword Focus keyword. | |
| 175 | + * @param string $content_type Type of content. | |
| 176 | + * @param string $provider AI provider. | |
| 177 | + * @return string Formatted prompt | |
| 178 | + */ | |
| 179 | + public function build_dofollow_link_prompt(string $content, string $target_keyword, string $content_type, string $provider = 'openai'): string { | |
| 180 | + return $this->get_seo_prompts()->build_dofollow_link_prompt($content, $target_keyword, $content_type, $provider); | |
| 181 | + } | |
| 182 | + | |
| 183 | + /** | |
| 184 | + * Build a prompt for a short keyword-rich closing paragraph. | |
| 185 | + * | |
| 186 | + * @since 1.14.0 | |
| 187 | + * | |
| 188 | + * @param string $content Post content for context. | |
| 189 | + * @param string $target_keyword Focus keyword. | |
| 190 | + * @param string $content_type Type of content. | |
| 191 | + * @param string $tone Desired tone. | |
| 192 | + * @param int $keyword_mentions How many times to use the keyword. | |
| 193 | + * @param string $provider AI provider. | |
| 194 | + * @return string Formatted prompt | |
| 195 | + */ | |
| 196 | + public function build_keyword_paragraph_prompt(string $content, string $target_keyword, string $content_type, string $tone, int $keyword_mentions, string $provider = 'openai', int $word_target = 90): string { | |
| 197 | + return $this->get_seo_prompts()->build_keyword_paragraph_prompt($content, $target_keyword, $content_type, $tone, $keyword_mentions, $provider, $word_target); | |
| 198 | + } | |
| 199 | + | |
| 200 | + /** | |
| 110 | 201 | * Build content analysis prompt |
| 111 | 202 | * |
| 112 | 203 | * @since 1.0.0 |
| 113 | 204 | * |
| @@ -192,9 +283,10 @@ | ||
| 192 | 283 | string $content_length, |
| 193 | 284 | string $tone, |
| 194 | 285 | string $competitor_analysis, |
| 195 | 286 | string $additional_context, |
| 196 | - string $provider = 'openai' | |
| 287 | + string $provider = 'openai', | |
| 288 | + string $language = '' | |
| 197 | 289 | ): string { |
| 198 | 290 | return $this->get_content_brief_prompts()->build_content_brief_prompt( |
| 199 | 291 | $target_keywords, |
| 200 | 292 | $content_type, |
| @@ -202,9 +294,10 @@ | ||
| 202 | 294 | $content_length, |
| 203 | 295 | $tone, |
| 204 | 296 | $competitor_analysis, |
| 205 | 297 | $additional_context, |
| 206 | - $provider | |
| 298 | + $provider, | |
| 299 | + $language | |
| 207 | 300 | ); |
| 208 | 301 | } |
| 209 | 302 | |
| 210 | 303 | /** |