PluginProbe
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services / 8.8.1
WPBot – AI ChatBot for Live Support, Lead Generation, WordPress Automation, AI Services v8.8.1
8.8.2 8.8.1 8.8.0 8.7.9 8.7.8 8.7.7 8.7.6 8.7.5 8.7.4 8.7.3 8.7.2 8.7.1 8.7.0 8.6.9 8.6.8 8.6.7 8.6.6 8.6.5 8.6.4 8.6.2 8.6.1 8.6.0 8.5.9 8.5.8 8.5.7 All 538 releases
← All changes | includes/chat-sessions/reports/chatbot-history-reporting.php +71 -0 8.6.0 → 8.8.1 View file →
@@ -12,8 +12,79 @@
12 12 /******************************************
13 13 * Add Reporting Menu
14 14 */
15 15 add_action( 'admin_menu', 'qcld_history_reporting_menu_func' );
16 +add_action( 'admin_enqueue_scripts', 'qcld_wpbot_reporting_enqueue_assets' );
17 +
18 +function qcld_wpbot_reporting_enqueue_assets( $hook ) {
19 + if ( strpos( $hook, 'wbcs-botsessions-reports' ) === false ) {
20 + return;
21 + }
22 +
23 + wp_enqueue_script(
24 + 'qcld-wp-apexcharts',
25 + QCLD_wpCHATBOT_HISTORY_PLUGIN_URL . 'reports/view/assets/apexcharts.min.js',
26 + array( 'jquery' ),
27 + QCLD_wpCHATBOT_VERSION,
28 + true
29 + );
30 +
31 + $inline_script = <<<'JS'
32 +jQuery(document).ready(function($) {
33 + $(".feedback-card").on("click", function() {
34 + let type = $(this).data("type");
35 + $("#feedback-results").html("<p>Loading...</p>");
36 +
37 + $.post(ajaxurl, {
38 + action: "wpbot_get_feedback_ajax",
39 + feedback_type: type
40 + }, function(response) {
41 + if (response.success) {
42 + $("#feedback-results").html(response.data.html);
43 + } else {
44 + $("#feedback-results").html("<p>No results found.</p>");
45 + }
46 + });
47 + });
48 +});
49 +jQuery(document).on("click", ".wpbot-page-link", function(e) {
50 + e.preventDefault();
51 +
52 + let page = jQuery(this).data("page");
53 + let type = jQuery(this).data("type");
54 +
55 + jQuery.post(ajaxurl, {
56 + action: "wpbot_get_feedback_ajax",
57 + feedback_type: type,
58 + page: page
59 + }, function(response) {
60 + if (response.success) {
61 + jQuery("#feedback-results").html(response.data.html);
62 + }
63 + });
64 +});
65 +jQuery(document).on("click", "#wpbot-clear-feedback", function(e) {
66 + e.preventDefault();
67 +
68 + if (!confirm("Are you sure you want to delete all feedback?")) {
69 + return;
70 + }
71 +
72 + jQuery.post(ajaxurl, {
73 + action: "wpbot_clear_all_feedback"
74 + }, function(response) {
75 + if (response.success) {
76 + jQuery("#wpbot-clear-feedback-msg").text(response.data.message).css("color", "green");
77 + location.reload();
78 + } else {
79 + jQuery("#wpbot-clear-feedback-msg").text(response.data.message).css("color", "red");
80 + }
81 + });
82 +});
83 +JS;
84 +
85 + wp_add_inline_script( 'qcld-wp-apexcharts', $inline_script );
86 +}
16 87
17 88 function qcld_history_reporting_menu_func() {
18 89 $capability = function_exists( 'qcld_wpbot_get_menu_capability' ) ? qcld_wpbot_get_menu_capability( 'sessions' ) : 'publish_posts';
19 90