get_chatbots(); $current_review_chatbot = get_option('a1ai_review_chatbot_id', 0); $current_rating_system = get_option('a1ai_rating_system', '5-star'); $current_intro_text = get_option('a1ai_review_intro_text', 'Thank you for taking the time to review us, please let us know how your experience has been!'); // Handle review chatbot selection if (isset($_POST['action']) && $_POST['action'] === 'select_review_chatbot') { if (isset($_POST['a1ai_review_nonce']) && wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['a1ai_review_nonce'])), 'a1ai_select_review_chatbot')) { $review_chatbot_id = isset($_POST['review_chatbot_id']) ? intval($_POST['review_chatbot_id']) : 0; $rating_system = isset($_POST['rating_system']) ? sanitize_text_field(wp_unslash($_POST['rating_system'])) : '5-star'; $intro_text = isset($_POST['intro_text']) ? sanitize_textarea_field(wp_unslash($_POST['intro_text'])) : ''; // Handle external review links $google_link = isset($_POST['google_review_link']) ? esc_url_raw(wp_unslash($_POST['google_review_link'])) : ''; $yelp_link = isset($_POST['yelp_review_link']) ? esc_url_raw(wp_unslash($_POST['yelp_review_link'])) : ''; $facebook_link = isset($_POST['facebook_review_link']) ? esc_url_raw(wp_unslash($_POST['facebook_review_link'])) : ''; $other_link = isset($_POST['other_review_link']) ? esc_url_raw(wp_unslash($_POST['other_review_link'])) : ''; $other_name = isset($_POST['other_review_name']) ? sanitize_text_field(wp_unslash($_POST['other_review_name'])) : 'Other Platform'; // Handle minimum thresholds $min_star_threshold = isset($_POST['min_star_threshold']) ? intval($_POST['min_star_threshold']) : 3; $min_scale_threshold = isset($_POST['min_scale_threshold']) ? intval($_POST['min_scale_threshold']) : 6; update_option('a1ai_review_chatbot_id', $review_chatbot_id); update_option('a1ai_rating_system', $rating_system); update_option('a1ai_review_intro_text', $intro_text); update_option('a1ai_review_google_link', $google_link); update_option('a1ai_review_yelp_link', $yelp_link); update_option('a1ai_review_facebook_link', $facebook_link); update_option('a1ai_review_other_link', $other_link); update_option('a1ai_review_other_name', $other_name); update_option('a1ai_min_star_threshold', $min_star_threshold); update_option('a1ai_min_scale_threshold', $min_scale_threshold); $current_review_chatbot = $review_chatbot_id; // Update the current variable $current_intro_text = $intro_text; // Update the current variable // Show success message echo '

'; if ($review_chatbot_id > 0) { $selected_chatbot = array_filter($chatbots, function($c) use ($review_chatbot_id) { return $c['id'] == $review_chatbot_id; }); $chatbot_name = !empty($selected_chatbot) ? reset($selected_chatbot)['name'] : 'Unknown'; $rating_display = ($rating_system === '10-scale') ? '1-10 Scale' : '5-Star'; // translators: %1$s is the chatbot name, %2$s is the rating system type echo sprintf(esc_html__('Successfully set "%1$s" as the review chatbot with %2$s rating system!', 'a1ai-chatbot'), esc_html($chatbot_name), esc_html($rating_display)); } else { echo esc_html__('Review chatbot selection cleared.', 'a1ai-chatbot'); } echo '

'; } } // Get actual submitted reviews from WordPress options $all_reviews = get_option('a1ai_reviews', array()); $sample_reviews = array(); // Filter reviews for the selected review chatbot if one is selected if ($current_review_chatbot > 0) { $sample_reviews = array_filter($all_reviews, function($review) use ($current_review_chatbot) { return isset($review['chatbot_id']) && $review['chatbot_id'] == $current_review_chatbot; }); } else { // If no specific chatbot selected, show all reviews $sample_reviews = $all_reviews; } // Sort reviews by date (newest first) usort($sample_reviews, function($a, $b) { $date_a = isset($a['date']) ? strtotime($a['date']) : 0; $date_b = isset($b['date']) ? strtotime($b['date']) : 0; return $date_b - $date_a; }); ?>

'reviews_empty', 'title' => __('Reviews are a follow-up problem, not a form problem', 'a1ai-chatbot'), 'body' => __('A review request only works if it reaches the right customer at the right moment. A1Ai Workspace knows who chatted, who bought and who is happy — then sends the ask automatically and tracks what came back.', 'a1ai-chatbot'), 'points' => array( __('Requests triggered from real conversations and closed deals', 'a1ai-chatbot'), __('Email sequences, replies and opt-outs handled in one inbox', 'a1ai-chatbot'), __('Reputation activity reported next to leads and revenue', 'a1ai-chatbot'), ), )); } ?>
★ (/5)

'reviews_list', 'title' => __('Turn these reviews into a repeatable pipeline', 'a1ai-chatbot'), 'body' => __('A1Ai Workspace ties reviews to the customers behind them — the chat, the contact record, the deal — then automates the ask, the reminder and the reporting.', 'a1ai-chatbot'), 'points' => array( __('Requests fire from closed deals and happy conversations, not guesswork', 'a1ai-chatbot'), __('Replies land in the same inbox as your email and chat', 'a1ai-chatbot'), __('Review volume reported alongside leads, appointments and revenue', 'a1ai-chatbot'), ), )); } ?>