settings = AEO_Bob_Settings::get_instance(); } add_action('add_meta_boxes', array($this, 'add_meta_box')); add_action('wp_ajax_aeo_bob_analyze_content', array($this, 'ajax_analyze_content')); add_action('wp_ajax_aeo_bob_get_seo_suggestions', array($this, 'ajax_get_seo_suggestions')); } public function add_meta_box() { add_meta_box( 'aeo-bob-seo-analysis', '🚀 AEO BOB - SEO Analysis', array($this, 'render_meta_box'), array('post', 'page'), 'side', 'high' // Changed back to 'high' for top positioning ); } public function render_meta_box($post) { // Nonce verification happens via AJAX with check_ajax_referer() instead // Removed wp_nonce_field() to prevent duplicate #_ajax_nonce warnings $target_keyword = get_post_meta($post->ID, '_aeo_bob_target_keyword', true); $seo_score = get_post_meta($post->ID, '_aeo_bob_seo_score', true); $aeo_score = get_post_meta($post->ID, '_aeo_bob_aeo_score', true) ?: 0; $last_analysis = get_post_meta($post->ID, '_aeo_bob_last_analysis', true); // Always calculate fresh score for current post $current_content = get_post_field('post_content', $post->ID); $current_title = get_post_field('post_title', $post->ID); $seo_score = $this->calculate_initial_score($post); update_post_meta($post->ID, '_aeo_bob_seo_score', $seo_score); ?>