--- a/geeky-bot/geeky-bot.php
+++ b/geeky-bot/geeky-bot.php
@@ -3,14 +3,14 @@
/**
* @package Geeky Bot
* @author Geeky Bot
- * @version 1.1.8
+ * @version 1.1.9
*/
/*
* Plugin Name: Geeky Bot
* Plugin URI: https://geekybot.com/
* Description: The ultimate AI chatbot for WooCommerce lead generation, intelligent web search, and interactive customer engagement on your WordPress website.
* Author: Geeky Bot
- * Version: 1.1.8
+ * Version: 1.1.9
* Text Domain: geeky-bot
* Domain Path: /languages
* Author URI: https://geekybot.com/
@@ -95,7 +95,7 @@
self::$_data = array();
self::$_error_flag = null;
self::$_error_flag_message = null;
- self::$_currentversion = '118';
+ self::$_currentversion = '119';
self::$_addon_query = array('select'=>'','join'=>'','where'=>'');
self::$_config = GEEKYBOTincluder::GEEKYBOT_getModel('configuration');
self::$_isgeekybotplugin = true;
@@ -194,7 +194,7 @@
if (is_plugin_active('geeky-bot/geeky-bot.php')) {
include_once GEEKYBOT_PLUGIN_PATH . 'includes/updates/updates.php';
$installedversion = GEEKYBOTupdates::geekybot_getInstalledVersion();
- $cversion = '118';
+ $cversion = '119';
if ($installedversion != $cversion) {
add_action( 'admin_notices', array($this, 'geekybot_sql_update_available_notice') );
}
@@ -273,7 +273,7 @@
// restore colors data end
update_option('geekybot_currentversion', self::$_currentversion);
include_once GEEKYBOT_PLUGIN_PATH . 'includes/updates/updates.php';
- GEEKYBOTupdates::GEEKYBOT_checkUpdates('118');
+ GEEKYBOTupdates::GEEKYBOT_checkUpdates('119');
GEEKYBOTincluder::GEEKYBOT_getModel('geekybot')->updateColorFile();
}
}
--- a/geeky-bot/includes/activation.php
+++ b/geeky-bot/includes/activation.php
@@ -144,7 +144,7 @@
('title', 'GeekyBot', 'default', NULL),
('pagination_default_page_size', '10', 'default', NULL),
('pagination_product_page_size', '3', 'default', NULL),
- ('versioncode', '1.1.8', 'default', NULL),
+ ('versioncode', '1.1.9', 'default', NULL),
('last_version', '101', 'default', NULL),
('image_file_type', 'png,jpeg,gif,jpg', 'default', NULL),
('bot_custom_img', '0', 'default', NULL),
--- a/geeky-bot/modules/chatserver/model.php
+++ b/geeky-bot/modules/chatserver/model.php
@@ -18,9 +18,8 @@
if (!wp_verify_nonce($nonce, 'get-message-response')) {
// disable nonce
/*$errorMessage = new stdClass();
- $errorMessage->bot_response = esc_html(
- __("Security verification Failed, Please refresh your chat to continue.", "geeky-bot")
- );
+ $errorMessage->bot_response =
+ __("Security verification Failed, Please refresh your chat to continue.", "geeky-bot");
$retVal[] = ["recipient_id" => $chat_id, "text" => $errorMessage];
return wp_json_encode($retVal);*/
}
@@ -28,23 +27,21 @@
// Check if the chat session has expired
if (empty($chat_id)) {
$errorMessage = new stdClass();
- $errorMessage->bot_response = esc_html(
- __("Your session has expired; please restart your chat.", "geeky-bot")
- );
+ $errorMessage->bot_response = __("Your session has expired; please restart your chat.", "geeky-bot");
$retVal[] = ["recipient_id" => $chat_id, "text" => $errorMessage];
return wp_json_encode($retVal);
}
// Retrieve user inputs
- $message = GEEKYBOTrequest::GEEKYBOT_getVar('cmessage');
- $text = GEEKYBOTrequest::GEEKYBOT_getVar('ctext');
- $sender = GEEKYBOTrequest::GEEKYBOT_getVar('csender');
+ $message = sanitize_text_field(GEEKYBOTrequest::GEEKYBOT_getVar('cmessage'));
+ $text = sanitize_text_field(GEEKYBOTrequest::GEEKYBOT_getVar('ctext'));
+ $sender = sanitize_text_field(GEEKYBOTrequest::GEEKYBOT_getVar('csender'));
$response_id = GEEKYBOTrequest::GEEKYBOT_getVar('response_id');
$btnflag = GEEKYBOTrequest::GEEKYBOT_getVar('btnflag');
$session_type = '';
- $logdata = "n chatserver->getMessageResponse";
- $logdata .= "n message: ".$message;
+ $logdata = "n chatserver->getMessageResponse";
+ $logdata .= "n message: ".$message;
// Save user message to session and chat history
if (!empty($text)) {
geekybot::$_geekybotsessiondata->geekybot_addChatHistoryToSession($text, 'user');
@@ -60,7 +57,7 @@
if (!empty($intentIdAndScore['id'])) {
// get intent data from intent id
$query = "SELECT `id`, `user_messages`, `user_messages_text`, `group_id` FROM `" . geekybot::$_db->prefix . "geekybot_intents` WHERE `id` = " . esc_sql($intentIdAndScore['id']);
- $logdata .= "n query: ".$query;
+ $logdata .= "n query: ".$query;
$intentData = geekybotdb::GEEKYBOT_get_row($query);
$intentGroupId = $intentData->group_id;
@@ -266,11 +263,11 @@
if ($responseButton->type == 1) {
$botResponse .= "<li class='geekybot-message geekybot-message-button'>";
$botResponse .= "<section><button class='wp-chat-btn' onclick='sendbtnrsponse(this);' value='".$responseButton->value."'>";
- $botResponse .= "<span>" . esc_html($responseButton->text) . "</span></button></section></li>";
+ $botResponse .= "<span>" . $responseButton->text . "</span></button></section></li>";
} elseif ($responseButton->type == 2) {
$botResponse .= "<li class='geekybot-message geekybot-message-button'>";
$botResponse .= "<section><button class='wp-chat-btn'><span><a class='wp-chat-btn-link' href='".$responseButton->value."'>";
- $botResponse .= esc_html($responseButton->text) . "</a></span></button></section></li>";
+ $botResponse .= $responseButton->text . "</a></span></button></section></li>";
}
}
$botResponse .= "</div>";
@@ -809,11 +806,11 @@
if ($fbButton->type == 1) {
$botFallBack .= "<li class='geekybot-message geekybot-message-button'>";
$botFallBack .= "<section><button class='wp-chat-btn' onclick='sendbtnrsponse(this);' value='".$fbButton->value."'>";
- $botFallBack .= "<span>" . esc_html($fbButton->text) . "</span></button></section></li>";
+ $botFallBack .= "<span>" . $fbButton->text . "</span></button></section></li>";
} elseif ($fbButton->type == 2) {
$botFallBack .= "<li class='geekybot-message geekybot-message-button'>";
$botFallBack .= "<section><button class='wp-chat-btn'><span><a class='wp-chat-btn-link' href='".$fbButton->value."'>";
- $botFallBack .= esc_html($fbButton->text) . "</a></span></button></section></li>";
+ $botFallBack .= $fbButton->text . "</a></span></button></section></li>";
}
}
$botFallBack .= "</div>";
@@ -859,11 +856,11 @@
if ($fbButton->type == 1) {
$botFallBack .= "<li class='geekybot-message geekybot-message-button'>";
$botFallBack .= "<section><button class='wp-chat-btn' onclick='sendbtnrsponse(this);' value='".$fbButton->value."'>";
- $botFallBack .= "<span>" . esc_html($fbButton->text) . "</span></button></section></li>";
+ $botFallBack .= "<span>" . $fbButton->text . "</span></button></section></li>";
} elseif ($fbButton->type == 2) {
$botFallBack .= "<li class='geekybot-message geekybot-message-button'>";
$botFallBack .= "<section><button class='wp-chat-btn'><span><a class='wp-chat-btn-link' href='".$fbButton->value."'>";
- $botFallBack .= esc_html($fbButton->text) . "</a></span></button></section></li>";
+ $botFallBack .= $fbButton->text . "</a></span></button></section></li>";
}
}
$botFallBack .= "</div>";
--- a/geeky-bot/modules/chatserver/tmpl/chatpopup.inc.php
+++ b/geeky-bot/modules/chatserver/tmpl/chatpopup.inc.php
@@ -6,12 +6,12 @@
$userImgScr = GEEKYBOTincluder::GEEKYBOT_getModel('geekybot')->getUserImagePath();
$geekybot_js = '
jQuery(document).ready(function(){
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
jQuery.post(ajaxurl, {
action: "geekybot_ajax",
geekybotme: "geekybot",
task: "geekybotFreshMessages",
- "_wpnonce": "' . esc_attr(wp_create_nonce("geekybot_fresh_messages")) . '"
+ "_wpnonce": "' . esc_js(wp_create_nonce("geekybot_fresh_messages")) . '"
}, function(response) {
if (response) {
jQuery(".geekbotMessageWrapper").html(response);
@@ -38,13 +38,13 @@
// $geekybot_js .= 'jQuery(".geekybot-chat-popup").addClass("active");';
if (geekybot::$_configuration['welcome_screen'] == '2') {
$geekybot_js.='
- jQuery(".geekybot-chat-popup").addClass("geekybot-chat-init");
-
- ';
+ jQuery(".geekybot-chat-popup").addClass("geekybot-chat-init");';
}
$geekybot_js.='
var scrollableDiv = jQuery("#geekybot-main-messages");
- scrollableDiv.scrollTop(scrollableDiv[0].scrollHeight);
+ if (scrollableDiv.length > 0) {
+ scrollableDiv.scrollTop(scrollableDiv[0].scrollHeight);
+ }
';
}
$geekybot_js .= '
@@ -59,8 +59,7 @@
getRandomChatId();';
if (geekybot::$_configuration['welcome_screen'] == '2') {
$geekybot_js.='
- jQuery(".geekybot-chat-popup").addClass("geekybot-chat-init");
- ';
+ jQuery(".geekybot-chat-popup").addClass("geekybot-chat-init");';
}
$geekybot_js.='
}
@@ -83,18 +82,33 @@
jQuery("#geekybot-send-button").click(function(event){
var message = jQuery(".geekybot-message-box").val();
if (!message) {
- alert("Please enter a message to before sending");
+ alert("'.esc_js(__("Please enter a message before sending", "geeky-bot")).'");
return false;
} else {
var sender = "user";
jQuery(".geekybot-message-box").val("");
- var sender = "user";
var btnflag = "false";
var chat_id = jQuery("#chatsession").val();
- jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-user"><section class="geekybot-message-user-img 01"><img src="'.esc_url($userImgScr).'" alt="" /></section><section class="geekybot-message-text">'+message+'</section></li>');
- var response_id = jQuery("#response_id").val();
+
+ // 1. Create the LI container object
+ var $msgItem = jQuery('<li class="geekybot-message geekybot-message-user"></li>');
+
+ // 2. Create the Image section
+ var $imgSection = jQuery('<section class="geekybot-message-user-img 01"><img src="'.esc_js($userImgScr).'" alt="" /></section>');
+
+ // 3. Create the Text section and safely inject the message
+ // .text() is what kills the XSS attack
+ var $textSection = jQuery('<section class="geekybot-message-text"></section>').text(message);
+
+ // 4. Assemble: Put the Image and Text inside the LI
+ $msgItem.append($imgSection).append($textSection);
+
+ // 5. Final Step: Put the full LI into the Chat Box
+ jQuery('#geekybotChatBox').append($msgItem);
+
+ var response_id = jQuery("#response_id").val();
// SaveChathistory(message,sender);
- sendRequestToServer(message,message,sender,chat_id);
+ sendRequestToServer(message, message, sender, chat_id);
}
});
@@ -102,18 +116,23 @@
if ( event.which == 13 ) {
var message = jQuery(".geekybot-message-box").val();
if (!message) {
- alert("Please enter a message to before sending");
+ alert("'.esc_js(__("Please enter a message before sending", "geeky-bot")).'");
return false;
} else {
var sender = "user";
jQuery(".geekybot-message-box").val("");
- var sender = "user";
var chat_id = jQuery("#chatsession").val();
- jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-user"><section class="geekybot-message-user-img 02"><img src="'.esc_url($userImgScr).'" alt="" /></section><section class="geekybot-message-text">'+message+'</section></li>');
- var response_id = jQuery("#response_id").val();
- var btnflag = "false";
- // SaveChathistory(message,sender);
- sendRequestToServer(message,message,sender,chat_id);
+
+ var $msgItem = jQuery('<li class="geekybot-message geekybot-message-user"></li>');
+ var $imgSection = jQuery('<section class="geekybot-message-user-img 02"><img src="'.esc_js($userImgScr).'" alt="" /></section>');
+ var $textSection = jQuery('<section class="geekybot-message-text"></section>').text(message);
+
+ $msgItem.append($imgSection).append($textSection);
+ jQuery('#geekybotChatBox').append($msgItem);
+
+ var response_id = jQuery("#response_id").val();
+ // SaveChathistory(message,sender);
+ sendRequestToServer(message, message, sender, chat_id);
}
}
});
@@ -124,8 +143,8 @@
var message = "Chat End by user";
var date = new Date();
date.setTime(date.getTime());
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "endUserChat", cmessage: message,sender:sender ,chat_id:chat_id, "_wpnonce":"'. esc_attr(wp_create_nonce("end-user-chat")) .'"}, function (data) {
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "endUserChat", cmessage: message,sender:sender ,chat_id:chat_id, "_wpnonce":"'. esc_js(wp_create_nonce("end-user-chat")) .'"}, function (data) {
if (data) {
jQuery("#geekybotChatBox").empty();
var path = window.location.href;
@@ -166,8 +185,8 @@
x1 = x1 + " " + hours + ":" + minutes + ":" + seconds ;
var dt = x1; ';
$geekybot_js.='
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "restartUserChat", datetime:dt, "_wpnonce":"'. esc_attr(wp_create_nonce("restart-user-chat")). '"}, function (data) {
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "restartUserChat", datetime:dt, "_wpnonce":"'. esc_js(wp_create_nonce("restart-user-chat")). '"}, function (data) {
if (data) {
jQuery("#chatsession").val(data)
jQuery("#geekybotChatBox").empty();
@@ -181,7 +200,7 @@
// Code to open the chat popup
document.addEventListener("DOMContentLoaded", function() {';
if ( geekybot::$_configuration['auto_chat_start'] == 1 && geekybot::$_configuration['auto_chat_start_time'] != '' ) {
- $startTime = geekybot::$_configuration['auto_chat_start_time'];
+ $startTime = (int)geekybot::$_configuration['auto_chat_start_time'];
// change time from seconds to miliseconds
$startTime = $startTime * 1000;
$geekybot_js.='
@@ -202,11 +221,9 @@
//
if(hide_smart_popup == 0) {
jQuery(".geekybot-chat-open-outer-popup-mainwrp").fadeIn().css("display", "flex");
- }
- ';
+ }';
} else {
- $geekybot_js.='
- jQuery(".geekybot-chat-open-dialog").click();';
+ $geekybot_js.='jQuery(".geekybot-chat-open-dialog").click();';
}
}
$geekybot_js.='
@@ -232,8 +249,8 @@
x1 = x1 + " " + hours + ":" + minutes + ":" + seconds ;
var dt = x1;
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "restartUserChat", datetime:dt, "_wpnonce":"'. esc_attr(wp_create_nonce("restart-user-chat")). '"}, function (data) {
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "restartUserChat", datetime:dt, "_wpnonce":"'. esc_js(wp_create_nonce("restart-user-chat")). '"}, function (data) {
if (data) {
jQuery("#chatsession").val(data);
// Wait a moment to ensure cookie is set and browser acknowledges it
@@ -267,8 +284,8 @@
var dt = x1;
var user = "user";';
$geekybot_js .= '
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "getRandomChatId", datetime: dt, "_wpnonce":"'. esc_attr(wp_create_nonce("get-random-chat-id")).'" }, function (data) {
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "getRandomChatId", datetime: dt, "_wpnonce":"'. esc_js(wp_create_nonce("get-random-chat-id")).'" }, function (data) {
if (data) {
var chat_id = data;
jQuery("#chatsession").val(data);
@@ -299,29 +316,29 @@
}
function geekybotLoadMoreCustomPosts(msg, data_array, next_page, function_name) {
- var message = "'.esc_html(__('Show More', 'geeky-bot')).'";
+ var message = "'.esc_js(__('Show More', 'geeky-bot')).'";
SaveChathistory(message,"user");
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "geekybot", task: "geekybotLoadMoreCustomPosts", msg : msg, dataArray : data_array, next_page: next_page, functionName : function_name, "_wpnonce":"'.esc_attr(wp_create_nonce("load-more")) .'"}, function (data) {
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "geekybot", task: "geekybotLoadMoreCustomPosts", msg : msg, dataArray : data_array, next_page: next_page, functionName : function_name, "_wpnonce":"'.esc_js(wp_create_nonce("load-more")) .'"}, function (data) {
if (data) {
geekybot_scrollToTop(190);
var message = geekybot_DecodeHTML(data);
jQuery('div.geekybot_wc_product_load_more_wrp').css('display', 'none');
- jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot"><section class="geekybot-message-bot-img 07"><img src="'.esc_url($botImgScr).'" alt="" /></section><section class="geekybot-message-text">'+message+'</section></li>');
+ jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot"><section class="geekybot-message-bot-img 07"><img src="'.esc_js($botImgScr).'" alt="" /></section><section class="geekybot-message-text">'+message+'</section></li>');
}
});
}
function showArticlesList(post_ids, msg, type, label, total_posts, current_page) {
- var message = "'.esc_html(__('Show Articles', 'geeky-bot')).'";
+ var message = "'.esc_js(__('Show Articles', 'geeky-bot')).'";
SaveChathistory(message,"user");
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "websearch", task: "showArticlesList", post_ids: post_ids, msg: msg, type: type, label: label, totalPosts: total_posts, currentPage: current_page, "_wpnonce":"'.esc_attr(wp_create_nonce("articles-list")) .'"}, function (data) {
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "websearch", task: "showArticlesList", post_ids: post_ids, msg: msg, type: type, label: label, totalPosts: total_posts, currentPage: current_page, "_wpnonce":"'.esc_js(wp_create_nonce("articles-list")) .'"}, function (data) {
if (data) {
geekybot_scrollToTop(340);
var message = geekybot_DecodeHTML(data);
jQuery('.geekybot_wc_post_load_more').css('display', 'none');
- jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot"><section class="geekybot-message-bot-img 08"><img src="'.esc_url($botImgScr).'" alt="" /></section><section class="geekybot-message-text">'+message+'</section></li>');
+ jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot"><section class="geekybot-message-bot-img 08"><img src="'.esc_js($botImgScr).'" alt="" /></section><section class="geekybot-message-text">'+message+'</section></li>');
}
});
}
@@ -331,10 +348,10 @@
if(chat_id!=""){
setTimeout(function(){';
$geekybot_js.='
- var message = "'.__('session time out', 'geeky-bot').'";
+ var message = "'.esc_js(__('session time out', 'geeky-bot')).'";
var sender = "user";
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "endUserChat", cmessage: message,sender:sender ,chat_id:chat_id, "_wpnonce":"'. esc_attr(wp_create_nonce("end-user-chat")) .'"}, function (data) {
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "endUserChat", cmessage: message, sender:sender ,chat_id:chat_id, "_wpnonce":"'. esc_js(wp_create_nonce("end-user-chat")) .'"}, function (data) {
if (data) {
jQuery("#geekybotChatBox").empty();
var path = window.location.href;
@@ -359,15 +376,14 @@
var chat_id = jQuery("#chatsession").val();
';
$geekybot_js.='
- jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-user"><section class="geekybot-message-user-img 04"><img src="'.esc_url($userImgScr).'" alt="" /></section><section class="geekybot-message-text">'+text+'</section></li>');
- var ajaxurl =
- "'. esc_url(admin_url("admin-ajax.php")) .'";
+ jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-user"><section class="geekybot-message-user-img 04"><img src="'.esc_js($userImgScr).'" alt="" /></section><section class="geekybot-message-text">'+text+'</section></li>');
+ var ajaxurl = "'. esc_js(admin_url("admin-ajax.php")) .'";
jQuery.post(ajaxurl, {
action: "geekybot_ajax",
geekybotme: "slots",
message: message,
task: "saveVariableFromButtonIntent",
- "_wpnonce":"'. esc_attr(wp_create_nonce("variable-from-button-intent")). '"
+ "_wpnonce":"'. esc_js(wp_create_nonce("variable-from-button-intent")). '"
}, function(data) {
if (data) {
sendRequestToServer(data,text,sender,chat_id);
@@ -386,9 +402,9 @@
function SaveChathistory(message,sender) { ';
$geekybot_js.='
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
var response_id = jQuery("#response_id").val();
- jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "SaveChathistory", cmessage: message,csender:sender, "_wpnonce":"'.esc_attr(wp_create_nonce("save-chat-history")).'" }, function (data) {
+ jQuery.post(ajaxurl, { action: "geekybot_frontendajax", geekybotme: "chathistory", task: "SaveChathistory", cmessage: message,csender:sender, "_wpnonce":"'.esc_js(wp_create_nonce("save-chat-history")).'" }, function (data) {
if (data) {
if(sender=="user") {
jQuery("#response_id").val(data);
@@ -416,12 +432,12 @@
function sendMessageAjax(message,text,sender,chat_id){
//geekybot_scrollToTop(1);
- jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot geekybot_loading"><section class="geekybot-message-bot-img 05"><img src="' . esc_url($botImgScr) . '" alt="" /></section><section class="geekybot-message-text_wrp"></section></li>');
+ jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot geekybot_loading"><section class="geekybot-message-bot-img 05"><img src="' . esc_js($botImgScr) . '" alt="" /></section><section class="geekybot-message-text_wrp"></section></li>');
var listItem = jQuery('#geekybotChatBox').find('li.geekybot-message-bot').last(); // Get the last inserted <li>
- listItem.find('section.geekybot-message-text_wrp').append('<section class="geekybot-message-loading"><img src="'.esc_url(GEEKYBOT_PLUGIN_URL).'includes/images/bot-typing.gif" alt="" /></section>');
+ listItem.find('section.geekybot-message-text_wrp').append('<section class="geekybot-message-loading"><img src="'.esc_js(GEEKYBOT_PLUGIN_URL).'includes/images/bot-typing.gif" alt="" /></section>');
jQuery.ajax({
- url: "'.esc_url(admin_url('admin-ajax.php')).'",
+ url: "'.esc_js(admin_url('admin-ajax.php')).'",
type: "POST",
async: true,
data: {
@@ -432,7 +448,7 @@
cmessage: message,
ctext: text,
csender:sender,
- "_wpnonce":"'.esc_attr(wp_create_nonce('get-message-response')).'"
+ "_wpnonce":"'.esc_js(wp_create_nonce('get-message-response')).'"
},
}).done(function(data) {
//geekybot_scrollToTop(150);
@@ -478,13 +494,13 @@
});
} else {
geekybot_scrollToTop(150);
- var ajaxurl = "'.esc_url(admin_url('admin-ajax.php')).'";
+ var ajaxurl = "'.esc_js(admin_url('admin-ajax.php')).'";
jQuery.post(ajaxurl, {
action: "geekybot_frontendajax",
geekybotme: "chatserver",
task: "getDefaultFallBackFormAjax",
chat_id: chat_id,
- "_wpnonce": "' . esc_attr(wp_create_nonce('get-fallback')) . '"
+ "_wpnonce": "' . esc_js(wp_create_nonce('get-fallback')) . '"
}, function(fbdata) {
if (fbdata) {
var fbdata = JSON.parse(fbdata);
@@ -537,9 +553,9 @@
}
}).fail(function(data, textStatus, xhr) {
jQuery(".geekybot-message-loading").remove();
- var configmsg = "'.esc_attr(geekybot::$_configuration['default_message']).'";
+ var configmsg = "'.esc_js(geekybot::$_configuration['default_message']).'";
- jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot"><section class="geekybot-message-bot-img 06"><img src="'.esc_url($botImgScr).'" alt="" /></section><section class="geekybot-message-text">'+configmsg+'</section></li>');
+ jQuery('#geekybotChatBox').append('<li class="geekybot-message geekybot-message-bot"><section class="geekybot-message-bot-img 06"><img src="'.esc_js($botImgScr).'" alt="" /></section><section class="geekybot-message-text">'+configmsg+'</section></li>');
});
jQuery(".geekybot-message-bot").removeClass("geekybot_loading");
}
@@ -547,9 +563,6 @@
';
wp_register_script( 'geekybot-frontend-handle', '' , array(), GEEKYBOT_PLUGIN_VERSION, 'all');
wp_enqueue_script( 'geekybot-frontend-handle' );
- wp_add_inline_script('geekybot-frontend-handle',$geekybot_js);
+ wp_add_inline_script('geekybot-frontend-handle', $geekybot_js);
?>
-
-
-
--- a/geeky-bot/modules/geekybot/controller.php
+++ b/geeky-bot/modules/geekybot/controller.php
@@ -14,7 +14,7 @@
switch ($layout) {
case 'admin_controlpanel':
include_once GEEKYBOT_PLUGIN_PATH . 'includes/updates/updates.php';
- GEEKYBOTupdates::GEEKYBOT_checkUpdates(118);
+ GEEKYBOTupdates::GEEKYBOT_checkUpdates(119);
GEEKYBOTincluder::GEEKYBOT_getModel('geekybot')->getAdminControlPanelData();
// remove this code in 1.1.7
$uploadDir = wp_upload_dir();
--- a/geeky-bot/modules/zywrap/model.php
+++ b/geeky-bot/modules/zywrap/model.php
@@ -594,7 +594,7 @@
$type = GEEKYBOTrequest::GEEKYBOT_getVar('actionType');
// 1. Download the ZIP file [cite: `PhpSdk.jsx`]
- $geekybot_url = 'https://api.zywrap.com/v1/sdk/download';
+ $geekybot_url = 'https://api.zywrap.com/v1/sdk/export/';
$response = wp_remote_get( $geekybot_url, array(
'timeout' => 300, // 5 minutes
'headers' => array(