Changeset 3750286
- Timestamp:
- 10/16/2026 11:17:27 AM (2 days ago)
- Location:
- bitsa-ai-chatbot
- Files:
-
- 2 added
- 2 deleted
- 6 edited
- 1 copied
-
assets/favicon-512.png (deleted)
-
assets/favicon.ico (deleted)
-
assets/screenshot-1.png (added)
-
assets/screenshot-2.png (added)
-
tags/1.0.1 (copied) (copied from bitsa-ai-chatbot/trunk )
-
tags/1.0.1/bitsa-ai-chatbot.php (modified) (29 diffs)
-
tags/1.0.1/readme.txt (modified) (1 diff)
-
tags/1.0.1/uninstall.php (modified) (1 diff)
-
trunk/bitsa-ai-chatbot.php (modified) (29 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bitsa-ai-chatbot/tags/1.0.1/bitsa-ai-chatbot.php
r3750113 r3750286 4 4 * Plugin URI: https://www.bitsaai.com/wordpress-ai-chatbot-plugin/ 5 5 * Description: Add your Bitsa AI chatbot to every page of your site. It answers visitor questions 24/7 from your own content and captures leads. Paste your Client ID under Bitsa AI Chatbot in the admin menu. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 … … 12 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 13 * Text Domain: bitsa-ai-chatbot 14 * 15 * @package Bitsa_AI_Chatbot 14 16 */ 15 17 … … 18 20 } 19 21 20 define( 'BITSAAI_CHATBOT_VERSION', '1.0. 0' );22 define( 'BITSAAI_CHATBOT_VERSION', '1.0.1' ); 21 23 define( 'BITSAAI_CHATBOT_OPTION', 'bitsaai_chatbot_settings' ); 24 define( 'BITSAAI_CHATBOT_HANDLE', 'bitsaai-chatbot' ); 25 define( 'BITSAAI_CHATBOT_PAGE', 'bitsaai-chatbot' ); 22 26 define( 'BITSAAI_CHATBOT_SNIPPET_URL', 'https://www.bitsaai.com/embed-snippet.js' ); 27 define( 'BITSAAI_CHATBOT_SIGNUP_URL', 'https://www.bitsaai.com/signup' ); 23 28 define( 'BITSAAI_CHATBOT_DASHBOARD_URL', 'https://www.bitsaai.com/login' ); 24 29 define( 'BITSAAI_CHATBOT_DOMAINS_URL', 'https://www.bitsaai.com/client/domains' ); 30 define( 'BITSAAI_CHATBOT_PRIVACY_URL', 'https://www.bitsaai.com/privacy/' ); 25 31 26 32 /** … … 31 37 */ 32 38 function bitsaai_chatbot_site_domain() { 33 $host = wp_parse_url( home_url(), PHP_URL_HOST ); 34 $host = strtolower( (string) $host ); 39 $host = strtolower( (string) wp_parse_url( home_url(), PHP_URL_HOST ) ); 35 40 if ( 0 === strpos( $host, 'www.' ) ) { 36 41 $host = substr( $host, 4 ); … … 40 45 41 46 /** 42 * Saved settings merged with defaults. 47 * Saved settings merged with defaults and cast to their expected types, so a 48 * hand-edited or corrupted option can never reach the page as something else. 43 49 * 44 50 * @return array{client_id: string, enabled: bool} … … 46 52 function bitsaai_chatbot_get_settings() { 47 53 $saved = get_option( BITSAAI_CHATBOT_OPTION, array() ); 48 return wp_parse_args( 49 is_array( $saved ) ? $saved : array(), 50 array( 51 'client_id' => '', 52 'enabled' => true, 53 ) 54 $saved = is_array( $saved ) ? $saved : array(); 55 56 return array( 57 'client_id' => isset( $saved['client_id'] ) ? bitsaai_chatbot_extract_client_id( $saved['client_id'] ) : '', 58 'enabled' => isset( $saved['enabled'] ) ? (bool) $saved['enabled'] : true, 54 59 ); 55 60 } … … 59 64 * embed code copied from the Bitsa AI dashboard. 60 65 * 61 * @param string$raw Pasted value.66 * @param mixed $raw Pasted value. 62 67 * @return string 24-character Client ID, or '' if none found. 63 68 */ 64 69 function bitsaai_chatbot_extract_client_id( $raw ) { 70 if ( ! is_scalar( $raw ) ) { 71 return ''; 72 } 65 73 if ( preg_match( '/\b([a-f0-9]{24})\b/i', (string) $raw, $m ) ) { 66 74 return strtolower( $m[1] ); … … 69 77 } 70 78 71 /* ------------------------------------------------------------------------- 79 /** 80 * HTML allowed in translatable admin strings that embed a link. 81 * 82 * @return array 83 */ 84 function bitsaai_chatbot_allowed_html() { 85 return array( 86 'a' => array( 87 'href' => true, 88 'target' => true, 89 'rel' => true, 90 ), 91 'strong' => array(), 92 ); 93 } 94 95 /** 96 * Markup for a link that opens the Bitsa AI dashboard in a new tab. 97 * 98 * @param string $url Destination. 99 * @param string $text Link text (unescaped). 100 * @return string 101 */ 102 function bitsaai_chatbot_external_link( $url, $text ) { 103 return '<a href="' . esc_url( $url ) . '" target="_blank" rel="noopener noreferrer">' . esc_html( $text ) . '</a>'; 104 } 105 106 /* 72 107 * Front end: load the widget. 73 * ---------------------------------------------------------------------- */108 */ 74 109 75 110 /** … … 78 113 function bitsaai_chatbot_enqueue() { 79 114 $settings = bitsaai_chatbot_get_settings(); 80 if ( empty( $settings['enabled'] ) || '' === $settings['client_id'] ) { 81 return; 82 } 83 wp_enqueue_script( 'bitsaai-chatbot', BITSAAI_CHATBOT_SNIPPET_URL, array(), BITSAAI_CHATBOT_VERSION, true ); 115 if ( ! $settings['enabled'] || '' === $settings['client_id'] ) { 116 return; 117 } 118 119 /** 120 * Filters whether the chatbot loads on the current request. Return false to 121 * hide it on specific pages, e.g. checkout or a landing page. 122 * 123 * @param bool $load Whether to load the widget. Default true. 124 */ 125 if ( ! apply_filters( 'bitsaai_chatbot_load_widget', true ) ) { 126 return; 127 } 128 129 // The snippet URL is unversioned on our side, so no ?ver= is appended. The 130 // array form gives native async on WP 6.3+; older versions read it as 131 // in_footer = true and the async attribute is added in the tag filter below. 132 wp_enqueue_script( 133 BITSAAI_CHATBOT_HANDLE, 134 BITSAAI_CHATBOT_SNIPPET_URL, 135 array(), 136 null, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- remote file, versioned by the service. 137 array( 138 'in_footer' => true, 139 'strategy' => 'async', 140 ) 141 ); 84 142 } 85 143 add_action( 'wp_enqueue_scripts', 'bitsaai_chatbot_enqueue' ); 86 144 87 145 /** 88 * Add the async flag and thedata attributes the loader reads to our script tag only.146 * Add the data attributes the loader reads to our script tag only. 89 147 * 90 148 * @param string $tag Script tag HTML. … … 93 151 */ 94 152 function bitsaai_chatbot_script_tag( $tag, $handle ) { 95 if ( 'bitsaai-chatbot'!== $handle ) {153 if ( BITSAAI_CHATBOT_HANDLE !== $handle ) { 96 154 return $tag; 97 155 } 98 $settings = bitsaai_chatbot_get_settings(); 99 $attrs = sprintf( 100 ' data-client-id="%s" data-mode="ai" async', 101 esc_attr( $settings['client_id'] ) 102 ); 103 return str_replace( ' src=', $attrs . ' src=', $tag ); 156 $client_id = bitsaai_chatbot_get_settings()['client_id']; 157 if ( '' === $client_id ) { 158 return $tag; 159 } 160 $script_id = BITSAAI_CHATBOT_HANDLE . '-js'; 161 162 // WP 6.2+: edit the tag with the HTML API instead of string surgery, so 163 // before/after inline scripts and attribute quoting styles don't matter. 164 if ( class_exists( 'WP_HTML_Tag_Processor' ) ) { 165 $processor = new WP_HTML_Tag_Processor( $tag ); 166 while ( $processor->next_tag( 'script' ) ) { 167 if ( $script_id !== $processor->get_attribute( 'id' ) ) { 168 continue; 169 } 170 $processor->set_attribute( 'data-client-id', $client_id ); 171 $processor->set_attribute( 'data-mode', 'ai' ); 172 // Keep Cloudflare Rocket Loader from rewriting the tag: the loader needs 173 // document.currentScript to read its data attributes. 174 $processor->set_attribute( 'data-cfasync', 'false' ); 175 $processor->set_attribute( 'async', true ); 176 return $processor->get_updated_html(); 177 } 178 return $tag; 179 } 180 181 $attrs = sprintf( 182 ' data-client-id="%s" data-mode="ai" data-cfasync="false"%s', 183 esc_attr( $client_id ), 184 preg_match( '/\sasync\b/i', $tag ) ? '' : ' async' 185 ); 186 return (string) preg_replace( 187 '/<script\b(?=[^>]*\bid=["\']' . preg_quote( $script_id, '/' ) . '["\'])/i', 188 '<script' . $attrs, 189 $tag, 190 1 191 ); 104 192 } 105 193 add_filter( 'script_loader_tag', 'bitsaai_chatbot_script_tag', 10, 2 ); 106 194 107 /* -------------------------------------------------------------------------195 /* 108 196 * Admin: settings page. 109 * ---------------------------------------------------------------------- */197 */ 110 198 111 199 /** … … 119 207 'type' => 'array', 120 208 'sanitize_callback' => 'bitsaai_chatbot_sanitize_settings', 209 'show_in_rest' => false, 121 210 'default' => array( 122 211 'client_id' => '', … … 126 215 ); 127 216 128 add_settings_section( 'bitsaai_chatbot_main', '', '__return_false', 'bitsaai-chatbot');217 add_settings_section( 'bitsaai_chatbot_main', '', '__return_false', BITSAAI_CHATBOT_PAGE ); 129 218 130 219 add_settings_field( … … 132 221 __( 'Client ID', 'bitsa-ai-chatbot' ), 133 222 'bitsaai_chatbot_field_client_id', 134 'bitsaai-chatbot',223 BITSAAI_CHATBOT_PAGE, 135 224 'bitsaai_chatbot_main', 136 225 array( 'label_for' => 'bitsaai_chatbot_client_id' ) … … 141 230 __( 'Show chatbot', 'bitsa-ai-chatbot' ), 142 231 'bitsaai_chatbot_field_enabled', 143 'bitsaai-chatbot',232 BITSAAI_CHATBOT_PAGE, 144 233 'bitsaai_chatbot_main' 145 234 ); … … 156 245 $input = is_array( $input ) ? $input : array(); 157 246 $raw_id = isset( $input['client_id'] ) ? wp_unslash( $input['client_id'] ) : ''; 247 $raw_id = is_scalar( $raw_id ) ? trim( (string) $raw_id ) : null; // null: malformed request. 158 248 $client_id = bitsaai_chatbot_extract_client_id( $raw_id ); 159 249 160 if ( '' !== trim( (string) $raw_id )&& '' === $client_id ) {250 if ( '' !== $raw_id && '' === $client_id ) { 161 251 add_settings_error( 162 252 BITSAAI_CHATBOT_OPTION, … … 164 254 __( 'That does not look like a Bitsa AI Client ID. Copy it from Branding → Embed code in your Bitsa AI dashboard.', 'bitsa-ai-chatbot' ) 165 255 ); 256 // Keep the last good ID rather than wiping a working setup. 166 257 $client_id = bitsaai_chatbot_get_settings()['client_id']; 167 258 } … … 179 270 $settings = bitsaai_chatbot_get_settings(); 180 271 printf( 181 '<input type="text" id="bitsaai_chatbot_client_id" name="%1$s[client_id]" value="%2$s" class="regular-text code" placeholder=" e.g. 64f1c2a9b3e4d5f6a7b8c9d0" autocomplete="off" />',272 '<input type="text" id="bitsaai_chatbot_client_id" name="%1$s[client_id]" value="%2$s" class="regular-text code" placeholder="%3$s" autocomplete="off" spellcheck="false" />', 182 273 esc_attr( BITSAAI_CHATBOT_OPTION ), 183 esc_attr( $settings['client_id'] ) 274 esc_attr( $settings['client_id'] ), 275 esc_attr__( 'e.g. 64f1c2a9b3e4d5f6a7b8c9d0', 'bitsa-ai-chatbot' ) 184 276 ); 185 277 echo '<p class="description">'; 186 printf( 187 /* translators: %s: link to the Bitsa AI dashboard */ 188 esc_html__( 'Find it in your %s under Branding → Embed code. You can paste the whole embed code here; the ID is picked out automatically.', 'bitsa-ai-chatbot' ), 189 '<a href="' . esc_url( BITSAAI_CHATBOT_DASHBOARD_URL ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Bitsa AI dashboard', 'bitsa-ai-chatbot' ) . '</a>' 278 echo wp_kses( 279 sprintf( 280 /* translators: %s: link to the Bitsa AI dashboard */ 281 esc_html__( 'Find it in your %s under Branding → Embed code. You can paste the whole embed code here; the ID is picked out automatically.', 'bitsa-ai-chatbot' ), 282 bitsaai_chatbot_external_link( BITSAAI_CHATBOT_DASHBOARD_URL, __( 'Bitsa AI dashboard', 'bitsa-ai-chatbot' ) ) 283 ), 284 bitsaai_chatbot_allowed_html() 190 285 ); 191 286 echo '</p>'; … … 200 295 '<label><input type="checkbox" name="%1$s[enabled]" value="1" %2$s /> %3$s</label>', 201 296 esc_attr( BITSAAI_CHATBOT_OPTION ), 202 checked( ! empty( $settings['enabled'] ), true, false ),297 checked( $settings['enabled'], true, false ), 203 298 esc_html__( 'Display the chatbot on the front end of this site', 'bitsa-ai-chatbot' ) 204 299 ); … … 213 308 __( 'Bitsa AI Chatbot', 'bitsa-ai-chatbot' ), 214 309 'manage_options', 215 'bitsaai-chatbot',310 BITSAAI_CHATBOT_PAGE, 216 311 'bitsaai_chatbot_render_settings_page', 217 312 'dashicons-format-chat', … … 220 315 } 221 316 add_action( 'admin_menu', 'bitsaai_chatbot_admin_menu' ); 317 318 /** 319 * One-line connection status for the top of the settings page. 320 */ 321 function bitsaai_chatbot_render_status() { 322 $settings = bitsaai_chatbot_get_settings(); 323 if ( '' === $settings['client_id'] ) { 324 $class = 'notice-warning'; 325 $text = __( 'Not connected yet. Complete the two steps below.', 'bitsa-ai-chatbot' ); 326 } elseif ( ! $settings['enabled'] ) { 327 $class = 'notice-info'; 328 $text = __( 'Connected, but the chatbot is switched off. Tick "Show chatbot" below to display it.', 'bitsa-ai-chatbot' ); 329 } else { 330 $class = 'notice-success'; 331 $text = __( 'Connected. The chatbot loads on your site as long as this domain is on your Bitsa AI whitelist.', 'bitsa-ai-chatbot' ); 332 } 333 printf( 334 '<div class="notice inline %1$s"><p><strong>%2$s</strong> %3$s</p></div>', 335 esc_attr( $class ), 336 esc_html__( 'Status:', 'bitsa-ai-chatbot' ), 337 esc_html( $text ) 338 ); 339 } 222 340 223 341 /** … … 236 354 settings_errors( BITSAAI_CHATBOT_OPTION ); 237 355 settings_errors( 'general' ); 356 bitsaai_chatbot_render_status(); 238 357 ?> 239 358 <p> … … 242 361 <p> 243 362 <?php 244 printf( 245 /* translators: %s: link to sign up for Bitsa AI */ 246 esc_html__( 'No account yet? %s (7-day free trial, no card required).', 'bitsa-ai-chatbot' ), 247 '<a href="' . esc_url( 'https://www.bitsaai.com/signup' ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Create one at bitsaai.com', 'bitsa-ai-chatbot' ) . '</a>' 363 echo wp_kses( 364 sprintf( 365 /* translators: %s: link to sign up for Bitsa AI */ 366 esc_html__( 'No account yet? %s (7-day free trial, no card required).', 'bitsa-ai-chatbot' ), 367 bitsaai_chatbot_external_link( BITSAAI_CHATBOT_SIGNUP_URL, __( 'Create one at bitsaai.com', 'bitsa-ai-chatbot' ) ) 368 ), 369 bitsaai_chatbot_allowed_html() 248 370 ); 249 371 ?> … … 261 383 <li> 262 384 <?php 263 printf( 264 /* translators: %s: link to the Domain Access page of the Bitsa AI dashboard */ 265 esc_html__( 'Log in to your Bitsa AI dashboard and open %s from the left menu.', 'bitsa-ai-chatbot' ), 266 '<a href="' . esc_url( BITSAAI_CHATBOT_DOMAINS_URL ) . '" target="_blank" rel="noopener noreferrer"><strong>' . esc_html__( 'Domain Access', 'bitsa-ai-chatbot' ) . '</strong></a>' 385 echo wp_kses( 386 sprintf( 387 /* translators: %s: link to the Domain Access page of the Bitsa AI dashboard */ 388 esc_html__( 'Log in to your Bitsa AI dashboard and open %s from the left menu.', 'bitsa-ai-chatbot' ), 389 '<strong>' . bitsaai_chatbot_external_link( BITSAAI_CHATBOT_DOMAINS_URL, __( 'Domain Access', 'bitsa-ai-chatbot' ) ) . '</strong>' 390 ), 391 bitsaai_chatbot_allowed_html() 267 392 ); 268 393 ?> … … 272 397 </ol> 273 398 <p class="description"> 274 <?php esc_html_e( 'Tips: enter only the domain, e.g. example.com (no https:// or www.). Adding example.com also covers www.example.com and every subdomain such as shop.example.com. A staging or local site with a different domain (e.g. mysite.local) needs its own entry. ', 'bitsa-ai-chatbot' ); ?>399 <?php esc_html_e( 'Tips: enter only the domain, e.g. example.com (no https:// or www.). Adding example.com also covers www.example.com and every subdomain such as shop.example.com. A staging or local site with a different domain (e.g. mysite.local) needs its own entry. If you use a page-cache or optimisation plugin, clear its cache after saving.', 'bitsa-ai-chatbot' ); ?> 275 400 </p> 276 401 … … 279 404 <?php 280 405 settings_fields( 'bitsaai_chatbot' ); 281 do_settings_sections( 'bitsaai-chatbot');406 do_settings_sections( BITSAAI_CHATBOT_PAGE ); 282 407 submit_button(); 283 408 ?> … … 294 419 */ 295 420 function bitsaai_chatbot_action_links( $links ) { 296 $url = admin_url( 'admin.php?page= bitsaai-chatbot');421 $url = admin_url( 'admin.php?page=' . BITSAAI_CHATBOT_PAGE ); 297 422 array_unshift( $links, '<a href="' . esc_url( $url ) . '">' . esc_html__( 'Settings', 'bitsa-ai-chatbot' ) . '</a>' ); 298 423 return $links; … … 301 426 302 427 /** 303 * Remind admins to finish setup until a Client ID is saved. 428 * Remind admins to finish setup until a Client ID is saved. Shown only on the 429 * Dashboard and Plugins screens, and dismissible, so it never nags elsewhere. 304 430 */ 305 431 function bitsaai_chatbot_setup_notice() { … … 308 434 } 309 435 $screen = get_current_screen(); 310 if ( $screen && 'toplevel_page_bitsaai-chatbot' === $screen->id) {436 if ( ! $screen || ! in_array( $screen->id, array( 'dashboard', 'plugins' ), true ) ) { 311 437 return; 312 438 } … … 314 440 return; 315 441 } 316 $url = admin_url( 'admin.php?page=bitsaai-chatbot' );317 442 printf( 318 '<div class="notice notice-info "><p>%1$s <a href="%2$s">%3$s</a></p></div>',443 '<div class="notice notice-info is-dismissible"><p>%1$s <a href="%2$s">%3$s</a></p></div>', 319 444 esc_html__( 'Bitsa AI Chatbot is almost ready.', 'bitsa-ai-chatbot' ), 320 esc_url( $url),445 esc_url( admin_url( 'admin.php?page=' . BITSAAI_CHATBOT_PAGE ) ), 321 446 esc_html__( 'Add your Client ID to switch it on.', 'bitsa-ai-chatbot' ) 322 447 ); 323 448 } 324 449 add_action( 'admin_notices', 'bitsaai_chatbot_setup_notice' ); 450 451 /** 452 * Suggest text for the site's privacy policy (Settings → Privacy → Policy Guide). 453 */ 454 function bitsaai_chatbot_privacy_policy_content() { 455 if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { 456 return; 457 } 458 $content = '<p>' . esc_html__( 'This site uses the Bitsa AI chatbot. When a visitor opens the chat, their messages, any contact details they choose to share (such as name, email address or phone number), the website domain, and standard technical data (IP address, browser user agent) are sent to Bitsa AI to generate replies and record enquiries for the site owner.', 'bitsa-ai-chatbot' ) . '</p>' 459 . '<p>' . wp_kses( 460 sprintf( 461 /* translators: %s: link to the Bitsa AI privacy policy */ 462 esc_html__( 'See the %s for how this data is handled.', 'bitsa-ai-chatbot' ), 463 bitsaai_chatbot_external_link( BITSAAI_CHATBOT_PRIVACY_URL, __( 'Bitsa AI privacy policy', 'bitsa-ai-chatbot' ) ) 464 ), 465 bitsaai_chatbot_allowed_html() 466 ) . '</p>'; 467 468 wp_add_privacy_policy_content( __( 'Bitsa AI Chatbot', 'bitsa-ai-chatbot' ), wp_kses_post( $content ) ); 469 } 470 add_action( 'admin_init', 'bitsaai_chatbot_privacy_policy_content' ); -
bitsa-ai-chatbot/tags/1.0.1/readme.txt
r3750149 r3750286 1 === Bitsa AI Chatbot – 24/7 AI Sales Assistant, Live Chat & Smart Lead Generation===1 === Bitsa AI Chatbot === 2 2 Contributors: sabitali 3 Donate link: https://www.bitsaai.com/4 3 Tags: chatbot, ai chatbot, customer support, live chat, lead generation 5 4 Requires at least: 5.0 6 5 Tested up to: 7.1 7 6 Requires PHP: 7.4 8 Stable tag: 1.0. 07 Stable tag: 1.0.1 9 8 License: GPLv2 or later 10 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 10 12 Autonomous 24/7 AI chatbot trained on your website content. Answers visitor queries instantly, captures qualified leads, and drives sales.11 24/7 AI chatbot and live chat trained on your website content. Answers visitor questions instantly and captures qualified leads. 13 12 14 13 == Description == 15 14 16 **Bitsa AI Chatbot** is a next-generation conversational AI assistant designed to turn casual website visitors into loyal customers. Powered by custom large language models, Bitsa AI learns your business inside and out—answering support queries in real time, capturing high-intent leads, and guiding shoppers toward purchasing decisionsaround the clock.15 **Bitsa AI Chatbot** is a conversational AI assistant that helps turn website visitors into customers. Bitsa AI learns your business from the content you give it, answers support questions in real time, captures high-intent leads, and guides shoppers toward a purchase around the clock. 17 16 18 Unlike traditional static rule-based bots that frustrate visitors with rigid menus, Bitsa AI understands natural human intent, context, and nuance. It answers queries directly from your approved knowledge base (website pages, FAQs, documentation, and product catalogs) with zero hallucinations.17 Unlike rule-based bots with rigid menus, Bitsa AI understands natural language, context and intent. It answers from your own approved knowledge base (website pages, FAQs, documentation and product catalogues) instead of generic internet content. 19 18 20 --- 19 = Key features = 21 20 22 ### 🚀 Key Features 21 * **Fast knowledge base setup:** Train your AI in minutes from your website URLs, sitemaps, PDFs, text documents or FAQs inside your Bitsa AI dashboard. 22 * **Lead capture and qualification:** Collect visitor names, phone numbers, email addresses and requirements inside the conversation, then hand warm leads to your sales team. 23 * **WooCommerce aware:** Helps shoppers discover products, check details and add items to their cart through the official WooCommerce Store API. 24 * **Multilingual, including Hinglish:** Understands and replies in 50+ languages, including English, Hindi and Hinglish. 25 * **Lightweight and non-blocking:** A single small loader (about 16 KB gzipped) loads asynchronously in the footer, and the chat window itself loads only after the page has finished loading or when a visitor reaches for the chat. It does not block page rendering. 26 * **Brand customisation:** Change the theme, launcher icon, welcome greeting and bubble position from your Bitsa AI dashboard without touching code. 27 * **Domain whitelisting:** Your chatbot only runs on domains you explicitly authorise, so nobody else can use your AI quota. 23 28 24 * **Instant Knowledge Base Ingestion:** Train your AI in minutes by connecting your website URLs, sitemaps, PDFs, text documents, or FAQs inside your Bitsa AI dashboard. 25 * **Autonomous Lead Capture & Qualification:** Collect visitor names, phone numbers, email addresses, and specific requirements right inside the conversation before handing warm leads to your sales team. 26 * **Seamless WooCommerce Intelligence:** WooCommerce-aware chatbot that helps shoppers discover products, checks stock/details, and allows visitors to add products directly to their cart via the official WooCommerce Store API. 27 * **True Multilingual & Hinglish Support:** Understands and replies naturally in over 50+ languages, including fluent English, Hindi, and natural Hinglish. 28 * **Asynchronous & Ultra-Lightweight:** Loads non-blockingly in your website footer (<15 KB footprint). Guaranteed zero impact on your Core Web Vitals, PageSpeed Insights, or SEO scores. 29 * **Full Brand Customization:** Tailor the chatbot theme, launcher icons, welcome greetings, and chat bubble position directly from your cloud dashboard without touching a single line of code. 30 * **Multi-Domain Whitelisting & Security:** Strict origin verification ensures your chatbot only runs on domains you explicitly authorize. 29 = Built for e-commerce and service businesses = 31 30 32 --- 31 Whether you run a WooCommerce store, a digital agency, a healthcare practice or a real estate consultancy, Bitsa AI acts as a 24/7 front desk. It handles repetitive customer questions automatically and routes high-value prospects straight into your pipeline. 33 32 34 ### 🛒 Built for E-Commerce & Service Businesses 33 = How it works = 35 34 36 Whether you run a high-volume WooCommerce store, a digital agency, a healthcare practice, or a real estate consultancy, Bitsa AI acts as your dedicated 24/7 front-desk executive. It resolves up to 80% of repetitive customer support inquiries automatically and routes high-value sales prospects straight into your pipeline.35 This plugin is a lightweight connector between your WordPress site and your Bitsa AI dashboard. AI responses, knowledge base training and lead management run on Bitsa AI's cloud service. 37 36 38 --- 37 A Bitsa AI account is required. Every new account includes a **7-day free trial** (no credit card required). Paid plans start at ₹299/month. See [Bitsa AI Pricing](https://www.bitsaai.com/chatbot-pricing-india/). 39 38 40 ### ⚙️ How It Works 39 = For developers = 41 40 42 This plugin serves as a secure, lightweight connector between your WordPress site and your Bitsa AI cloud dashboard. The AI inference, knowledge base training, and lead management are handled on Bitsa AI's optimized cloud infrastructure. 41 Hide the chatbot on specific pages with the `bitsaai_chatbot_load_widget` filter: 43 42 44 A Bitsa AI account is required. Every new account includes an unrestricted **7-day free trial** (no credit card required). Affordable paid plans start at just ₹299/month. Explore plans at [Bitsa AI Pricing](https://www.bitsaai.com/chatbot-pricing-india/). 45 46 --- 43 `add_filter( 'bitsaai_chatbot_load_widget', function ( $load ) { return is_checkout() ? false : $load; } );` 47 44 48 45 == External services == 49 46 50 This plugin securely connects your WordPress website to the Bitsa AI cloud service to deliver conversational AI and live chat capabilities. No external scripts or styles are loaded until you input and save your authorized Client ID in the plugin settings.47 This plugin connects your website to the Bitsa AI cloud service to provide the chatbot. Nothing is loaded from Bitsa AI until you save a Client ID in the plugin settings, and nothing is loaded while the "Show chatbot" option is switched off. 51 48 52 1. **Bitsa AI Embed Widget (`www.bitsaai.com`)** 53 * **Purpose:** Delivers the chat launcher interface and real-time messaging UI to front-end visitors. 49 1. **Bitsa AI embed widget (`www.bitsaai.com`)** 50 * **Purpose:** Delivers the chat launcher and chat window to visitors on the front end of your site. 51 * **When:** On every front-end page view once a Client ID is saved and the chatbot is switched on. 54 52 * **Script URL:** `https://www.bitsaai.com/embed-snippet.js` 55 * **Chat FrameURL:** `https://www.bitsaai.com/embed/`56 * **Data Transmitted:** Your account Client ID, browser technical metadata (standard IP address and user-agent string for session persistence), and visitor chat messages (including name, email, or contact number if voluntarily provided).53 * **Chat window URL:** `https://www.bitsaai.com/embed/` 54 * **Data sent:** Your Client ID, your website's domain (to check it against your whitelist), and standard request data any web request carries (visitor IP address and browser user agent). 57 55 58 2. **Bitsa AI Inference & Orchestration API (`production-backend-w1e8.onrender.com`)** 59 * **Purpose:** Processes incoming user queries against your trained knowledge base, generates conversational responses, and logs captured leads in your dashboard. 60 * **Data Transmitted:** Client ID and chat conversational text. 56 2. **Bitsa AI chat API (`production-backend-w1e8.onrender.com`)** 57 * **Purpose:** Loads your chatbot's branding, answers visitor questions from your knowledge base, and records captured leads in your dashboard. 58 * **When:** When the widget loads and whenever a visitor uses the chat. 59 * **Data sent:** Your Client ID, your website's domain, the visitor's chat messages, and any contact details the visitor chooses to share (such as name, email address or phone number), plus the visitor's IP address and browser user agent. 61 60 62 3. ** LocalWooCommerce Store API**63 * For WooCommerce stores, cart operations requested by visitors are executed directly against your own website's native REST API (`/wp-json/wc/store/v1/`). Customer purchase data remains strictly within your WordPress installation.61 3. **Your own WooCommerce Store API** 62 * On WooCommerce stores, cart actions a visitor asks for are sent to your own site's REST API (`/wp-json/wc/store/v1/`), not to Bitsa AI. 64 63 65 * **Privacy Policy:** [https://www.bitsaai.com/privacy/](https://www.bitsaai.com/privacy/) 66 * **Terms of Service:** [https://www.bitsaai.com/terms/](https://www.bitsaai.com/terms/) 64 Bitsa AI [Privacy Policy](https://www.bitsaai.com/privacy/) and [Terms of Service](https://www.bitsaai.com/terms/). 67 65 68 --- 66 The plugin also adds suggested text to your site's privacy policy guide (Settings → Privacy → Policy Guide). 69 67 70 68 == Installation == 71 69 72 Setting up Bitsa AI Chatbot requires zero coding knowledge and takes less than 2 minutes: 70 1. In your WordPress admin, go to **Plugins → Add New**. 71 2. Search for `Bitsa AI Chatbot`, click **Install Now**, then **Activate**. 72 3. Create a free account or log in at [bitsaai.com](https://www.bitsaai.com/signup). 73 4. In the Bitsa AI dashboard, open **Knowledge Base** and train your AI on your website content or documents. 74 5. Under **Domain Access**, add your website's domain (e.g. `example.com`, without `https://`). 75 6. Open **Branding → Embed code** and copy your **Client ID**. 76 7. In WordPress, click **Bitsa AI Chatbot** in the left menu, paste your Client ID and click **Save Changes**. 73 77 74 1. In your WordPress Admin, navigate to **Plugins → Add New**. 75 2. Search for `Bitsa AI Chatbot`, click **Install Now**, and then **Activate**. 76 3. Create your free account or log in at [Bitsa AI Dashboard](https://www.bitsaai.com/signup). 77 4. In the Bitsa AI dashboard, go to **Knowledge Base** to train your AI on your website content or documents. 78 5. Under **Domain Access**, add your website's domain name (e.g., `example.com` without `https://`). 79 6. Navigate to **Branding → Embed code** and copy your unique **Client ID**. 80 7. In your WordPress admin, click on **Bitsa AI Chatbot** in the left menu, paste your Client ID, and click **Save Changes**. 81 82 Your intelligent assistant is now live on your site! 83 84 --- 78 Your assistant is now live on your site. 85 79 86 80 == Frequently Asked Questions == 87 81 88 = Do I need an account with Bitsa AI to use this plugin? = 89 Yes. The plugin connects your WordPress frontend to your custom-trained Bitsa AI brain. You can sign up at [bitsaai.com](https://www.bitsaai.com/) in 30 seconds for a full 7-day free trial without entering payment details. 82 = Do I need a Bitsa AI account to use this plugin? = 83 84 Yes. The plugin connects your site to your Bitsa AI chatbot. You can sign up at [bitsaai.com](https://www.bitsaai.com/) for a 7-day free trial without entering payment details. 90 85 91 86 = Where do I find my Client ID? = 92 Log in to your Bitsa AI dashboard, go to **Branding → Embed code**, and copy the Client ID. You can also paste the entire `<script>` embed snippet into the plugin settings; the plugin will automatically extract your Client ID. 87 88 Log in to your Bitsa AI dashboard, go to **Branding → Embed code** and copy the Client ID. You can also paste the entire `<script>` embed code into the plugin settings; the plugin picks out the Client ID automatically. 93 89 94 90 = I saved my Client ID, but the chat bubble does not appear. Why? = 95 For enterprise security, Bitsa AI enforces strict domain whitelisting to prevent unauthorized third parties from using your AI quota. Open your Bitsa AI dashboard, click **Domain Access**, and add your domain (e.g., `yourwebsite.com`). Whitelisting `yourwebsite.com` automatically authorizes all subdomains including `www.yourwebsite.com`.96 91 97 = Can Bitsa AI understand and respond in Hindi or Hinglish? = 98 Yes! Bitsa AI natively supports Hindi, Hinglish (Hindi written in Latin script), and over 50 global languages. It automatically detects the language your visitor uses and responds fluently in that same language. 92 Bitsa AI only shows your chatbot on domains you have whitelisted, so that nobody else can use your AI quota. Open your Bitsa AI dashboard, click **Domain Access** and add your domain (e.g. `yourwebsite.com`). Whitelisting `yourwebsite.com` also covers `www.yourwebsite.com` and every subdomain. If you use a caching or optimisation plugin, clear its cache afterwards. 93 94 = Can Bitsa AI respond in Hindi or Hinglish? = 95 96 Yes. Bitsa AI supports Hindi, Hinglish (Hindi written in Latin script) and 50+ other languages. It detects the language your visitor uses and replies in the same language. 99 97 100 98 = Can the chatbot help customers on my WooCommerce store? = 101 Absolutely. When active on a WooCommerce store, Bitsa AI can answer product queries, help shoppers find relevant items, and assist with adding items directly to their shopping cart via native WooCommerce endpoints.102 99 103 = Will Bitsa AI slow down my website loading time? = 104 No. The Bitsa AI script loads 100% asynchronously at the bottom of the page footer. It never blocks DOM construction, CSS parsing, or page rendering. 100 Yes. On a WooCommerce store, Bitsa AI can answer product questions, help shoppers find items and add products to their cart through WooCommerce's own Store API. 105 101 106 = How do I customize the chatbot appearance (colors, avatar, greeting)? = 107 All visual branding is managed centrally inside your Bitsa AI cloud dashboard. Any updates you make to colors, launcher position, welcome messages, or bot avatar reflect instantly on your WordPress site without requiring plugin updates. 102 = Will Bitsa AI slow down my website? = 108 103 109 = Can I temporarily disable the chatbot on my site? = 110 Yes. You can uncheck the "Show chatbot" checkbox on the Bitsa AI Chatbot settings page and click Save Changes, or simply deactivate the plugin. 104 The loader script is small and loads asynchronously in the footer, so it does not block page rendering, and the chat window loads only after the page has finished loading. As with any third-party widget, we recommend checking your own pages with PageSpeed Insights after installing. 111 105 112 --- 106 = How do I customise the chatbot's appearance (colours, avatar, greeting)? = 107 108 All branding is managed in your Bitsa AI dashboard. Changes to colours, launcher position, welcome message or avatar appear on your WordPress site automatically, with no plugin update needed. 109 110 = Can I temporarily disable the chatbot? = 111 112 Yes. Untick **Show chatbot** on the Bitsa AI Chatbot settings page and click **Save Changes**, or deactivate the plugin. 113 114 = Can I hide the chatbot on certain pages? = 115 116 Yes. Use the `bitsaai_chatbot_load_widget` filter shown in the "For developers" section above. 117 118 = What happens to my settings when I delete the plugin? = 119 120 Deleting the plugin from the Plugins screen removes its saved settings, including on every site of a multisite network. 113 121 114 122 == Screenshots == 115 123 116 1. The intelligent Bitsa AI assistant interacting with a visitor in real-time. 117 2. Clean, single-click WordPress settings panel for instant Client ID activation. 118 119 --- 124 1. The Bitsa AI chatbot answering a visitor's question on a WordPress site. 125 2. The plugin settings page: whitelist your domain, paste your Client ID and you are connected. 120 126 121 127 == Changelog == 122 128 129 = 1.0.1 = 130 * Improved: The widget now uses WordPress's native async script loading (WordPress 6.3+) and no longer adds an unused version query string to the script URL. 131 * Improved: Script attributes are added with the WordPress HTML API, which is more robust with optimisation plugins. Added compatibility with Cloudflare Rocket Loader. 132 * Improved: The setup reminder now appears only on the Dashboard and Plugins screens and can be dismissed. 133 * Improved: Settings page shows the connection status. 134 * New: `bitsaai_chatbot_load_widget` filter to hide the chatbot on specific pages. 135 * New: Suggested privacy policy text under Settings → Privacy. 136 * Fixed: Settings are now removed from every site when the plugin is deleted on a multisite network. 137 * Hardening: Stricter validation of saved settings and stricter escaping of admin links. 138 123 139 = 1.0.0 = 124 * Initial official release on the WordPress Plugin Directory. 125 * Added seamless Client ID integration. 126 * Added native WooCommerce Store API cart support. 127 * Added asynchronous non-blocking script loader. 140 * Initial release on the WordPress Plugin Directory. 141 * Connect your site with a Client ID (or by pasting the whole embed code). 142 * Asynchronous, non-blocking widget loader. 143 144 == Upgrade Notice == 145 146 = 1.0.1 = 147 Faster native async loading, a dismissible setup reminder, a new filter to hide the chatbot on specific pages, and multisite cleanup on delete. -
bitsa-ai-chatbot/tags/1.0.1/uninstall.php
r3750113 r3750286 10 10 } 11 11 12 delete_option( 'bitsaai_chatbot_settings' ); 12 if ( is_multisite() && function_exists( 'get_sites' ) ) { 13 // A network-activated plugin stores its settings on every site. 14 $bitsaai_site_ids = get_sites( 15 array( 16 'fields' => 'ids', 17 'number' => 0, 18 ) 19 ); 20 foreach ( $bitsaai_site_ids as $bitsaai_site_id ) { 21 switch_to_blog( $bitsaai_site_id ); 22 delete_option( 'bitsaai_chatbot_settings' ); 23 restore_current_blog(); 24 } 25 } else { 26 delete_option( 'bitsaai_chatbot_settings' ); 27 } -
bitsa-ai-chatbot/trunk/bitsa-ai-chatbot.php
r3750113 r3750286 4 4 * Plugin URI: https://www.bitsaai.com/wordpress-ai-chatbot-plugin/ 5 5 * Description: Add your Bitsa AI chatbot to every page of your site. It answers visitor questions 24/7 from your own content and captures leads. Paste your Client ID under Bitsa AI Chatbot in the admin menu. 6 * Version: 1.0. 06 * Version: 1.0.1 7 7 * Requires at least: 5.0 8 8 * Requires PHP: 7.4 … … 12 12 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 13 13 * Text Domain: bitsa-ai-chatbot 14 * 15 * @package Bitsa_AI_Chatbot 14 16 */ 15 17 … … 18 20 } 19 21 20 define( 'BITSAAI_CHATBOT_VERSION', '1.0. 0' );22 define( 'BITSAAI_CHATBOT_VERSION', '1.0.1' ); 21 23 define( 'BITSAAI_CHATBOT_OPTION', 'bitsaai_chatbot_settings' ); 24 define( 'BITSAAI_CHATBOT_HANDLE', 'bitsaai-chatbot' ); 25 define( 'BITSAAI_CHATBOT_PAGE', 'bitsaai-chatbot' ); 22 26 define( 'BITSAAI_CHATBOT_SNIPPET_URL', 'https://www.bitsaai.com/embed-snippet.js' ); 27 define( 'BITSAAI_CHATBOT_SIGNUP_URL', 'https://www.bitsaai.com/signup' ); 23 28 define( 'BITSAAI_CHATBOT_DASHBOARD_URL', 'https://www.bitsaai.com/login' ); 24 29 define( 'BITSAAI_CHATBOT_DOMAINS_URL', 'https://www.bitsaai.com/client/domains' ); 30 define( 'BITSAAI_CHATBOT_PRIVACY_URL', 'https://www.bitsaai.com/privacy/' ); 25 31 26 32 /** … … 31 37 */ 32 38 function bitsaai_chatbot_site_domain() { 33 $host = wp_parse_url( home_url(), PHP_URL_HOST ); 34 $host = strtolower( (string) $host ); 39 $host = strtolower( (string) wp_parse_url( home_url(), PHP_URL_HOST ) ); 35 40 if ( 0 === strpos( $host, 'www.' ) ) { 36 41 $host = substr( $host, 4 ); … … 40 45 41 46 /** 42 * Saved settings merged with defaults. 47 * Saved settings merged with defaults and cast to their expected types, so a 48 * hand-edited or corrupted option can never reach the page as something else. 43 49 * 44 50 * @return array{client_id: string, enabled: bool} … … 46 52 function bitsaai_chatbot_get_settings() { 47 53 $saved = get_option( BITSAAI_CHATBOT_OPTION, array() ); 48 return wp_parse_args( 49 is_array( $saved ) ? $saved : array(), 50 array( 51 'client_id' => '', 52 'enabled' => true, 53 ) 54 $saved = is_array( $saved ) ? $saved : array(); 55 56 return array( 57 'client_id' => isset( $saved['client_id'] ) ? bitsaai_chatbot_extract_client_id( $saved['client_id'] ) : '', 58 'enabled' => isset( $saved['enabled'] ) ? (bool) $saved['enabled'] : true, 54 59 ); 55 60 } … … 59 64 * embed code copied from the Bitsa AI dashboard. 60 65 * 61 * @param string$raw Pasted value.66 * @param mixed $raw Pasted value. 62 67 * @return string 24-character Client ID, or '' if none found. 63 68 */ 64 69 function bitsaai_chatbot_extract_client_id( $raw ) { 70 if ( ! is_scalar( $raw ) ) { 71 return ''; 72 } 65 73 if ( preg_match( '/\b([a-f0-9]{24})\b/i', (string) $raw, $m ) ) { 66 74 return strtolower( $m[1] ); … … 69 77 } 70 78 71 /* ------------------------------------------------------------------------- 79 /** 80 * HTML allowed in translatable admin strings that embed a link. 81 * 82 * @return array 83 */ 84 function bitsaai_chatbot_allowed_html() { 85 return array( 86 'a' => array( 87 'href' => true, 88 'target' => true, 89 'rel' => true, 90 ), 91 'strong' => array(), 92 ); 93 } 94 95 /** 96 * Markup for a link that opens the Bitsa AI dashboard in a new tab. 97 * 98 * @param string $url Destination. 99 * @param string $text Link text (unescaped). 100 * @return string 101 */ 102 function bitsaai_chatbot_external_link( $url, $text ) { 103 return '<a href="' . esc_url( $url ) . '" target="_blank" rel="noopener noreferrer">' . esc_html( $text ) . '</a>'; 104 } 105 106 /* 72 107 * Front end: load the widget. 73 * ---------------------------------------------------------------------- */108 */ 74 109 75 110 /** … … 78 113 function bitsaai_chatbot_enqueue() { 79 114 $settings = bitsaai_chatbot_get_settings(); 80 if ( empty( $settings['enabled'] ) || '' === $settings['client_id'] ) { 81 return; 82 } 83 wp_enqueue_script( 'bitsaai-chatbot', BITSAAI_CHATBOT_SNIPPET_URL, array(), BITSAAI_CHATBOT_VERSION, true ); 115 if ( ! $settings['enabled'] || '' === $settings['client_id'] ) { 116 return; 117 } 118 119 /** 120 * Filters whether the chatbot loads on the current request. Return false to 121 * hide it on specific pages, e.g. checkout or a landing page. 122 * 123 * @param bool $load Whether to load the widget. Default true. 124 */ 125 if ( ! apply_filters( 'bitsaai_chatbot_load_widget', true ) ) { 126 return; 127 } 128 129 // The snippet URL is unversioned on our side, so no ?ver= is appended. The 130 // array form gives native async on WP 6.3+; older versions read it as 131 // in_footer = true and the async attribute is added in the tag filter below. 132 wp_enqueue_script( 133 BITSAAI_CHATBOT_HANDLE, 134 BITSAAI_CHATBOT_SNIPPET_URL, 135 array(), 136 null, // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion -- remote file, versioned by the service. 137 array( 138 'in_footer' => true, 139 'strategy' => 'async', 140 ) 141 ); 84 142 } 85 143 add_action( 'wp_enqueue_scripts', 'bitsaai_chatbot_enqueue' ); 86 144 87 145 /** 88 * Add the async flag and thedata attributes the loader reads to our script tag only.146 * Add the data attributes the loader reads to our script tag only. 89 147 * 90 148 * @param string $tag Script tag HTML. … … 93 151 */ 94 152 function bitsaai_chatbot_script_tag( $tag, $handle ) { 95 if ( 'bitsaai-chatbot'!== $handle ) {153 if ( BITSAAI_CHATBOT_HANDLE !== $handle ) { 96 154 return $tag; 97 155 } 98 $settings = bitsaai_chatbot_get_settings(); 99 $attrs = sprintf( 100 ' data-client-id="%s" data-mode="ai" async', 101 esc_attr( $settings['client_id'] ) 102 ); 103 return str_replace( ' src=', $attrs . ' src=', $tag ); 156 $client_id = bitsaai_chatbot_get_settings()['client_id']; 157 if ( '' === $client_id ) { 158 return $tag; 159 } 160 $script_id = BITSAAI_CHATBOT_HANDLE . '-js'; 161 162 // WP 6.2+: edit the tag with the HTML API instead of string surgery, so 163 // before/after inline scripts and attribute quoting styles don't matter. 164 if ( class_exists( 'WP_HTML_Tag_Processor' ) ) { 165 $processor = new WP_HTML_Tag_Processor( $tag ); 166 while ( $processor->next_tag( 'script' ) ) { 167 if ( $script_id !== $processor->get_attribute( 'id' ) ) { 168 continue; 169 } 170 $processor->set_attribute( 'data-client-id', $client_id ); 171 $processor->set_attribute( 'data-mode', 'ai' ); 172 // Keep Cloudflare Rocket Loader from rewriting the tag: the loader needs 173 // document.currentScript to read its data attributes. 174 $processor->set_attribute( 'data-cfasync', 'false' ); 175 $processor->set_attribute( 'async', true ); 176 return $processor->get_updated_html(); 177 } 178 return $tag; 179 } 180 181 $attrs = sprintf( 182 ' data-client-id="%s" data-mode="ai" data-cfasync="false"%s', 183 esc_attr( $client_id ), 184 preg_match( '/\sasync\b/i', $tag ) ? '' : ' async' 185 ); 186 return (string) preg_replace( 187 '/<script\b(?=[^>]*\bid=["\']' . preg_quote( $script_id, '/' ) . '["\'])/i', 188 '<script' . $attrs, 189 $tag, 190 1 191 ); 104 192 } 105 193 add_filter( 'script_loader_tag', 'bitsaai_chatbot_script_tag', 10, 2 ); 106 194 107 /* -------------------------------------------------------------------------195 /* 108 196 * Admin: settings page. 109 * ---------------------------------------------------------------------- */197 */ 110 198 111 199 /** … … 119 207 'type' => 'array', 120 208 'sanitize_callback' => 'bitsaai_chatbot_sanitize_settings', 209 'show_in_rest' => false, 121 210 'default' => array( 122 211 'client_id' => '', … … 126 215 ); 127 216 128 add_settings_section( 'bitsaai_chatbot_main', '', '__return_false', 'bitsaai-chatbot');217 add_settings_section( 'bitsaai_chatbot_main', '', '__return_false', BITSAAI_CHATBOT_PAGE ); 129 218 130 219 add_settings_field( … … 132 221 __( 'Client ID', 'bitsa-ai-chatbot' ), 133 222 'bitsaai_chatbot_field_client_id', 134 'bitsaai-chatbot',223 BITSAAI_CHATBOT_PAGE, 135 224 'bitsaai_chatbot_main', 136 225 array( 'label_for' => 'bitsaai_chatbot_client_id' ) … … 141 230 __( 'Show chatbot', 'bitsa-ai-chatbot' ), 142 231 'bitsaai_chatbot_field_enabled', 143 'bitsaai-chatbot',232 BITSAAI_CHATBOT_PAGE, 144 233 'bitsaai_chatbot_main' 145 234 ); … … 156 245 $input = is_array( $input ) ? $input : array(); 157 246 $raw_id = isset( $input['client_id'] ) ? wp_unslash( $input['client_id'] ) : ''; 247 $raw_id = is_scalar( $raw_id ) ? trim( (string) $raw_id ) : null; // null: malformed request. 158 248 $client_id = bitsaai_chatbot_extract_client_id( $raw_id ); 159 249 160 if ( '' !== trim( (string) $raw_id )&& '' === $client_id ) {250 if ( '' !== $raw_id && '' === $client_id ) { 161 251 add_settings_error( 162 252 BITSAAI_CHATBOT_OPTION, … … 164 254 __( 'That does not look like a Bitsa AI Client ID. Copy it from Branding → Embed code in your Bitsa AI dashboard.', 'bitsa-ai-chatbot' ) 165 255 ); 256 // Keep the last good ID rather than wiping a working setup. 166 257 $client_id = bitsaai_chatbot_get_settings()['client_id']; 167 258 } … … 179 270 $settings = bitsaai_chatbot_get_settings(); 180 271 printf( 181 '<input type="text" id="bitsaai_chatbot_client_id" name="%1$s[client_id]" value="%2$s" class="regular-text code" placeholder=" e.g. 64f1c2a9b3e4d5f6a7b8c9d0" autocomplete="off" />',272 '<input type="text" id="bitsaai_chatbot_client_id" name="%1$s[client_id]" value="%2$s" class="regular-text code" placeholder="%3$s" autocomplete="off" spellcheck="false" />', 182 273 esc_attr( BITSAAI_CHATBOT_OPTION ), 183 esc_attr( $settings['client_id'] ) 274 esc_attr( $settings['client_id'] ), 275 esc_attr__( 'e.g. 64f1c2a9b3e4d5f6a7b8c9d0', 'bitsa-ai-chatbot' ) 184 276 ); 185 277 echo '<p class="description">'; 186 printf( 187 /* translators: %s: link to the Bitsa AI dashboard */ 188 esc_html__( 'Find it in your %s under Branding → Embed code. You can paste the whole embed code here; the ID is picked out automatically.', 'bitsa-ai-chatbot' ), 189 '<a href="' . esc_url( BITSAAI_CHATBOT_DASHBOARD_URL ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Bitsa AI dashboard', 'bitsa-ai-chatbot' ) . '</a>' 278 echo wp_kses( 279 sprintf( 280 /* translators: %s: link to the Bitsa AI dashboard */ 281 esc_html__( 'Find it in your %s under Branding → Embed code. You can paste the whole embed code here; the ID is picked out automatically.', 'bitsa-ai-chatbot' ), 282 bitsaai_chatbot_external_link( BITSAAI_CHATBOT_DASHBOARD_URL, __( 'Bitsa AI dashboard', 'bitsa-ai-chatbot' ) ) 283 ), 284 bitsaai_chatbot_allowed_html() 190 285 ); 191 286 echo '</p>'; … … 200 295 '<label><input type="checkbox" name="%1$s[enabled]" value="1" %2$s /> %3$s</label>', 201 296 esc_attr( BITSAAI_CHATBOT_OPTION ), 202 checked( ! empty( $settings['enabled'] ), true, false ),297 checked( $settings['enabled'], true, false ), 203 298 esc_html__( 'Display the chatbot on the front end of this site', 'bitsa-ai-chatbot' ) 204 299 ); … … 213 308 __( 'Bitsa AI Chatbot', 'bitsa-ai-chatbot' ), 214 309 'manage_options', 215 'bitsaai-chatbot',310 BITSAAI_CHATBOT_PAGE, 216 311 'bitsaai_chatbot_render_settings_page', 217 312 'dashicons-format-chat', … … 220 315 } 221 316 add_action( 'admin_menu', 'bitsaai_chatbot_admin_menu' ); 317 318 /** 319 * One-line connection status for the top of the settings page. 320 */ 321 function bitsaai_chatbot_render_status() { 322 $settings = bitsaai_chatbot_get_settings(); 323 if ( '' === $settings['client_id'] ) { 324 $class = 'notice-warning'; 325 $text = __( 'Not connected yet. Complete the two steps below.', 'bitsa-ai-chatbot' ); 326 } elseif ( ! $settings['enabled'] ) { 327 $class = 'notice-info'; 328 $text = __( 'Connected, but the chatbot is switched off. Tick "Show chatbot" below to display it.', 'bitsa-ai-chatbot' ); 329 } else { 330 $class = 'notice-success'; 331 $text = __( 'Connected. The chatbot loads on your site as long as this domain is on your Bitsa AI whitelist.', 'bitsa-ai-chatbot' ); 332 } 333 printf( 334 '<div class="notice inline %1$s"><p><strong>%2$s</strong> %3$s</p></div>', 335 esc_attr( $class ), 336 esc_html__( 'Status:', 'bitsa-ai-chatbot' ), 337 esc_html( $text ) 338 ); 339 } 222 340 223 341 /** … … 236 354 settings_errors( BITSAAI_CHATBOT_OPTION ); 237 355 settings_errors( 'general' ); 356 bitsaai_chatbot_render_status(); 238 357 ?> 239 358 <p> … … 242 361 <p> 243 362 <?php 244 printf( 245 /* translators: %s: link to sign up for Bitsa AI */ 246 esc_html__( 'No account yet? %s (7-day free trial, no card required).', 'bitsa-ai-chatbot' ), 247 '<a href="' . esc_url( 'https://www.bitsaai.com/signup' ) . '" target="_blank" rel="noopener noreferrer">' . esc_html__( 'Create one at bitsaai.com', 'bitsa-ai-chatbot' ) . '</a>' 363 echo wp_kses( 364 sprintf( 365 /* translators: %s: link to sign up for Bitsa AI */ 366 esc_html__( 'No account yet? %s (7-day free trial, no card required).', 'bitsa-ai-chatbot' ), 367 bitsaai_chatbot_external_link( BITSAAI_CHATBOT_SIGNUP_URL, __( 'Create one at bitsaai.com', 'bitsa-ai-chatbot' ) ) 368 ), 369 bitsaai_chatbot_allowed_html() 248 370 ); 249 371 ?> … … 261 383 <li> 262 384 <?php 263 printf( 264 /* translators: %s: link to the Domain Access page of the Bitsa AI dashboard */ 265 esc_html__( 'Log in to your Bitsa AI dashboard and open %s from the left menu.', 'bitsa-ai-chatbot' ), 266 '<a href="' . esc_url( BITSAAI_CHATBOT_DOMAINS_URL ) . '" target="_blank" rel="noopener noreferrer"><strong>' . esc_html__( 'Domain Access', 'bitsa-ai-chatbot' ) . '</strong></a>' 385 echo wp_kses( 386 sprintf( 387 /* translators: %s: link to the Domain Access page of the Bitsa AI dashboard */ 388 esc_html__( 'Log in to your Bitsa AI dashboard and open %s from the left menu.', 'bitsa-ai-chatbot' ), 389 '<strong>' . bitsaai_chatbot_external_link( BITSAAI_CHATBOT_DOMAINS_URL, __( 'Domain Access', 'bitsa-ai-chatbot' ) ) . '</strong>' 390 ), 391 bitsaai_chatbot_allowed_html() 267 392 ); 268 393 ?> … … 272 397 </ol> 273 398 <p class="description"> 274 <?php esc_html_e( 'Tips: enter only the domain, e.g. example.com (no https:// or www.). Adding example.com also covers www.example.com and every subdomain such as shop.example.com. A staging or local site with a different domain (e.g. mysite.local) needs its own entry. ', 'bitsa-ai-chatbot' ); ?>399 <?php esc_html_e( 'Tips: enter only the domain, e.g. example.com (no https:// or www.). Adding example.com also covers www.example.com and every subdomain such as shop.example.com. A staging or local site with a different domain (e.g. mysite.local) needs its own entry. If you use a page-cache or optimisation plugin, clear its cache after saving.', 'bitsa-ai-chatbot' ); ?> 275 400 </p> 276 401 … … 279 404 <?php 280 405 settings_fields( 'bitsaai_chatbot' ); 281 do_settings_sections( 'bitsaai-chatbot');406 do_settings_sections( BITSAAI_CHATBOT_PAGE ); 282 407 submit_button(); 283 408 ?> … … 294 419 */ 295 420 function bitsaai_chatbot_action_links( $links ) { 296 $url = admin_url( 'admin.php?page= bitsaai-chatbot');421 $url = admin_url( 'admin.php?page=' . BITSAAI_CHATBOT_PAGE ); 297 422 array_unshift( $links, '<a href="' . esc_url( $url ) . '">' . esc_html__( 'Settings', 'bitsa-ai-chatbot' ) . '</a>' ); 298 423 return $links; … … 301 426 302 427 /** 303 * Remind admins to finish setup until a Client ID is saved. 428 * Remind admins to finish setup until a Client ID is saved. Shown only on the 429 * Dashboard and Plugins screens, and dismissible, so it never nags elsewhere. 304 430 */ 305 431 function bitsaai_chatbot_setup_notice() { … … 308 434 } 309 435 $screen = get_current_screen(); 310 if ( $screen && 'toplevel_page_bitsaai-chatbot' === $screen->id) {436 if ( ! $screen || ! in_array( $screen->id, array( 'dashboard', 'plugins' ), true ) ) { 311 437 return; 312 438 } … … 314 440 return; 315 441 } 316 $url = admin_url( 'admin.php?page=bitsaai-chatbot' );317 442 printf( 318 '<div class="notice notice-info "><p>%1$s <a href="%2$s">%3$s</a></p></div>',443 '<div class="notice notice-info is-dismissible"><p>%1$s <a href="%2$s">%3$s</a></p></div>', 319 444 esc_html__( 'Bitsa AI Chatbot is almost ready.', 'bitsa-ai-chatbot' ), 320 esc_url( $url),445 esc_url( admin_url( 'admin.php?page=' . BITSAAI_CHATBOT_PAGE ) ), 321 446 esc_html__( 'Add your Client ID to switch it on.', 'bitsa-ai-chatbot' ) 322 447 ); 323 448 } 324 449 add_action( 'admin_notices', 'bitsaai_chatbot_setup_notice' ); 450 451 /** 452 * Suggest text for the site's privacy policy (Settings → Privacy → Policy Guide). 453 */ 454 function bitsaai_chatbot_privacy_policy_content() { 455 if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) { 456 return; 457 } 458 $content = '<p>' . esc_html__( 'This site uses the Bitsa AI chatbot. When a visitor opens the chat, their messages, any contact details they choose to share (such as name, email address or phone number), the website domain, and standard technical data (IP address, browser user agent) are sent to Bitsa AI to generate replies and record enquiries for the site owner.', 'bitsa-ai-chatbot' ) . '</p>' 459 . '<p>' . wp_kses( 460 sprintf( 461 /* translators: %s: link to the Bitsa AI privacy policy */ 462 esc_html__( 'See the %s for how this data is handled.', 'bitsa-ai-chatbot' ), 463 bitsaai_chatbot_external_link( BITSAAI_CHATBOT_PRIVACY_URL, __( 'Bitsa AI privacy policy', 'bitsa-ai-chatbot' ) ) 464 ), 465 bitsaai_chatbot_allowed_html() 466 ) . '</p>'; 467 468 wp_add_privacy_policy_content( __( 'Bitsa AI Chatbot', 'bitsa-ai-chatbot' ), wp_kses_post( $content ) ); 469 } 470 add_action( 'admin_init', 'bitsaai_chatbot_privacy_policy_content' ); -
bitsa-ai-chatbot/trunk/readme.txt
r3750149 r3750286 1 === Bitsa AI Chatbot – 24/7 AI Sales Assistant, Live Chat & Smart Lead Generation===1 === Bitsa AI Chatbot === 2 2 Contributors: sabitali 3 Donate link: https://www.bitsaai.com/4 3 Tags: chatbot, ai chatbot, customer support, live chat, lead generation 5 4 Requires at least: 5.0 6 5 Tested up to: 7.1 7 6 Requires PHP: 7.4 8 Stable tag: 1.0. 07 Stable tag: 1.0.1 9 8 License: GPLv2 or later 10 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 11 10 12 Autonomous 24/7 AI chatbot trained on your website content. Answers visitor queries instantly, captures qualified leads, and drives sales.11 24/7 AI chatbot and live chat trained on your website content. Answers visitor questions instantly and captures qualified leads. 13 12 14 13 == Description == 15 14 16 **Bitsa AI Chatbot** is a next-generation conversational AI assistant designed to turn casual website visitors into loyal customers. Powered by custom large language models, Bitsa AI learns your business inside and out—answering support queries in real time, capturing high-intent leads, and guiding shoppers toward purchasing decisionsaround the clock.15 **Bitsa AI Chatbot** is a conversational AI assistant that helps turn website visitors into customers. Bitsa AI learns your business from the content you give it, answers support questions in real time, captures high-intent leads, and guides shoppers toward a purchase around the clock. 17 16 18 Unlike traditional static rule-based bots that frustrate visitors with rigid menus, Bitsa AI understands natural human intent, context, and nuance. It answers queries directly from your approved knowledge base (website pages, FAQs, documentation, and product catalogs) with zero hallucinations.17 Unlike rule-based bots with rigid menus, Bitsa AI understands natural language, context and intent. It answers from your own approved knowledge base (website pages, FAQs, documentation and product catalogues) instead of generic internet content. 19 18 20 --- 19 = Key features = 21 20 22 ### 🚀 Key Features 21 * **Fast knowledge base setup:** Train your AI in minutes from your website URLs, sitemaps, PDFs, text documents or FAQs inside your Bitsa AI dashboard. 22 * **Lead capture and qualification:** Collect visitor names, phone numbers, email addresses and requirements inside the conversation, then hand warm leads to your sales team. 23 * **WooCommerce aware:** Helps shoppers discover products, check details and add items to their cart through the official WooCommerce Store API. 24 * **Multilingual, including Hinglish:** Understands and replies in 50+ languages, including English, Hindi and Hinglish. 25 * **Lightweight and non-blocking:** A single small loader (about 16 KB gzipped) loads asynchronously in the footer, and the chat window itself loads only after the page has finished loading or when a visitor reaches for the chat. It does not block page rendering. 26 * **Brand customisation:** Change the theme, launcher icon, welcome greeting and bubble position from your Bitsa AI dashboard without touching code. 27 * **Domain whitelisting:** Your chatbot only runs on domains you explicitly authorise, so nobody else can use your AI quota. 23 28 24 * **Instant Knowledge Base Ingestion:** Train your AI in minutes by connecting your website URLs, sitemaps, PDFs, text documents, or FAQs inside your Bitsa AI dashboard. 25 * **Autonomous Lead Capture & Qualification:** Collect visitor names, phone numbers, email addresses, and specific requirements right inside the conversation before handing warm leads to your sales team. 26 * **Seamless WooCommerce Intelligence:** WooCommerce-aware chatbot that helps shoppers discover products, checks stock/details, and allows visitors to add products directly to their cart via the official WooCommerce Store API. 27 * **True Multilingual & Hinglish Support:** Understands and replies naturally in over 50+ languages, including fluent English, Hindi, and natural Hinglish. 28 * **Asynchronous & Ultra-Lightweight:** Loads non-blockingly in your website footer (<15 KB footprint). Guaranteed zero impact on your Core Web Vitals, PageSpeed Insights, or SEO scores. 29 * **Full Brand Customization:** Tailor the chatbot theme, launcher icons, welcome greetings, and chat bubble position directly from your cloud dashboard without touching a single line of code. 30 * **Multi-Domain Whitelisting & Security:** Strict origin verification ensures your chatbot only runs on domains you explicitly authorize. 29 = Built for e-commerce and service businesses = 31 30 32 --- 31 Whether you run a WooCommerce store, a digital agency, a healthcare practice or a real estate consultancy, Bitsa AI acts as a 24/7 front desk. It handles repetitive customer questions automatically and routes high-value prospects straight into your pipeline. 33 32 34 ### 🛒 Built for E-Commerce & Service Businesses 33 = How it works = 35 34 36 Whether you run a high-volume WooCommerce store, a digital agency, a healthcare practice, or a real estate consultancy, Bitsa AI acts as your dedicated 24/7 front-desk executive. It resolves up to 80% of repetitive customer support inquiries automatically and routes high-value sales prospects straight into your pipeline.35 This plugin is a lightweight connector between your WordPress site and your Bitsa AI dashboard. AI responses, knowledge base training and lead management run on Bitsa AI's cloud service. 37 36 38 --- 37 A Bitsa AI account is required. Every new account includes a **7-day free trial** (no credit card required). Paid plans start at ₹299/month. See [Bitsa AI Pricing](https://www.bitsaai.com/chatbot-pricing-india/). 39 38 40 ### ⚙️ How It Works 39 = For developers = 41 40 42 This plugin serves as a secure, lightweight connector between your WordPress site and your Bitsa AI cloud dashboard. The AI inference, knowledge base training, and lead management are handled on Bitsa AI's optimized cloud infrastructure. 41 Hide the chatbot on specific pages with the `bitsaai_chatbot_load_widget` filter: 43 42 44 A Bitsa AI account is required. Every new account includes an unrestricted **7-day free trial** (no credit card required). Affordable paid plans start at just ₹299/month. Explore plans at [Bitsa AI Pricing](https://www.bitsaai.com/chatbot-pricing-india/). 45 46 --- 43 `add_filter( 'bitsaai_chatbot_load_widget', function ( $load ) { return is_checkout() ? false : $load; } );` 47 44 48 45 == External services == 49 46 50 This plugin securely connects your WordPress website to the Bitsa AI cloud service to deliver conversational AI and live chat capabilities. No external scripts or styles are loaded until you input and save your authorized Client ID in the plugin settings.47 This plugin connects your website to the Bitsa AI cloud service to provide the chatbot. Nothing is loaded from Bitsa AI until you save a Client ID in the plugin settings, and nothing is loaded while the "Show chatbot" option is switched off. 51 48 52 1. **Bitsa AI Embed Widget (`www.bitsaai.com`)** 53 * **Purpose:** Delivers the chat launcher interface and real-time messaging UI to front-end visitors. 49 1. **Bitsa AI embed widget (`www.bitsaai.com`)** 50 * **Purpose:** Delivers the chat launcher and chat window to visitors on the front end of your site. 51 * **When:** On every front-end page view once a Client ID is saved and the chatbot is switched on. 54 52 * **Script URL:** `https://www.bitsaai.com/embed-snippet.js` 55 * **Chat FrameURL:** `https://www.bitsaai.com/embed/`56 * **Data Transmitted:** Your account Client ID, browser technical metadata (standard IP address and user-agent string for session persistence), and visitor chat messages (including name, email, or contact number if voluntarily provided).53 * **Chat window URL:** `https://www.bitsaai.com/embed/` 54 * **Data sent:** Your Client ID, your website's domain (to check it against your whitelist), and standard request data any web request carries (visitor IP address and browser user agent). 57 55 58 2. **Bitsa AI Inference & Orchestration API (`production-backend-w1e8.onrender.com`)** 59 * **Purpose:** Processes incoming user queries against your trained knowledge base, generates conversational responses, and logs captured leads in your dashboard. 60 * **Data Transmitted:** Client ID and chat conversational text. 56 2. **Bitsa AI chat API (`production-backend-w1e8.onrender.com`)** 57 * **Purpose:** Loads your chatbot's branding, answers visitor questions from your knowledge base, and records captured leads in your dashboard. 58 * **When:** When the widget loads and whenever a visitor uses the chat. 59 * **Data sent:** Your Client ID, your website's domain, the visitor's chat messages, and any contact details the visitor chooses to share (such as name, email address or phone number), plus the visitor's IP address and browser user agent. 61 60 62 3. ** LocalWooCommerce Store API**63 * For WooCommerce stores, cart operations requested by visitors are executed directly against your own website's native REST API (`/wp-json/wc/store/v1/`). Customer purchase data remains strictly within your WordPress installation.61 3. **Your own WooCommerce Store API** 62 * On WooCommerce stores, cart actions a visitor asks for are sent to your own site's REST API (`/wp-json/wc/store/v1/`), not to Bitsa AI. 64 63 65 * **Privacy Policy:** [https://www.bitsaai.com/privacy/](https://www.bitsaai.com/privacy/) 66 * **Terms of Service:** [https://www.bitsaai.com/terms/](https://www.bitsaai.com/terms/) 64 Bitsa AI [Privacy Policy](https://www.bitsaai.com/privacy/) and [Terms of Service](https://www.bitsaai.com/terms/). 67 65 68 --- 66 The plugin also adds suggested text to your site's privacy policy guide (Settings → Privacy → Policy Guide). 69 67 70 68 == Installation == 71 69 72 Setting up Bitsa AI Chatbot requires zero coding knowledge and takes less than 2 minutes: 70 1. In your WordPress admin, go to **Plugins → Add New**. 71 2. Search for `Bitsa AI Chatbot`, click **Install Now**, then **Activate**. 72 3. Create a free account or log in at [bitsaai.com](https://www.bitsaai.com/signup). 73 4. In the Bitsa AI dashboard, open **Knowledge Base** and train your AI on your website content or documents. 74 5. Under **Domain Access**, add your website's domain (e.g. `example.com`, without `https://`). 75 6. Open **Branding → Embed code** and copy your **Client ID**. 76 7. In WordPress, click **Bitsa AI Chatbot** in the left menu, paste your Client ID and click **Save Changes**. 73 77 74 1. In your WordPress Admin, navigate to **Plugins → Add New**. 75 2. Search for `Bitsa AI Chatbot`, click **Install Now**, and then **Activate**. 76 3. Create your free account or log in at [Bitsa AI Dashboard](https://www.bitsaai.com/signup). 77 4. In the Bitsa AI dashboard, go to **Knowledge Base** to train your AI on your website content or documents. 78 5. Under **Domain Access**, add your website's domain name (e.g., `example.com` without `https://`). 79 6. Navigate to **Branding → Embed code** and copy your unique **Client ID**. 80 7. In your WordPress admin, click on **Bitsa AI Chatbot** in the left menu, paste your Client ID, and click **Save Changes**. 81 82 Your intelligent assistant is now live on your site! 83 84 --- 78 Your assistant is now live on your site. 85 79 86 80 == Frequently Asked Questions == 87 81 88 = Do I need an account with Bitsa AI to use this plugin? = 89 Yes. The plugin connects your WordPress frontend to your custom-trained Bitsa AI brain. You can sign up at [bitsaai.com](https://www.bitsaai.com/) in 30 seconds for a full 7-day free trial without entering payment details. 82 = Do I need a Bitsa AI account to use this plugin? = 83 84 Yes. The plugin connects your site to your Bitsa AI chatbot. You can sign up at [bitsaai.com](https://www.bitsaai.com/) for a 7-day free trial without entering payment details. 90 85 91 86 = Where do I find my Client ID? = 92 Log in to your Bitsa AI dashboard, go to **Branding → Embed code**, and copy the Client ID. You can also paste the entire `<script>` embed snippet into the plugin settings; the plugin will automatically extract your Client ID. 87 88 Log in to your Bitsa AI dashboard, go to **Branding → Embed code** and copy the Client ID. You can also paste the entire `<script>` embed code into the plugin settings; the plugin picks out the Client ID automatically. 93 89 94 90 = I saved my Client ID, but the chat bubble does not appear. Why? = 95 For enterprise security, Bitsa AI enforces strict domain whitelisting to prevent unauthorized third parties from using your AI quota. Open your Bitsa AI dashboard, click **Domain Access**, and add your domain (e.g., `yourwebsite.com`). Whitelisting `yourwebsite.com` automatically authorizes all subdomains including `www.yourwebsite.com`.96 91 97 = Can Bitsa AI understand and respond in Hindi or Hinglish? = 98 Yes! Bitsa AI natively supports Hindi, Hinglish (Hindi written in Latin script), and over 50 global languages. It automatically detects the language your visitor uses and responds fluently in that same language. 92 Bitsa AI only shows your chatbot on domains you have whitelisted, so that nobody else can use your AI quota. Open your Bitsa AI dashboard, click **Domain Access** and add your domain (e.g. `yourwebsite.com`). Whitelisting `yourwebsite.com` also covers `www.yourwebsite.com` and every subdomain. If you use a caching or optimisation plugin, clear its cache afterwards. 93 94 = Can Bitsa AI respond in Hindi or Hinglish? = 95 96 Yes. Bitsa AI supports Hindi, Hinglish (Hindi written in Latin script) and 50+ other languages. It detects the language your visitor uses and replies in the same language. 99 97 100 98 = Can the chatbot help customers on my WooCommerce store? = 101 Absolutely. When active on a WooCommerce store, Bitsa AI can answer product queries, help shoppers find relevant items, and assist with adding items directly to their shopping cart via native WooCommerce endpoints.102 99 103 = Will Bitsa AI slow down my website loading time? = 104 No. The Bitsa AI script loads 100% asynchronously at the bottom of the page footer. It never blocks DOM construction, CSS parsing, or page rendering. 100 Yes. On a WooCommerce store, Bitsa AI can answer product questions, help shoppers find items and add products to their cart through WooCommerce's own Store API. 105 101 106 = How do I customize the chatbot appearance (colors, avatar, greeting)? = 107 All visual branding is managed centrally inside your Bitsa AI cloud dashboard. Any updates you make to colors, launcher position, welcome messages, or bot avatar reflect instantly on your WordPress site without requiring plugin updates. 102 = Will Bitsa AI slow down my website? = 108 103 109 = Can I temporarily disable the chatbot on my site? = 110 Yes. You can uncheck the "Show chatbot" checkbox on the Bitsa AI Chatbot settings page and click Save Changes, or simply deactivate the plugin. 104 The loader script is small and loads asynchronously in the footer, so it does not block page rendering, and the chat window loads only after the page has finished loading. As with any third-party widget, we recommend checking your own pages with PageSpeed Insights after installing. 111 105 112 --- 106 = How do I customise the chatbot's appearance (colours, avatar, greeting)? = 107 108 All branding is managed in your Bitsa AI dashboard. Changes to colours, launcher position, welcome message or avatar appear on your WordPress site automatically, with no plugin update needed. 109 110 = Can I temporarily disable the chatbot? = 111 112 Yes. Untick **Show chatbot** on the Bitsa AI Chatbot settings page and click **Save Changes**, or deactivate the plugin. 113 114 = Can I hide the chatbot on certain pages? = 115 116 Yes. Use the `bitsaai_chatbot_load_widget` filter shown in the "For developers" section above. 117 118 = What happens to my settings when I delete the plugin? = 119 120 Deleting the plugin from the Plugins screen removes its saved settings, including on every site of a multisite network. 113 121 114 122 == Screenshots == 115 123 116 1. The intelligent Bitsa AI assistant interacting with a visitor in real-time. 117 2. Clean, single-click WordPress settings panel for instant Client ID activation. 118 119 --- 124 1. The Bitsa AI chatbot answering a visitor's question on a WordPress site. 125 2. The plugin settings page: whitelist your domain, paste your Client ID and you are connected. 120 126 121 127 == Changelog == 122 128 129 = 1.0.1 = 130 * Improved: The widget now uses WordPress's native async script loading (WordPress 6.3+) and no longer adds an unused version query string to the script URL. 131 * Improved: Script attributes are added with the WordPress HTML API, which is more robust with optimisation plugins. Added compatibility with Cloudflare Rocket Loader. 132 * Improved: The setup reminder now appears only on the Dashboard and Plugins screens and can be dismissed. 133 * Improved: Settings page shows the connection status. 134 * New: `bitsaai_chatbot_load_widget` filter to hide the chatbot on specific pages. 135 * New: Suggested privacy policy text under Settings → Privacy. 136 * Fixed: Settings are now removed from every site when the plugin is deleted on a multisite network. 137 * Hardening: Stricter validation of saved settings and stricter escaping of admin links. 138 123 139 = 1.0.0 = 124 * Initial official release on the WordPress Plugin Directory. 125 * Added seamless Client ID integration. 126 * Added native WooCommerce Store API cart support. 127 * Added asynchronous non-blocking script loader. 140 * Initial release on the WordPress Plugin Directory. 141 * Connect your site with a Client ID (or by pasting the whole embed code). 142 * Asynchronous, non-blocking widget loader. 143 144 == Upgrade Notice == 145 146 = 1.0.1 = 147 Faster native async loading, a dismissible setup reminder, a new filter to hide the chatbot on specific pages, and multisite cleanup on delete. -
bitsa-ai-chatbot/trunk/uninstall.php
r3750113 r3750286 10 10 } 11 11 12 delete_option( 'bitsaai_chatbot_settings' ); 12 if ( is_multisite() && function_exists( 'get_sites' ) ) { 13 // A network-activated plugin stores its settings on every site. 14 $bitsaai_site_ids = get_sites( 15 array( 16 'fields' => 'ids', 17 'number' => 0, 18 ) 19 ); 20 foreach ( $bitsaai_site_ids as $bitsaai_site_id ) { 21 switch_to_blog( $bitsaai_site_id ); 22 delete_option( 'bitsaai_chatbot_settings' ); 23 restore_current_blog(); 24 } 25 } else { 26 delete_option( 'bitsaai_chatbot_settings' ); 27 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)