| Server IP : 121.121.20.254 / Your IP : 216.73.217.64 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/AIWEBSTATION/wp-content/plugins/wpbot-pro/ |
Upload File : |
<?php
/**
* Plugin Name: WPBot Pro Wordpress Chatbot
* Plugin URI: https://wordpress.org/plugins/wpbot-wordpress-chatbot/
* Description: Wordpress Chatbot by QuantumCloud.
* Donate link: http://www.quantumcloud.com
* Version: 15.2.5
* @author QuantumCloud
* Author: QuantumCloud
* Author URI: https://www.quantumcloud.com/
* Requires at least: 4.6
* Tested up to: 6.2
* Text Domain: wpchatbot
* Domain Path: /languages
* License: GPL2
*/
if (!defined('ABSPATH')) exit; // Exit if accessed directly
update_option('wpbotpro_valid_license', 1);
update_option('wpbotpro_invalid_license', 0);
update_option('qcld_wpbotpro_site_type', "Live");
update_option('qcld_wpbotpro_enter_license_key', "OYLITE0000000005603B1EBE56D0D7F8");
update_option('qcld_wpbotpro_enter_license_or_purchase_key', "OYLITE0000000005603B1EBE56D0D7F8");
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
if ( ! defined( 'QC_PLUGIN_DIR' ) ) {
define( 'QC_PLUGIN_DIR', __DIR__ );
}
if ( ! defined( 'QCLD_wpCHATBOT_ACTION' ) ) {
define( 'QCLD_wpCHATBOT_ACTION', 'https://www.quantumcloud.com/custom-chatbot-services/' );
}
if ( ! defined( 'QCLD_theme_BANNER_LANDING' ) ) {
define( 'QCLD_theme_BANNER_LANDING', 'https://www.quantumcloud.com/products/themes/chatbot-theme/' );
}
if ( ! defined( 'QCLD_wpCHATBOT_ACTION_hook' ) ) {
define( 'QCLD_wpCHATBOT_ACTION_hook', 'wpqcld_chk_seft' );
}
/*****************************************************
************ Initialize the plugin *****************/
if ( ! class_exists( 'qcld_wb_Chatbot' ) ) {
/**
* Main Class.
*/
final class qcld_wb_Chatbot {
private $id = 'wpbot';
public $version = '15.2.5';
/**
* WPBot Pro helper.
*
* @var object
*/
public $helper;
/**
* The single instance of the class.
*
* @var qcld_wb_Chatbot
* @since 1.0.0
*/
protected static $_instance = null;
/**
* Main wpbot Instance.
*
* Ensures only one instance of wpbot is loaded or can be loaded.
*
* @return qcld_wb_Chatbot - Main instance.
* @since 1.0.0
* @static
*/
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
public $response_list;
/**
* Constructor
*/
private function __construct() {
$this->define_constants();
$this->includes();
$this->init_hooks();
$this->helper = new Qcld_WPBot_Helper();
}
/**
* Cloning is forbidden.
*
* @since 1.0.0
*/
public function __clone() {
_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'wpchatbot' ), '1.0.0' );
}
/**
* Universalizing instances of this class is forbidden.
*
* @since 1.0.0
*/
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, __( 'Universalizing instances of this class is forbidden.', 'wpchatbot' ), '1.0.0' );
}
/**
* Define wpbot Constants.
*
* @return void
* @since 1.0.0
*/
public function define_constants() {
define( 'QCLD_wpCHATBOT_VERSION', $this->version );
define( 'QCLD_wpCHATBOT_REQUIRED_wpCOMMERCE_VERSION', 2.2 );
if ( ! defined( 'QCLD_wpCHATBOT_FILE_URL' ) ) {
define( 'QCLD_wpCHATBOT_FILE_URL', __FILE__ );
}
if ( ! defined( 'QCLD_wpCHATBOT_PLUGIN_DIR_PATH' ) ) {
define( 'QCLD_wpCHATBOT_PLUGIN_DIR_PATH', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'QCLD_wpCHATBOT_PLUGIN_URL' ) ) {
define( 'QCLD_wpCHATBOT_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
}
if ( ! defined( 'QCLD_wpCHATBOT_IMG_URL' ) ) {
define( 'QCLD_wpCHATBOT_IMG_URL', QCLD_wpCHATBOT_PLUGIN_URL . 'images/' );
}
if ( ! defined( 'QCLD_wpCHATBOT_IMG_ABSOLUTE_PATH' ) ) {
define( 'QCLD_wpCHATBOT_IMG_ABSOLUTE_PATH', plugin_dir_path( __FILE__ ) . 'images' );
}
define( 'QCLD_wpCHATBOT_INDEX_TABLE', 'wpwbot_index' );
$gcdirpath = WP_CONTENT_DIR . '/wpbot-dfv2-client';
define( 'QCLD_wpCHATBOT_GC_DIRNAME', $gcdirpath );
$wpcontentpath = WP_CONTENT_DIR;
define( 'QCLD_wpCHATBOT_GC_ROOT', $wpcontentpath );
}
/**
* Include all required files
*
* since 1.0.0
*
* @return void
*/
public function includes() {
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/integration/openai/qcld-bot-openai.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/integration/ollama/qcld-bot-ollama.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/integration/openrouter/qcld-bot-openrouter.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/integration/mistral/qcld-bot-mistral.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/integration/grok/qcld-bot-grok.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/integration/gemini/qcld-bot-gemini.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/integration/qcld-bot-rag.php';
// require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . "includes/integration/deepseek/qcld-bot-deekseekai.php");
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'qcld-wpwbot-search.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'functions.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'qcld_df_api.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'qcld-df-webhook.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-wpbot-gc-download.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-wpbot-install.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-frontend-resources.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-wpbot-helper.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'bot-start-menu/init.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-chatbot-floating-button.php';
if ( file_exists( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'managepackage.php' ) ) {
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'managepackage.php';
}
if ( is_admin() ) {
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/admin/class-wpbot-menu.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/admin/class-admin-resources.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-response-list.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-chatbot-option-save.php';
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'qc-support-promo-page/class-qc-support-promo-page.php';
require_once( QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'plugin-upgrader/plugin-upgrader.php' );
require_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . 'includes/class-wpbot-maybe-upgrade.php';
}
}
/**
* Hook into actions and filters.
*
* @since 1.0.0
*/
private function init_hooks() {
add_filter( 'set-screen-option', array( $this, 'set_screen' ), 10, 3 );
add_action( 'init', array( $this, 'wp_chatbot_lang_init' ) );
//add_action( 'plugins_loaded', array( $this, 'wp_chatbot_lang_init' ) );
add_action( 'activated_plugin', array( $this, 'qc_wpbotpro_activation_redirect' ) );
/*
* Registering custom end point for Webhook
* @Since 9.3.8
*/
add_action(
'rest_api_init',
function () {
register_rest_route(
'wpbot/v1',
'/dialogflow_webhook/',
array(
'methods' => 'POST',
'callback' => 'qcld_wpbot_dfwebhookcallback',
'permission_callback' => '__return_true',
)
);
}
);
add_action( 'wp_print_scripts', array( $this, 'qc_apppage_remove_all_scripts' ), 99 );
}
/**
* Set Response_list object to response_list property
*
* @return void
*/
public function set_response_list() {
$this->response_list = new Response_list();
}
/**
* Callback function for set-screen-option hook
*
* @param [type] $status
* @param [type] $option
* @param [type] $value
* @return void
*/
public static function set_screen( $status, $option, $value ) {
return $value;
}
/**
* Settings function
*
* @return void
*/
public function get_settings() {
include_once QCLD_wpCHATBOT_PLUGIN_DIR_PATH . '/includes/admin/settings-fields.php';
return array_merge( $wpbot_settings, $wpbot_languages );
}
/**
*
* Function to load translation files.
*/
public function wp_chatbot_lang_init() {
load_plugin_textdomain( 'wpchatbot', FALSE, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
// echo preg_replace('#[^0-9\.]#', '', $content);
}
/**
* Pugin activate redirect to license page function
*
* @param [type] $plugin
* @return void
*/
public function qc_wpbotpro_activation_redirect( $plugin ) {
if ( $plugin == plugin_basename( __FILE__ ) ) {
exit( wp_redirect( admin_url( 'admin.php?page=wpbot_license_page' ) ) );
}
}
/**
* Remove script for mobile app page
*
* @return void
*/
public function qc_apppage_remove_all_scripts() {
global $wp_scripts;
$wpbot_script = array( 'qcld-wp-chatbot-slimsqccrl-js', 'qcld-wp-chatbot-qcquery-cake', 'qcld-wp-chatbot-magnifict-qcpopup', 'qcld-wp-chatbot-plugin', 'qcld-wp-chatbot-front-js', 'wbca_ajax' );
if ( ! empty( $wp_scripts->queue ) ) {
$current_script = $wp_scripts->queue;
} else {
$current_script = '';
}
if ( is_page( 'wpwbot-mobile-app' ) ) {
foreach ( $current_script as $key => $value ) {
if ( ! in_array( $value, $wpbot_script ) ) {
unset( $current_script[ $key ] );
}
}
$wp_scripts->queue = array_values( $current_script );
}
}
}
/**
* Init function
*
* @return qcld_wb_Chatbot
*/
function qcld_wpbot() {
return qcld_wb_Chatbot::instance();
}
// fire off the plugin
qcld_wpbot();
}
register_activation_hook( __FILE__, 'qcld_wb_chatbot_default_options' );
if ( ! function_exists( 'qcld_wb_chatbot_default_options' ) ) {
/**
* Options function
*
* @return void
*/
function qcld_wb_chatbot_default_options() {
global $wpdb;
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
/**
* Free version replace code.
*/
$free = array( 'chatbot/qcld-wpwbot.php', 'woowbot-woocommerce-chatbot/qcld-woowbot.php' );
$all_plugins = get_plugins();
foreach ( $all_plugins as $plugin => $plugin_details ) {
if ( in_array( $plugin, $free ) ) {
if ( is_plugin_active( $plugin ) ) {
if ( deactivate_plugins( array( $plugin ) ) ) {
delete_plugins( array( $plugin ) );
}
} else {
delete_plugins( array( $plugin ) );
}
}
}
/**
* Free version replace code End.
*/
require_once plugin_dir_path( __FILE__ ) . 'includes/class-wpbot-install.php';
require_once plugin_dir_path( __FILE__ ) . 'functions.php';
if ( is_multisite() && $network_wide ) {
// Get all blogs in the network and activate plugin on each one.
$blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM $wpdb->blogs WHERE %d", 1 ) );
foreach ( $blog_ids as $blog_id ) {
switch_to_blog( $blog_id );
Qcld_WPBot_Install::install();
restore_current_blog();
}
} else {
Qcld_WPBot_Install::install();
}
update_option( 'wpbot_plugin_activated', 1 );
update_option( 'wpbot_main_plugin_installed', 1 );
set_transient( 'bot_clear_cache', 1, DAY_IN_SECONDS );
}
/**
* Upgrade function
*
* @param [type] $upgrader_object
* @param [type] $options
* @return void
*/
function wpbot_qc_upgrade_completed( $upgrader_object, $options ) {
// The path to our plugin's main file.
$our_plugin = plugin_basename( __FILE__ );
// If an update has taken place and the updated type is plugins and the plugins element exists.
if ( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) {
// Iterate through the plugins being updated and check if ours is there.
foreach ( $options['plugins'] as $plugin ) {
if ( $plugin == $our_plugin ) {
// set_transient( 'bot_clear_cache', 1, DAY_IN_SECONDS );
}
}
}
}
add_action( 'upgrader_process_complete', 'wpbot_qc_upgrade_completed', 10, 2 );
}