Plugin Directory

Changeset 3846884


Ignore:
Timestamp:
12/05/2026 10:16:29 PM (67 minutes ago)
Author:
wirtualnyczat
Message:

1.5.0: polaczenie jednym kliknieciem

Location:
wirtualnyczat-ai-chatbot
Files:
3 edited
5 copied

Legend:

Unmodified
Added
Removed
  • wirtualnyczat-ai-chatbot/tags/1.5.0/includes/plugin.php

    r3846147 r3846884  
    262262}
    263263add_action( 'admin_init', 'wirtualny_czat_old_url_redirect' );
     264
     265// ---------- One-click connection ----------
     266// "Connect" opens the Wirtualny Czat panel with this site's address, the address of this screen and a random code
     267// (state) kept for 2 hours for the logged-in administrator. After the user confirms in the panel, the panel sends them
     268// back here with the company ID and the same code. The ID is saved only when the code matches (and is then deleted),
     269// so nobody can plant a different company ID with a crafted link.
     270
     271function wirtualny_czat_connect_key() {
     272        return 'wirtualny_czat_connect_' . get_current_user_id();
     273}
     274
     275function wirtualny_czat_connect_state() {
     276        $state = get_transient( wirtualny_czat_connect_key() );
     277        if ( ! is_string( $state ) || ! preg_match( '/^[A-Za-z0-9]{32}$/', $state ) ) {
     278                $state = wp_generate_password( 32, false, false );
     279                set_transient( wirtualny_czat_connect_key(), $state, 2 * HOUR_IN_SECONDS );
     280        }
     281        return $state;
     282}
     283
     284function wirtualny_czat_connect_url( $register ) {
     285        $links = wirtualny_czat_site_links();
     286        $args  = array(
     287                'connect' => 'wp',
     288                'site'    => home_url( '/' ),
     289                'return'  => wirtualny_czat_settings_url(),
     290                'state'   => wirtualny_czat_connect_state(),
     291                'wplang'  => substr( (string) get_locale(), 0, 2 ),
     292        );
     293        if ( '' !== $links['lang'] ) {
     294                $args = array( 'lang' => 'en' ) + $args;
     295        }
     296        return WIRTUALNY_CZAT_SERVER . '/panel?' . http_build_query( $args, '', '&', PHP_QUERY_RFC3986 ) . ( $register ? '#rejestracja' : '' );
     297}
     298
     299// Back from the panel: …/admin.php?page=wirtualny-czat&wc_connect=<company ID>&wc_state=<code>.
     300function wirtualny_czat_connect_return() {
     301        // phpcs:disable WordPress.Security.NonceVerification.Recommended -- protected by the one-time state code checked below (the request comes from the panel, so a WordPress nonce cannot be used).
     302        if ( ! isset( $_GET['page'], $_GET['wc_connect'], $_GET['wc_state'] ) || 'wirtualny-czat' !== $_GET['page'] ) {
     303                return;
     304        }
     305        if ( ! current_user_can( 'manage_options' ) ) {
     306                return;
     307        }
     308        $state = sanitize_text_field( wp_unslash( $_GET['wc_state'] ) );
     309        $id    = wirtualny_czat_parse_id( sanitize_text_field( wp_unslash( $_GET['wc_connect'] ) ) );
     310        // phpcs:enable WordPress.Security.NonceVerification.Recommended
     311        $expected = get_transient( wirtualny_czat_connect_key() );
     312        $ok       = is_string( $expected ) && '' !== $expected && '' !== $id && hash_equals( $expected, $state );
     313        if ( $ok ) {
     314                delete_transient( wirtualny_czat_connect_key() );
     315                $s            = wirtualny_czat_settings();
     316                $s['id']      = $id;
     317                $s['enabled'] = true;
     318                update_option( WIRTUALNY_CZAT_OPTION, $s );
     319        }
     320        wp_safe_redirect( add_query_arg( 'wc_connected', $ok ? '1' : '0', wirtualny_czat_settings_url() ) );
     321        exit;
     322}
     323add_action( 'admin_init', 'wirtualny_czat_connect_return' );
    264324
    265325// Styles of the settings screen – only on this screen, inline (no extra request).
    … …  
    300360.wc-admin .wc-steps b{display:block;font-size:14px}
    301361.wc-admin .wc-steps span.wc-muted{color:#50575e}
     362.wc-admin .wc-connect{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 12px}
     363.wc-admin .wc-connect .button{white-space:normal;text-align:center;height:auto;line-height:1.4;padding-top:10px;padding-bottom:10px}
     364.wc-admin p.wc-muted{color:#50575e}
     365.wc-admin .wc-manual{margin-top:12px;border-top:1px solid #f0f0f1;padding-top:10px}
     366.wc-admin .wc-manual summary{cursor:pointer;color:#2271b1}
    302367.wc-admin .wc-field{margin:16px 0 0}
    303368.wc-admin .wc-field label{display:block;margin-bottom:6px;font-weight:600}
    … …  
    345410                <hr class="wp-header-end">
    346411                <?php settings_errors(); ?>
     412                <?php
     413                // Result of the one-click connection (only a message – the ID itself was saved in wirtualny_czat_connect_return()).
     414                $connected = isset( $_GET['wc_connected'] ) ? sanitize_key( wp_unslash( $_GET['wc_connected'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- display only
     415                if ( '1' === $connected ) :
     416                        ?>
     417                        <div class="notice notice-success"><p><?php esc_html_e( 'Connected! The chat is now on your site. Next, check in the panel what the assistant knows about your business.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $panel . '#asystent' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Open the panel', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a></p></div>
     418                <?php elseif ( '0' === $connected ) : ?>
     419                        <div class="notice notice-error"><p><?php esc_html_e( 'The connection could not be completed (the link has expired or was opened by another user). Click “Connect” again.', 'wirtualnyczat-ai-chatbot' ); ?></p></div>
     420                <?php endif; ?>
    347421                <div class="wc-hero">
    348422                        <span class="wc-logo" aria-hidden="true"><svg viewBox="0 0 32 32"><path d="M12.5 8h7A3.5 3.5 0 0 1 23 11.5v5a3.5 3.5 0 0 1-3.5 3.5H15l-4.5 3.5c-.6.45-1.5.05-1.5-.7V11.5A3.5 3.5 0 0 1 12.5 8Z" fill="#12343B"/><circle cx="13" cy="14" r="1.3" fill="#F2C14E"/><circle cx="16" cy="14" r="1.3" fill="#F2C14E"/><circle cx="19" cy="14" r="1.3" fill="#F2C14E"/></svg></span>
    … …  
    363437                                <?php if ( ! $ready ) : ?>
    364438                                        <div class="wc-card">
    365                                                 <h2><?php esc_html_e( 'Connect your site in 3 steps', 'wirtualnyczat-ai-chatbot' ); ?></h2>
    366                                                 <ol class="wc-steps">
    367                                                         <li>
    368                                                                 <span class="wc-step-txt"><b><?php esc_html_e( 'Create a free account', 'wirtualnyczat-ai-chatbot' ); ?></b><span class="wc-muted"><?php esc_html_e( '14 days free, no credit card required. After the trial the chat stays on your site and keeps collecting contacts at no cost.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $links['pricing'] ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'See plans and prices', 'wirtualnyczat-ai-chatbot' ); ?></a></span></span>
    369                                                                 <a class="button" href="<?php echo esc_url( $panel . '#rejestracja' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Create account', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a>
    370                                                         </li>
    371                                                         <li>
    372                                                                 <span class="wc-step-txt"><b><?php esc_html_e( 'Copy your company ID', 'wirtualnyczat-ai-chatbot' ); ?></b><span class="wc-muted"><?php esc_html_e( 'In the panel, Installation tab: it is at the top, with a Copy button.', 'wirtualnyczat-ai-chatbot' ); ?></span></span>
    373                                                                 <a class="button" href="<?php echo esc_url( $panel . '#instalacja' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Open the panel', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a>
    374                                                         </li>
    375                                                         <li>
    376                                                                 <span class="wc-step-txt"><b><?php esc_html_e( 'Paste it below and save', 'wirtualnyczat-ai-chatbot' ); ?></b><span class="wc-muted"><?php esc_html_e( 'The chat appears on your site right away.', 'wirtualnyczat-ai-chatbot' ); ?></span></span>
    377                                                         </li>
    378                                                 </ol>
     439                                                <h2><?php esc_html_e( 'Connect your site', 'wirtualnyczat-ai-chatbot' ); ?></h2>
     440                                                <p class="wc-sub"><?php esc_html_e( 'One click: create an account (or log in) and confirm. We add this site to your account and save the company ID here by ourselves.', 'wirtualnyczat-ai-chatbot' ); ?></p>
     441                                                <p class="wc-connect">
     442                                                        <a class="button button-primary button-hero" href="<?php echo esc_url( wirtualny_czat_connect_url( true ) ); ?>"><?php esc_html_e( 'Create a free account and connect', 'wirtualnyczat-ai-chatbot' ); ?></a>
     443                                                        <a class="button button-hero" href="<?php echo esc_url( wirtualny_czat_connect_url( false ) ); ?>"><?php esc_html_e( 'I have an account: log in and connect', 'wirtualnyczat-ai-chatbot' ); ?></a>
     444                                                </p>
     445                                                <p class="wc-muted"><?php esc_html_e( '14 days free, no credit card required. After the trial the chat stays on your site and keeps collecting contacts at no cost.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $links['pricing'] ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'See plans and prices', 'wirtualnyczat-ai-chatbot' ); ?></a></p>
     446                                                <details class="wc-manual">
     447                                                        <summary><?php esc_html_e( 'Prefer to paste the company ID yourself?', 'wirtualnyczat-ai-chatbot' ); ?></summary>
     448                                                        <p class="wc-muted"><?php esc_html_e( 'In the panel, Installation tab: copy the company ID (at the top, with a Copy button), paste it in the field below and save. Also add the address of this site in the Sites tab.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $panel . '#instalacja' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Open the panel', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a></p>
     449                                                </details>
    379450                                        </div>
    380451                                <?php else : ?>
    … …  
    492563                '<div class="notice notice-warning"><p>Wirtualny Czat: <a href="%s">%s</a></p></div>',
    493564                esc_url( wirtualny_czat_settings_url() ),
    494                 esc_html__( 'Enter your company ID to show the chat on your site.', 'wirtualnyczat-ai-chatbot' )
     565                esc_html__( 'Connect your site with one click to show the chat to visitors.', 'wirtualnyczat-ai-chatbot' )
    495566        );
    496567}
  • wirtualnyczat-ai-chatbot/tags/1.5.0/readme.txt

    r3846147 r3846884  
    55Tested up to: 7.1
    66Requires PHP: 7.0
    7 Stable tag: 1.4.2
     7Stable tag: 1.5.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    1515**WirtualnyCzat AI Chatbot** adds an AI assistant to your website that knows your offer, prices and policies and answers customers instantly, day and night. When a customer is ready, the assistant collects their contact details and sends you a ready-to-call lead with a short summary of the conversation.
    1616
    17 No coding and no chatbot scenarios to build. Paste your website address in the panel and the assistant prepares its knowledge from your pages. Most sites are live in about 20 minutes.
     17No coding and no chatbot scenarios to build. Click "Connect" in the plugin, log in or create an account, and your site is connected: no ID to copy. The assistant prepares its knowledge from your pages. Most sites are live in about 20 minutes.
    1818
    1919**14 days of the full version free, no credit card required.** After the trial nothing disappears from your site: the chat stays in place and keeps collecting customer contacts at no cost. AI answers continue on a paid monthly plan.
    … …  
    6262* On every page of your site, visitors' browsers load the chat script from https://app.wirtualnyczat.pl/widget.js together with your company ID.
    6363* When a visitor uses the chat, the messages they type, the address, title and a short text excerpt of the page they are on, and – only if they choose to leave their contact details – their name, phone number and e-mail address are sent to the Wirtualny Czat service to generate answers and deliver inquiries to you.
     64* When an administrator clicks "Connect" on the plugin settings screen, the browser opens the Wirtualny Czat panel with your site address, the address of the plugin settings screen and a one-time security code. After you confirm in the panel, the panel sends you back with your company ID, which the plugin saves only if the security code matches.
    6465* On the plugin settings screen (only for administrators), the plugin asks the service whether your site address is added in the panel and when the chat was last seen on it. Only your company ID and your site's domain are sent; the answer is cached for 10 minutes.
    6566* No other data is sent from your WordPress admin or database.
    … …  
    7071
    71721. Install and activate the plugin (Plugins → Add New → search for "WirtualnyCzat AI Chatbot", or upload the .zip file).
    72 2. Create a free trial account at https://app.wirtualnyczat.pl/panel?lang=en#rejestracja (businesses in Poland: https://wirtualnyczat.pl/) and add your website address in the panel (Sites tab).
    73 3. Click **Wirtualny Czat** in the WordPress admin menu and enter your company ID from the panel (Installation tab). You can also paste the whole embed code.
     732. Click **Wirtualny Czat** in the WordPress admin menu, then **Create a free account and connect** (or log in if you already have an account).
     743. Confirm the connection in the panel. You come back to WordPress with the chat switched on.
     75
     76You can also connect manually: add your website address in the panel (Sites tab) and enter your company ID from the Installation tab on the plugin settings screen.
    7477
    7578The plugin downloaded from the Wirtualny Czat panel already contains your company ID – just install and activate it.
    … …  
    107110= Which languages does it support? =
    108111
    109 By default the assistant replies in your site's language. One setting switches it to the customer's language: it answers in the language each customer writes in (25+ languages) and shows the chat buttons in the language of their browser. Each language version of your site can have its own knowledge, prices and contact details. The management panel is in Polish for now; early access in English: https://wirtualnyczat.pl/en/
     112By default the assistant replies in your site's language. One setting switches it to the customer's language: it answers in the language each customer writes in (25+ languages) and shows the chat buttons in the language of their browser. Each language version of your site can have its own knowledge, prices and contact details. The management panel is available in English and Polish.
    110113
    111114= Will the plugin slow down my site? =
    … …  
    130133
    131134== Changelog ==
     135
     136= 1.5.0 =
     137* New: connect your site with one click. The plugin opens the panel, you log in or create an account, confirm, and the company ID is saved for you. No copying.
     138* Security: the connection uses a one-time code that is valid for 2 hours, works only for administrators and returns only to your own site.
     139* Manual entry of the company ID is still available under "Prefer to paste the company ID yourself?".
    132140
    133141= 1.4.2 =
  • wirtualnyczat-ai-chatbot/tags/1.5.0/wirtualnyczat-ai-chatbot.php

    r3846147 r3846884  
    33 * Plugin Name:       WirtualnyCzat AI Chatbot
    44 * Description:       AI assistant (AI chatbot) for WordPress and WooCommerce: answers customers 24/7, collects inquiries, books appointments and adds products to the cart. Just enter the ID from your Wirtualny Czat panel.
    5  * Version:           1.4.2
     5 * Version:           1.5.0
    66 * Requires at least: 5.0
    77 * Requires PHP:      7.0
    … …  
    2929define( 'WIRTUALNY_CZAT_OPTION', 'wirtualny_czat' );
    3030define( 'WIRTUALNY_CZAT_FILE', __FILE__ );
    31 define( 'WIRTUALNY_CZAT_VERSION', '1.4.2' );
     31define( 'WIRTUALNY_CZAT_VERSION', '1.5.0' );
    3232
    3333require_once __DIR__ . '/includes/plugin.php';
  • wirtualnyczat-ai-chatbot/trunk/includes/plugin.php

    r3846147 r3846884  
    262262}
    263263add_action( 'admin_init', 'wirtualny_czat_old_url_redirect' );
     264
     265// ---------- One-click connection ----------
     266// "Connect" opens the Wirtualny Czat panel with this site's address, the address of this screen and a random code
     267// (state) kept for 2 hours for the logged-in administrator. After the user confirms in the panel, the panel sends them
     268// back here with the company ID and the same code. The ID is saved only when the code matches (and is then deleted),
     269// so nobody can plant a different company ID with a crafted link.
     270
     271function wirtualny_czat_connect_key() {
     272        return 'wirtualny_czat_connect_' . get_current_user_id();
     273}
     274
     275function wirtualny_czat_connect_state() {
     276        $state = get_transient( wirtualny_czat_connect_key() );
     277        if ( ! is_string( $state ) || ! preg_match( '/^[A-Za-z0-9]{32}$/', $state ) ) {
     278                $state = wp_generate_password( 32, false, false );
     279                set_transient( wirtualny_czat_connect_key(), $state, 2 * HOUR_IN_SECONDS );
     280        }
     281        return $state;
     282}
     283
     284function wirtualny_czat_connect_url( $register ) {
     285        $links = wirtualny_czat_site_links();
     286        $args  = array(
     287                'connect' => 'wp',
     288                'site'    => home_url( '/' ),
     289                'return'  => wirtualny_czat_settings_url(),
     290                'state'   => wirtualny_czat_connect_state(),
     291                'wplang'  => substr( (string) get_locale(), 0, 2 ),
     292        );
     293        if ( '' !== $links['lang'] ) {
     294                $args = array( 'lang' => 'en' ) + $args;
     295        }
     296        return WIRTUALNY_CZAT_SERVER . '/panel?' . http_build_query( $args, '', '&', PHP_QUERY_RFC3986 ) . ( $register ? '#rejestracja' : '' );
     297}
     298
     299// Back from the panel: …/admin.php?page=wirtualny-czat&wc_connect=<company ID>&wc_state=<code>.
     300function wirtualny_czat_connect_return() {
     301        // phpcs:disable WordPress.Security.NonceVerification.Recommended -- protected by the one-time state code checked below (the request comes from the panel, so a WordPress nonce cannot be used).
     302        if ( ! isset( $_GET['page'], $_GET['wc_connect'], $_GET['wc_state'] ) || 'wirtualny-czat' !== $_GET['page'] ) {
     303                return;
     304        }
     305        if ( ! current_user_can( 'manage_options' ) ) {
     306                return;
     307        }
     308        $state = sanitize_text_field( wp_unslash( $_GET['wc_state'] ) );
     309        $id    = wirtualny_czat_parse_id( sanitize_text_field( wp_unslash( $_GET['wc_connect'] ) ) );
     310        // phpcs:enable WordPress.Security.NonceVerification.Recommended
     311        $expected = get_transient( wirtualny_czat_connect_key() );
     312        $ok       = is_string( $expected ) && '' !== $expected && '' !== $id && hash_equals( $expected, $state );
     313        if ( $ok ) {
     314                delete_transient( wirtualny_czat_connect_key() );
     315                $s            = wirtualny_czat_settings();
     316                $s['id']      = $id;
     317                $s['enabled'] = true;
     318                update_option( WIRTUALNY_CZAT_OPTION, $s );
     319        }
     320        wp_safe_redirect( add_query_arg( 'wc_connected', $ok ? '1' : '0', wirtualny_czat_settings_url() ) );
     321        exit;
     322}
     323add_action( 'admin_init', 'wirtualny_czat_connect_return' );
    264324
    265325// Styles of the settings screen – only on this screen, inline (no extra request).
    … …  
    300360.wc-admin .wc-steps b{display:block;font-size:14px}
    301361.wc-admin .wc-steps span.wc-muted{color:#50575e}
     362.wc-admin .wc-connect{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0 12px}
     363.wc-admin .wc-connect .button{white-space:normal;text-align:center;height:auto;line-height:1.4;padding-top:10px;padding-bottom:10px}
     364.wc-admin p.wc-muted{color:#50575e}
     365.wc-admin .wc-manual{margin-top:12px;border-top:1px solid #f0f0f1;padding-top:10px}
     366.wc-admin .wc-manual summary{cursor:pointer;color:#2271b1}
    302367.wc-admin .wc-field{margin:16px 0 0}
    303368.wc-admin .wc-field label{display:block;margin-bottom:6px;font-weight:600}
    … …  
    345410                <hr class="wp-header-end">
    346411                <?php settings_errors(); ?>
     412                <?php
     413                // Result of the one-click connection (only a message – the ID itself was saved in wirtualny_czat_connect_return()).
     414                $connected = isset( $_GET['wc_connected'] ) ? sanitize_key( wp_unslash( $_GET['wc_connected'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- display only
     415                if ( '1' === $connected ) :
     416                        ?>
     417                        <div class="notice notice-success"><p><?php esc_html_e( 'Connected! The chat is now on your site. Next, check in the panel what the assistant knows about your business.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $panel . '#asystent' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Open the panel', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a></p></div>
     418                <?php elseif ( '0' === $connected ) : ?>
     419                        <div class="notice notice-error"><p><?php esc_html_e( 'The connection could not be completed (the link has expired or was opened by another user). Click “Connect” again.', 'wirtualnyczat-ai-chatbot' ); ?></p></div>
     420                <?php endif; ?>
    347421                <div class="wc-hero">
    348422                        <span class="wc-logo" aria-hidden="true"><svg viewBox="0 0 32 32"><path d="M12.5 8h7A3.5 3.5 0 0 1 23 11.5v5a3.5 3.5 0 0 1-3.5 3.5H15l-4.5 3.5c-.6.45-1.5.05-1.5-.7V11.5A3.5 3.5 0 0 1 12.5 8Z" fill="#12343B"/><circle cx="13" cy="14" r="1.3" fill="#F2C14E"/><circle cx="16" cy="14" r="1.3" fill="#F2C14E"/><circle cx="19" cy="14" r="1.3" fill="#F2C14E"/></svg></span>
    … …  
    363437                                <?php if ( ! $ready ) : ?>
    364438                                        <div class="wc-card">
    365                                                 <h2><?php esc_html_e( 'Connect your site in 3 steps', 'wirtualnyczat-ai-chatbot' ); ?></h2>
    366                                                 <ol class="wc-steps">
    367                                                         <li>
    368                                                                 <span class="wc-step-txt"><b><?php esc_html_e( 'Create a free account', 'wirtualnyczat-ai-chatbot' ); ?></b><span class="wc-muted"><?php esc_html_e( '14 days free, no credit card required. After the trial the chat stays on your site and keeps collecting contacts at no cost.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $links['pricing'] ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'See plans and prices', 'wirtualnyczat-ai-chatbot' ); ?></a></span></span>
    369                                                                 <a class="button" href="<?php echo esc_url( $panel . '#rejestracja' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Create account', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a>
    370                                                         </li>
    371                                                         <li>
    372                                                                 <span class="wc-step-txt"><b><?php esc_html_e( 'Copy your company ID', 'wirtualnyczat-ai-chatbot' ); ?></b><span class="wc-muted"><?php esc_html_e( 'In the panel, Installation tab: it is at the top, with a Copy button.', 'wirtualnyczat-ai-chatbot' ); ?></span></span>
    373                                                                 <a class="button" href="<?php echo esc_url( $panel . '#instalacja' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Open the panel', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a>
    374                                                         </li>
    375                                                         <li>
    376                                                                 <span class="wc-step-txt"><b><?php esc_html_e( 'Paste it below and save', 'wirtualnyczat-ai-chatbot' ); ?></b><span class="wc-muted"><?php esc_html_e( 'The chat appears on your site right away.', 'wirtualnyczat-ai-chatbot' ); ?></span></span>
    377                                                         </li>
    378                                                 </ol>
     439                                                <h2><?php esc_html_e( 'Connect your site', 'wirtualnyczat-ai-chatbot' ); ?></h2>
     440                                                <p class="wc-sub"><?php esc_html_e( 'One click: create an account (or log in) and confirm. We add this site to your account and save the company ID here by ourselves.', 'wirtualnyczat-ai-chatbot' ); ?></p>
     441                                                <p class="wc-connect">
     442                                                        <a class="button button-primary button-hero" href="<?php echo esc_url( wirtualny_czat_connect_url( true ) ); ?>"><?php esc_html_e( 'Create a free account and connect', 'wirtualnyczat-ai-chatbot' ); ?></a>
     443                                                        <a class="button button-hero" href="<?php echo esc_url( wirtualny_czat_connect_url( false ) ); ?>"><?php esc_html_e( 'I have an account: log in and connect', 'wirtualnyczat-ai-chatbot' ); ?></a>
     444                                                </p>
     445                                                <p class="wc-muted"><?php esc_html_e( '14 days free, no credit card required. After the trial the chat stays on your site and keeps collecting contacts at no cost.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $links['pricing'] ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'See plans and prices', 'wirtualnyczat-ai-chatbot' ); ?></a></p>
     446                                                <details class="wc-manual">
     447                                                        <summary><?php esc_html_e( 'Prefer to paste the company ID yourself?', 'wirtualnyczat-ai-chatbot' ); ?></summary>
     448                                                        <p class="wc-muted"><?php esc_html_e( 'In the panel, Installation tab: copy the company ID (at the top, with a Copy button), paste it in the field below and save. Also add the address of this site in the Sites tab.', 'wirtualnyczat-ai-chatbot' ); ?> <a href="<?php echo esc_url( $panel . '#instalacja' ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Open the panel', 'wirtualnyczat-ai-chatbot' ); ?> ↗</a></p>
     449                                                </details>
    379450                                        </div>
    380451                                <?php else : ?>
    … …  
    492563                '<div class="notice notice-warning"><p>Wirtualny Czat: <a href="%s">%s</a></p></div>',
    493564                esc_url( wirtualny_czat_settings_url() ),
    494                 esc_html__( 'Enter your company ID to show the chat on your site.', 'wirtualnyczat-ai-chatbot' )
     565                esc_html__( 'Connect your site with one click to show the chat to visitors.', 'wirtualnyczat-ai-chatbot' )
    495566        );
    496567}
  • wirtualnyczat-ai-chatbot/trunk/readme.txt

    r3846147 r3846884  
    55Tested up to: 7.1
    66Requires PHP: 7.0
    7 Stable tag: 1.4.2
     7Stable tag: 1.5.0
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    1515**WirtualnyCzat AI Chatbot** adds an AI assistant to your website that knows your offer, prices and policies and answers customers instantly, day and night. When a customer is ready, the assistant collects their contact details and sends you a ready-to-call lead with a short summary of the conversation.
    1616
    17 No coding and no chatbot scenarios to build. Paste your website address in the panel and the assistant prepares its knowledge from your pages. Most sites are live in about 20 minutes.
     17No coding and no chatbot scenarios to build. Click "Connect" in the plugin, log in or create an account, and your site is connected: no ID to copy. The assistant prepares its knowledge from your pages. Most sites are live in about 20 minutes.
    1818
    1919**14 days of the full version free, no credit card required.** After the trial nothing disappears from your site: the chat stays in place and keeps collecting customer contacts at no cost. AI answers continue on a paid monthly plan.
    … …  
    6262* On every page of your site, visitors' browsers load the chat script from https://app.wirtualnyczat.pl/widget.js together with your company ID.
    6363* When a visitor uses the chat, the messages they type, the address, title and a short text excerpt of the page they are on, and – only if they choose to leave their contact details – their name, phone number and e-mail address are sent to the Wirtualny Czat service to generate answers and deliver inquiries to you.
     64* When an administrator clicks "Connect" on the plugin settings screen, the browser opens the Wirtualny Czat panel with your site address, the address of the plugin settings screen and a one-time security code. After you confirm in the panel, the panel sends you back with your company ID, which the plugin saves only if the security code matches.
    6465* On the plugin settings screen (only for administrators), the plugin asks the service whether your site address is added in the panel and when the chat was last seen on it. Only your company ID and your site's domain are sent; the answer is cached for 10 minutes.
    6566* No other data is sent from your WordPress admin or database.
    … …  
    7071
    71721. Install and activate the plugin (Plugins → Add New → search for "WirtualnyCzat AI Chatbot", or upload the .zip file).
    72 2. Create a free trial account at https://app.wirtualnyczat.pl/panel?lang=en#rejestracja (businesses in Poland: https://wirtualnyczat.pl/) and add your website address in the panel (Sites tab).
    73 3. Click **Wirtualny Czat** in the WordPress admin menu and enter your company ID from the panel (Installation tab). You can also paste the whole embed code.
     732. Click **Wirtualny Czat** in the WordPress admin menu, then **Create a free account and connect** (or log in if you already have an account).
     743. Confirm the connection in the panel. You come back to WordPress with the chat switched on.
     75
     76You can also connect manually: add your website address in the panel (Sites tab) and enter your company ID from the Installation tab on the plugin settings screen.
    7477
    7578The plugin downloaded from the Wirtualny Czat panel already contains your company ID – just install and activate it.
    … …  
    107110= Which languages does it support? =
    108111
    109 By default the assistant replies in your site's language. One setting switches it to the customer's language: it answers in the language each customer writes in (25+ languages) and shows the chat buttons in the language of their browser. Each language version of your site can have its own knowledge, prices and contact details. The management panel is in Polish for now; early access in English: https://wirtualnyczat.pl/en/
     112By default the assistant replies in your site's language. One setting switches it to the customer's language: it answers in the language each customer writes in (25+ languages) and shows the chat buttons in the language of their browser. Each language version of your site can have its own knowledge, prices and contact details. The management panel is available in English and Polish.
    110113
    111114= Will the plugin slow down my site? =
    … …  
    130133
    131134== Changelog ==
     135
     136= 1.5.0 =
     137* New: connect your site with one click. The plugin opens the panel, you log in or create an account, confirm, and the company ID is saved for you. No copying.
     138* Security: the connection uses a one-time code that is valid for 2 hours, works only for administrators and returns only to your own site.
     139* Manual entry of the company ID is still available under "Prefer to paste the company ID yourself?".
    132140
    133141= 1.4.2 =
  • wirtualnyczat-ai-chatbot/trunk/wirtualnyczat-ai-chatbot.php

    r3846147 r3846884  
    33 * Plugin Name:       WirtualnyCzat AI Chatbot
    44 * Description:       AI assistant (AI chatbot) for WordPress and WooCommerce: answers customers 24/7, collects inquiries, books appointments and adds products to the cart. Just enter the ID from your Wirtualny Czat panel.
    5  * Version:           1.4.2
     5 * Version:           1.5.0
    66 * Requires at least: 5.0
    77 * Requires PHP:      7.0
    … …  
    2929define( 'WIRTUALNY_CZAT_OPTION', 'wirtualny_czat' );
    3030define( 'WIRTUALNY_CZAT_FILE', __FILE__ );
    31 define( 'WIRTUALNY_CZAT_VERSION', '1.4.2' );
     31define( 'WIRTUALNY_CZAT_VERSION', '1.5.0' );
    3232
    3333require_once __DIR__ . '/includes/plugin.php';
Note: See TracChangeset for help on using the changeset viewer.