Add AI writing assistant plugin with local backend, brave search, and image generation support

- Implement local backend AI provider with Ollama integration
- Add Brave Search API integration for real-time search suggestions
- Add image generation manager with multiple AI providers
- Create hybrid provider system with local/cloud fallback
- Add comprehensive settings UI with provider management
- Implement Gutenberg sidebar with writing assistance controls
- Add SEO schema generation for AI-generated content
- Multiple provider support: OpenRouter, local backend, Codex
This commit is contained in:
Dwindi Ramadhana
2026-05-17 10:48:05 +07:00
parent 97426d5ab1
commit d2c10756ab
61 changed files with 18725 additions and 806 deletions

View File

@@ -30,13 +30,14 @@ class WP_Agentic_Writer_Keyword_Suggester {
* @return array|WP_Error Array with focus_keyword, secondary_keywords, reasoning, and cost.
*/
public static function suggest_keywords( $title, $sections, $language = 'english', $post_id = 0 ) {
$provider = WP_Agentic_Writer_OpenRouter_Provider::get_instance();
$provider = WP_Agentic_Writer_Provider_Manager::get_provider_for_task( 'clarity' );
// Build outline text from sections
$outline_text = '';
if ( is_array( $sections ) ) {
foreach ( $sections as $section ) {
$section_title = $section['title'] ?? '';
// Support both 'heading' (new format) and 'title' (legacy)
$section_title = $section['heading'] ?? $section['title'] ?? '';
if ( ! empty( $section_title ) ) {
$outline_text .= "- {$section_title}\n";
}