Plugin Directory

Changeset 3843715


Ignore:
Timestamp:
12/04/2026 04:22:25 AM (less than one hour ago)
Author:
atapai
Message:

1.3.3: Selling Points, Company Info

Location:
atap-ai-customer-service
Files:
2 added
14 edited
1 copied

Legend:

Unmodified
Added
Removed
  • atap-ai-customer-service/tags/1.3.3/assets/admin.css

    r3841326 r3843715  
    180180.atap .atap-plan-line1{display:block;font-size:12px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;color:#646970}
    181181.atap .atap-plan-line2{display:block}
     182.atap-places{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
     183.atap-place{border:1px solid #dcdcde;border-radius:8px;padding:4px 14px}
  • atap-ai-customer-service/tags/1.3.3/assets/admin.js

    r3841326 r3843715  
    479479  });
    480480})();
     481/* Company Info: the number of locations draws that many boxes; "We Have Our Own About Page" hides the box it replaces. */
     482(function () {
     483  var list = document.getElementById('atap-places'), n = document.getElementById('atap-place-count');
     484  var tpl = document.getElementById('atap-place-new'), own = document.getElementById('atap-own-about');
     485  if (n && list && tpl) {
     486    n.addEventListener('input', function () {
     487      var want = Math.min(50, parseInt(n.value, 10) || 0), i, el;
     488      if (want < 1) { return; }
     489      while (list.children.length < want) {
     490        i = list.children.length;
     491        el = document.createElement('div');
     492        el.innerHTML = tpl.innerHTML.split('places[999]').join('places[' + i + ']');
     493        el.querySelector('.atap-place-n').textContent = i + 1;
     494        list.appendChild(el.firstElementChild);
     495      }
     496      for (i = 0; i < list.children.length; i++) { list.children[i].style.display = i < want ? '' : 'none'; }
     497    });
     498  }
     499  if (own) {
     500    var bio = document.querySelector('.atap-bio'), note = document.querySelector('.atap-own-note');
     501    var draw = function () {
     502      note.style.display = own.checked ? '' : 'none';
     503      bio.style.display = own.checked && bio.getAttribute('data-page') === '1' ? 'none' : '';
     504    };
     505    own.addEventListener('change', draw);
     506    draw();
     507  }
     508})();
  • atap-ai-customer-service/tags/1.3.3/atap.php

    r3841571 r3843715  
    33 * Plugin Name:       aTap – AI Customer Service
    44 * Description:       An AI assistant and business service for your store: answers customers from your own pages, posts and products, and reports on what they ask, want and buy. Manage it all from the aTap menu.
    5  * Version:           1.3.2
     5 * Version:           1.3.3
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    … …  
    1919}
    2020
    21 define( 'ATAP_VERSION', '1.3.2' );
     21define( 'ATAP_VERSION', '1.3.3' );
    2222define( 'ATAP_FILE', __FILE__ );
    2323define( 'ATAP_DIR', plugin_dir_path( __FILE__ ) );
  • atap-ai-customer-service/tags/1.3.3/includes/class-atap-admin.php

    r3841571 r3843715  
    2727                add_action( 'admin_post_atap_lib_upload', array( __CLASS__, 'lib_upload' ) );
    2828                add_action( 'admin_post_atap_lib_delete', array( __CLASS__, 'lib_delete' ) );
     29                add_action( 'admin_post_atap_company', array( __CLASS__, 'save_company' ) );
     30                add_action( 'wp_ajax_atap_selling', array( __CLASS__, 'selling_ajax' ) );
    2931                add_action( 'admin_post_atap_dismiss_notice', array( __CLASS__, 'dismiss_notice' ) );
    3032        }
    … …  
    8486                        'atap-reports'   => array( __( 'Reports', 'atap-ai-customer-service' ), 'page_reports' ),
    8587                        'atap-billing'   => array( __( 'Subscription & Add-ons', 'atap-ai-customer-service' ), 'page_billing' ),
     88                        'atap-company'   => array( __( 'Company Info', 'atap-ai-customer-service' ), 'page_company' ),
    8689                        'atap-account'   => array( __( 'Account', 'atap-ai-customer-service' ), 'page_account' ),
    8790                        'atap-settings'  => array( __( 'Settings', 'atap-ai-customer-service' ), 'page_settings' ),
    … …  
    134137                        'atap-reports'   => '#reports',
    135138                        'atap-billing'   => '#billing',
     139                        'atap-company'   => '#company-info',
    136140                        'atap-account'   => '#billing',
    137141                        'atap-settings'  => 'choose-what-it-learns',
    … …  
    419423                $sel_copy = isset( $_GET['atap_copy'] ) ? absint( $_GET['atap_copy'] ) : 0;
    420424                $sel_read = isset( $_GET['atap_read'] ) ? sanitize_text_field( wp_unslash( $_GET['atap_read'] ) ) : '';
    421                 $mode     = isset( $_GET['atap_mode'] ) && 'upload' === $_GET['atap_mode'] ? 'upload' : 'write';
     425                $mode     = isset( $_GET['atap_mode'] ) && in_array( $_GET['atap_mode'], array( 'upload', 'selling' ), true ) ? sanitize_key( $_GET['atap_mode'] ) : 'write';
     426                $sel_sell = isset( $_GET['atap_sell'] ) ? sanitize_text_field( wp_unslash( $_GET['atap_sell'] ) ) : '';
    422427                // the sidebar's search for pages, posts and other kinds (1.2.6): which kind, and the words
    423428                $find_t   = isset( $_GET['atap_qt'] ) ? sanitize_key( wp_unslash( $_GET['atap_qt'] ) ) : '';
    … …  
    517522                // ---------------- main stage
    518523                echo '<section class="atap-kb-stage">';
    519                 $title = $sel_doc ? '' : ( $sel_read ? '' : ( $sel_copy ? __( 'New Article From a Copy', 'atap-ai-customer-service' ) : ( 'upload' === $mode ? __( 'Upload Documents', 'atap-ai-customer-service' ) : __( 'Write or Paste an Article', 'atap-ai-customer-service' ) ) ) );
     524                $title = $sel_doc ? '' : ( $sel_read ? '' : ( $sel_copy ? __( 'New Article From a Copy', 'atap-ai-customer-service' ) : ( 'selling' === $mode ? '' : ( 'upload' === $mode ? __( 'Upload Documents', 'atap-ai-customer-service' ) : __( 'Write or Paste an Article', 'atap-ai-customer-service' ) ) ) ) );
    520525                echo '<div class="atap-kb-bar"><h2 class="atap-kb-title">' . esc_html( $title ) . '</h2><div class="atap-kb-actions">';
    521526                $w_on = ! $sel_doc && ! $sel_read && 'write' === $mode;
    … …  
    523528                echo '<a class="button ' . ( $w_on ? 'button-primary' : '' ) . '" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge' ) ) . '">' . esc_html__( 'Write', 'atap-ai-customer-service' ) . '</a> ';
    524529                echo '<a class="button ' . ( $u_on ? 'button-primary' : '' ) . '" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge&atap_mode=upload' ) ) . '">' . esc_html__( 'Upload', 'atap-ai-customer-service' ) . '</a>';
     530                $s_on = ! $sel_doc && ! $sel_read && 'selling' === $mode;
     531                echo ' <a class="button ' . ( $s_on ? 'button-primary' : '' ) . '" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge&atap_mode=selling' ) ) . '">' . esc_html__( 'Selling Points', 'atap-ai-customer-service' ) . '</a>';
    525532                echo '</div></div>';
    526533                if ( ! $lib['ok'] ) {
    … …  
    532539                } elseif ( $sel_copy ) {
    533540                        self::stage_write( $sel_copy );
     541                } elseif ( 'selling' === $mode ) {
     542                        self::stage_selling( $sel_sell );
    534543                } elseif ( 'upload' === $mode ) {
    535544                        self::stage_upload();
    … …  
    776785
    777786        /** A page, post or product from the site: what the assistant read, and the way to fix it - the WordPress editor. */
     787        /**
     788         * Selling Points: aTap asks what makes the business and each product special, and the chat sells with the answers.
     789         * The questions, the words and the saving are aTap's; the page talks to this site's own admin-ajax (selling_ajax).
     790         */
     791        private static function stage_selling( $subject ) {
     792                wp_enqueue_script( 'atap-selling', ATAP_URL . 'assets/selling-points.js', array(), self::asset_ver( 'selling-points.js' ), true );
     793                wp_add_inline_script(
     794                        'atap-selling',
     795                        '(function(){var c=' . wp_json_encode(
     796                                array(
     797                                        'ajax'    => admin_url( 'admin-ajax.php' ),
     798                                        'nonce'   => wp_create_nonce( 'atap_selling' ),
     799                                        'subject' => $subject,
     800                                )
     801                        ) . ';AtapSelling.mount(document.getElementById("atap-selling"),function(d){var b=new FormData();b.append("action","atap_selling");'
     802                        . 'b.append("nonce",c.nonce);b.append("data",JSON.stringify(d));return fetch(c.ajax,{method:"POST",body:b,credentials:"same-origin"})'
     803                        . '.then(function(r){return r.json();}).then(function(j){return j.data||{};});},c.subject);})();'
     804                );
     805                echo '<div id="atap-selling"></div>';
     806        }
     807
     808        /** admin-ajax: one step of Selling Points, sent on to aTap with the site key. */
     809        public static function selling_ajax() {
     810                check_ajax_referer( 'atap_selling', 'nonce' );
     811                if ( ! current_user_can( self::CAP ) ) {
     812                        wp_send_json_error( array( 'error' => __( 'Not allowed.', 'atap-ai-customer-service' ) ), 403 );
     813                }
     814                $in   = json_decode( isset( $_POST['data'] ) ? wp_unslash( $_POST['data'] ) : '', true ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- JSON; every value is sanitized below
     815                $in   = is_array( $in ) ? $in : array();
     816                $send = array();
     817                foreach ( array( 'do', 'subject', 'question', 'find' ) as $k ) {
     818                        $send[ $k ] = isset( $in[ $k ] ) && is_string( $in[ $k ] ) ? sanitize_text_field( $in[ $k ] ) : '';
     819                }
     820                foreach ( array( 'answer', 'more' ) as $k ) {
     821                        $send[ $k ] = isset( $in[ $k ] ) && is_string( $in[ $k ] ) ? sanitize_textarea_field( $in[ $k ] ) : '';
     822                }
     823                $send['points'] = array();
     824                foreach ( isset( $in['points'] ) && is_array( $in['points'] ) ? array_slice( $in['points'], 0, 8 ) : array() as $p ) {
     825                        $send['points'][] = is_string( $p ) ? sanitize_textarea_field( $p ) : '';
     826                }
     827                $user            = wp_get_current_user();
     828                $send['wp_user'] = array(
     829                        'name'  => $user->display_name,
     830                        'email' => $user->user_email,
     831                );
     832                $res             = ATap_Api::post( '/api/wp/selling-points', $send, 80 );
     833                if ( ! $res['ok'] ) {
     834                        wp_send_json_error( array( 'error' => $res['error'] ? $res['error'] : __( 'aTap could not be reached just now.', 'atap-ai-customer-service' ) ) );
     835                }
     836                wp_send_json_success( $res['body'] );
     837        }
     838
    778839        private static function stage_site_item( $key, $learned ) {
    779840                $id = (int) preg_replace( '/^post:/', '', $key );
    … …  
    786847                                echo '<a class="button button-primary" href="' . esc_url( $edit ) . '">' . esc_html__( 'Edit in WordPress', 'atap-ai-customer-service' ) . '</a> ';
    787848                        }
    788                         echo '<a class="button" target="_blank" rel="noopener" href="' . esc_url( get_permalink( $p ) ) . '">' . esc_html__( 'View on Site', 'atap-ai-customer-service' ) . '</a></p>';
     849                        echo '<a class="button" target="_blank" rel="noopener" href="' . esc_url( get_permalink( $p ) ) . '">' . esc_html__( 'View on Site', 'atap-ai-customer-service' ) . '</a>';
     850                        if ( isset( $learned[ $key ] ) && in_array( $p->post_type, array( 'product', 'download', 'fluent-products' ), true ) ) {
     851                                echo ' <a class="button" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge&atap_mode=selling&atap_sell=' . rawurlencode( $key ) ) ) . '">' . esc_html__( 'Selling Points', 'atap-ai-customer-service' ) . '</a>';
     852                        }
     853                        echo '</p>';
    789854                }
    790855                if ( ! isset( $learned[ $key ] ) ) {
    … …  
    21702235        }
    21712236
     2237        /*
     2238         * COMPANY INFO (1.3.3; David, 2026-12-03: "they just type out their hours Monday through Friday 9:00 to 5:00 Saturday and
     2239         * Sunday 10:00 to 12:00 done" / "how many locations do you have"). Kept in the business's aTap account; nothing is stored here.
     2240         */
     2241        public static function page_company() {
     2242                self::header( __( 'Company Info', 'atap-ai-customer-service' ) );
     2243                if ( ! self::require_connection() ) {
     2244                        return;
     2245                }
     2246                $r = ATap_Api::get( '/api/wp/company' );
     2247                if ( ! $r['ok'] ) {
     2248                        self::error_box( $r );
     2249                        self::footer();
     2250                        return;
     2251                }
     2252                $about  = isset( $r['body']['about'] ) ? (array) $r['body']['about'] : array();
     2253                $page   = ! empty( $about['page'] ) ? (array) $about['page'] : array();
     2254                $places = ! empty( $r['body']['places'] ) ? array_values( (array) $r['body']['places'] ) : array( array() );
     2255                echo '<div class="atap-card"><form method="post" action="' . esc_url( admin_url( 'admin-post.php' ) ) . '">';
     2256                wp_nonce_field( 'atap_company' );
     2257                echo '<input type="hidden" name="action" value="atap_company">';
     2258                echo '<h2>' . esc_html__( 'About Your Business', 'atap-ai-customer-service' ) . '</h2>';
     2259                echo '<p><label><input type="checkbox" id="atap-own-about" name="use_page" value="1" ' . checked( ! empty( $about['use_page'] ), true, false ) . '> <strong>' . esc_html__( 'We Have Our Own About Page', 'atap-ai-customer-service' ) . '</strong></label></p>';
     2260                echo '<p class="description atap-own-note">' . ( $page
     2261                        /* translators: %s: the title of the website's About page */
     2262                        ? esc_html( sprintf( __( 'Your assistant uses the page "%s".', 'atap-ai-customer-service' ), $page['title'] ) )
     2263                        : esc_html__( 'We did not find an About page on your website yet. Your assistant uses what you type below until there is one.', 'atap-ai-customer-service' ) ) . '</p>';
     2264                echo '<p class="atap-bio" data-page="' . ( $page ? '1' : '0' ) . '"><label>' . esc_html__( 'Tell customers about your business: what you do and anything special.', 'atap-ai-customer-service' ) . '<br><textarea class="large-text" rows="6" maxlength="4000" name="bio" placeholder="' . esc_attr__( 'Family owned since 1998. Pet friendly. Veterans discount. Everything we sell is made in the USA.', 'atap-ai-customer-service' ) . '">' . esc_textarea( isset( $about['bio'] ) ? (string) $about['bio'] : '' ) . '</textarea></label></p>';
     2265                if ( ! empty( $r['body']['platform'] ) ) {
     2266                        echo '<p>' . esc_html__( 'Your locations and hours come from your own system. Change them there and your assistant uses them.', 'atap-ai-customer-service' ) . '</p>';
     2267                        submit_button( __( 'Save', 'atap-ai-customer-service' ) );
     2268                        echo '</form></div>';
     2269                        self::footer();
     2270                        return;
     2271                }
     2272                echo '<h2>' . esc_html__( 'Locations and Hours', 'atap-ai-customer-service' ) . '</h2><p class="description">' . esc_html__( 'Type them the way you would say them. Your assistant tells customers exactly this.', 'atap-ai-customer-service' ) . '</p>';
     2273                echo '<p><label><strong>' . esc_html__( 'How Many Locations Do You Have?', 'atap-ai-customer-service' ) . '</strong> <input type="number" min="1" max="50" id="atap-place-count" name="place_count" class="small-text" value="' . esc_attr( (string) count( $places ) ) . '"></label></p>';
     2274                echo '<div id="atap-places" class="atap-places">';
     2275                foreach ( $places as $i => $p ) {
     2276                        self::place_card( $i, (array) $p );
     2277                }
     2278                echo '</div><template id="atap-place-new">';
     2279                self::place_card( 999, array() );
     2280                echo '</template>';
     2281                submit_button( __( 'Save', 'atap-ai-customer-service' ) );
     2282                echo '</form></div>';
     2283                self::footer();
     2284        }
     2285
     2286        private static function place_card( $i, $p ) {
     2287                $fields = array(
     2288                        'name'    => __( 'Name', 'atap-ai-customer-service' ),
     2289                        'address' => __( 'Address', 'atap-ai-customer-service' ),
     2290                        'phone'   => __( 'Phone', 'atap-ai-customer-service' ),
     2291                );
     2292                /* translators: %s: the location's number, e.g. 2 */
     2293                echo '<div class="atap-place"><h3>' . sprintf( esc_html__( 'Location %s', 'atap-ai-customer-service' ), '<span class="atap-place-n">' . esc_html( (string) ( $i + 1 ) ) . '</span>' ) . '</h3>';
     2294                foreach ( $fields as $k => $label ) {
     2295                        echo '<p><label>' . esc_html( $label ) . '<br><input type="text" class="widefat" name="places[' . esc_attr( (string) $i ) . '][' . esc_attr( $k ) . ']" value="' . esc_attr( isset( $p[ $k ] ) ? (string) $p[ $k ] : '' ) . '"></label></p>';
     2296                }
     2297                echo '<p><label>' . esc_html__( 'Hours', 'atap-ai-customer-service' ) . '<br><textarea class="widefat" rows="3" maxlength="500" name="places[' . esc_attr( (string) $i ) . '][hours]" placeholder="' . esc_attr__( 'Monday through Friday 9:00 to 5:00, Saturday and Sunday 10:00 to 12:00', 'atap-ai-customer-service' ) . '">' . esc_textarea( isset( $p['hours'] ) ? (string) $p['hours'] : '' ) . '</textarea></label></p></div>';
     2298        }
     2299
     2300        public static function save_company() {
     2301                if ( ! current_user_can( self::CAP ) ) {
     2302                        wp_die( esc_html__( 'You are not allowed to do that.', 'atap-ai-customer-service' ) );
     2303                }
     2304                check_admin_referer( 'atap_company' );
     2305                $count = isset( $_POST['place_count'] ) ? max( 1, min( 50, absint( $_POST['place_count'] ) ) ) : 1;
     2306                $sent  = isset( $_POST['places'] ) && is_array( $_POST['places'] ) ? array_slice( array_values( wp_unslash( $_POST['places'] ) ), 0, $count ) : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- each field is sanitized below.
     2307                $out   = array();
     2308                foreach ( $sent as $p ) {
     2309                        $row = array();
     2310                        foreach ( array( 'name', 'address', 'phone', 'hours' ) as $k ) {
     2311                                $v         = isset( $p[ $k ] ) && is_string( $p[ $k ] ) ? $p[ $k ] : '';
     2312                                $row[ $k ] = 'hours' === $k ? sanitize_textarea_field( $v ) : sanitize_text_field( $v );
     2313                        }
     2314                        $out[] = $row;
     2315                }
     2316                $res = ATap_Api::post(
     2317                        '/api/wp/company',
     2318                        array(
     2319                                'places'   => $out,
     2320                                'use_page' => ! empty( $_POST['use_page'] ),
     2321                                'bio'      => isset( $_POST['bio'] ) ? sanitize_textarea_field( wp_unslash( $_POST['bio'] ) ) : '',
     2322                        )
     2323                );
     2324                ATap_Connect::notice( $res['ok'] ? 'success' : 'error', $res['ok'] ? __( 'Saved. Your assistant uses it now.', 'atap-ai-customer-service' ) : $res['error'] );
     2325                wp_safe_redirect( admin_url( 'admin.php?page=atap-company' ) );
     2326                exit;
     2327        }
     2328
    21722329        // ------------------------------------------------------------------ Settings
    21732330        public static function page_settings() {
  • atap-ai-customer-service/tags/1.3.3/includes/class-atap-owner.php

    r3841509 r3843715  
    105105                                'question' => mb_substr( $question, 0, 1000 ),
    106106                                'wp_user'  => array(
    107                                         'id'   => (int) $user->ID,
    108                                         'name' => $user->display_name,
     107                                        'id'    => (int) $user->ID,
     108                                        'name'  => $user->display_name,
     109                                        'email' => $user->user_email,
    109110                                ),
    110111                        ),
    … …  
    135136                echo '<form class="atap-owner-form"><input type="text" class="widefat atap-owner-q" maxlength="1000" placeholder="' . esc_attr__( 'How many orders did we get yesterday?', 'atap-ai-customer-service' ) . '" aria-label="' . esc_attr__( 'Your question', 'atap-ai-customer-service' ) . '"> ';
    136137                echo '<p><button type="submit" class="button button-primary">' . esc_html__( 'Ask', 'atap-ai-customer-service' ) . '</button></p></form>';
    137                 echo '<div class="atap-owner-a" aria-live="polite" style="white-space:pre-wrap"></div></div>';
     138                echo '<div class="atap-owner-a" aria-live="polite" style="white-space:pre-wrap"></div>';
     139                echo '<p class="description">' . esc_html__( 'AI can misunderstand things or get them wrong. Check it yourself before you act on it.', 'atap-ai-customer-service' ) . '</p></div>';
    138140        }
    139141}
  • atap-ai-customer-service/tags/1.3.3/readme.txt

    r3841571 r3843715  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.3.2
     7Stable tag: 1.3.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    1313== Description ==
    1414
    15 **See it working:** [try the demo sites](https://ai.atapai.com/demo/wp) - a shop, a service business and a news site, each with the chat on it, and the reports their owner sees.
     15**See it working:** [try the demo sites](https://ai.atapai.com/demo/wp) - a shop, a service business and a news site, and the reports their owner sees.
    1616
    1717aTap is an AI shop assistant that works for your business. It answers your customers from what you have already published, shows your products as picture cards, tells signed-in customers about their own orders, keeps wish lists, and reports what visitors ask, look for and could not find.
    … …  
    2626* Products from WooCommerce, Easy Digital Downloads and FluentCart, with prices, options and stock.
    2727* More carts to come.
    28 * Every change you save is learned as soon as you save it.
     28* Every change is learned as soon as you save it.
    2929
    3030**Teach it anything else**
    3131
    32 * Write an article, or upload price lists, manuals, FAQs, warranties and policies (PDF, Word, Excel, PowerPoint, text and more), and tie them to the products they are about.
     32* **Selling Points:** not sure what to write? The AI asks what makes your business and products special, and your chat sells with your answers.
     33* **Company Info:** no About page? Type your story, locations and hours in a few boxes.
     34* Write an article, or upload price lists, manuals, FAQs, warranties and policies (PDF, Word, Excel and more), and tie them to the products they are about.
    3335
    3436**Answers your customers can use**
    3537
    3638* Product cards with picture, price and stock, in the customer's own language.
    37 * On paid plans it can look up what your site does not say, such as a product's full specifications.
     39* On paid plans it can look up what your site does not say.
    3840
    3941**You and your team**
    … …  
    4143* **Chat Manager:** read every chat, and take over one as a person.
    4244* **Learned from Chats:** answers your team gives in live chats are added to what the assistant knows.
    43 * **Learned from Web Lookups:** on paid plans, what a lookup finds about a product is kept with its source. If a lookup finds it is made in China, it knows that from then on.
     45* **Learned from Web Lookups:** on paid plans, what a lookup finds about a product is kept with its source.
    4446
    4547**Plans**
    … …  
    5153**Special launch price for our first 100 businesses on WordPress Professional.**
    5254
    53 Add-ons for paid plans: Order Help, Full Reports, Wish List, More Web Lookups, More Conversations and Team Chat. See the FAQ for what each plan and add-on includes.
    54 
    55 Card details never touch your site or aTap: you pay on Stripe's secure page. The only account you need is your aTap account, created in one step when you press Connect.
     55Add-ons for paid plans: Order Help, Full Reports, Wish List, More Web Lookups, More Conversations and Team Chat. See the FAQ for details.
     56
     57Card details never touch your site or aTap: you pay on Stripe's secure page. The only account you need is your aTap account, created when you press Connect.
    5658
    5759== External services ==
    … …  
    6264* **While connected:** the title, address, text, excerpt, categories, brand and picture address of every published item of the kinds you choose in aTap > Settings - and, for products, price, sale price, SKU, stock and attributes - are sent to aTap, and again whenever one is saved, unpublished or deleted. Drafts, private and password-protected items, and the cart, checkout and account pages, are never sent.
    6365* **Articles and documents you add** in aTap > Knowledge are sent to aTap and stored there, so the assistant can answer from them. You can remove any of them at any time.
     66* **Company Info:** the locations, addresses, phone numbers, opening hours and notes about your business you type in aTap > Company Info are sent to aTap and stored there, so the assistant can answer from them.
     67* **Selling Points:** what you type or say about your business and products in Selling Points is sent to aTap with your display name and email address, and stored there, so the assistant can use the words you approve. The Speak button uses your browser's own speech recognition, which may send the sound to the browser's maker. When you ask for help with an answer, aTap keeps the question with your name and email address so its team can offer help.
    6468* **On your site's pages:** the chat window script is loaded from https://ai.atapai.com/static/atap-widget.js, and what a visitor types into it is sent to aTap to be answered. The chat window also counts, for your reports, the page it was loaded on (the page's path, without its query string), when it is opened, and which product cards are clicked - counts per day, with no cookies and nothing about the visitor.
    6569* **Customers signed in to your store:** when a visitor is signed in to your site, the chat window asks your site who they are. Your site answers with a short-lived note, signed with a secret your site and aTap share, of their WordPress user id, first and last name, email address and phone number (the billing phone, if they have one), and whether they are one of your site's administrators - an administrator's chats are your own tests, counted on their own and never against your plan. The note goes with their chat messages, and aTap keeps their name, email address and phone number with their chat records, for your records and aTap's. Their first name is also shown at the top of the chat (for example "Welcome, Sam"). Visitors who are not signed in are not identified.
    … …  
    6872* **Orders (on every paid plan (Professional or Business), or while Order Help is on):** each order from your shopping cart is sent as it is placed and as it changes: order number, status, dates, currency, total, items (name, quantity, product id), shipping method, tracking numbers, which cart it came from, and the WordPress user id of the customer. Orders carry no names, addresses, phone numbers, email addresses or payment details. So that a signed-in customer can be told about their own orders, their orders are matched on the user id in the signed note described above.
    6973* **If your site uses SureCart:** SureCart keeps its orders in SureCart's own service. To read them, this plugin uses the SureCart plugin you already have and the connection it already holds: it asks SureCart for an order when SureCart says the order changed, and once an hour for the newest orders. Nothing is asked of you, and the same fields as above are kept.
    70 * **Asking aTap about your shop (paid plans: Professional and Business):** a question typed into "Ask aTap About Your Shop" (on the WordPress Dashboard and the aTap Dashboard), or into the chat window on WordPress's own list and overview screens in admin, is sent from this site's server to aTap with the asking user's WordPress id and display name, and answered about this business only. Only administrators and shop managers can ask.
     74* **Asking aTap about your shop (paid plans: Professional and Business):** a question typed into "Ask aTap About Your Shop" (on the WordPress Dashboard and the aTap Dashboard), or into the chat window on WordPress's own list and overview screens in admin, is sent from this site's server to aTap with the asking user's WordPress id, display name and email address, and answered about this business only. Only administrators and shop managers can ask. When a question asks for advice, aTap keeps it with that name and email address so its team can offer help.
    7175* **Starting a chat:** the first time in a day a visitor opens the chat, they slide a handle to the end (or press the right arrow key). The handle's positions and timings during that slide are sent to aTap to tell a person from an automated script - nothing else about the visitor, no cookie; the result is kept in the browser tab only.
    7276* **Settings:** this plugin's own settings (whether the chat window shows, whether it hides on checkout, the "Powered by aTap" line, which kinds of content are sent), the chat window's colors (color, text color and greeting color), its corner roundness and the logo picture you choose, the names of your site's public content types and your store's country (the two-letter code from WooCommerce or Easy Digital Downloads, used to read phone numbers typed without a country code) are sent to aTap when you save them and hourly, so they also appear - and can be changed - in your aTap account. A change made there is read back here.
    … …  
    151155A small line under the chat window. It is off unless you turn it on: the plugin asks you once after you connect, and you can change your answer at any time in aTap > Chat Widget, or in your aTap account under Plugin Settings > Chat Bubble.
    152156
     157= I do not know what to write about my business or my products. Can it help? =
     158Yes. Open aTap > Knowledge > Selling Points. The AI asks you questions such as why people should buy from you, and you answer the way you would talk to a customer, typed or spoken. If you are stuck, press Help Me Answer for ideas. You can do your whole business, one product, or a whole brand or category. Nothing is used until you approve the words, and you can change them at any time.
     159
     160= My website has no About page. Where do I put my hours and locations? =
     161In aTap > Company Info. Type what customers should know about your business, then the name, address, phone number and hours of each location. The assistant answers from it right away. If your site has its own About page, tick We Have Our Own About Page and it reads that instead.
     162
    153163= What can I upload? =
    154164PDF, Word, PowerPoint, Excel, CSV, plain text, Markdown, HTML, RTF and OpenDocument files, up to 20 MB each, as many as you like.
    … …  
    177187
    178188== Changelog ==
     189
     190= 1.3.3 =
     191* New Selling Points, under Knowledge: the AI asks what makes your business and each product special, one question at a time, typed or spoken. If you do not know what to say, Help Me Answer gives you ideas. You approve the words, and your chat uses them when a customer is deciding.
     192* New Company Info page: type your locations, addresses and opening hours, and what customers should know about your business (pet friendly, vegan, veteran discounts). The assistant answers from it right away. If you already have an About page, tick one box and it reads that instead.
     193* Ask aTap About Your Shop and Selling Points remind you that AI can get things wrong, so check its advice before you act on it.
     194* Deleting a spare, inactive copy of the plugin no longer disconnects your site.
    179195
    180196= 1.3.2 =
  • atap-ai-customer-service/tags/1.3.3/uninstall.php

    r3841326 r3843715  
    77if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    88        exit;
     9}
     10
     11// A spare copy is being deleted while another copy of aTap is running on this site: leave the connection alone.
     12if ( class_exists( 'ATap_Api', false ) ) {
     13        return;
    914}
    1015
  • atap-ai-customer-service/trunk/assets/admin.css

    r3841326 r3843715  
    180180.atap .atap-plan-line1{display:block;font-size:12px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;color:#646970}
    181181.atap .atap-plan-line2{display:block}
     182.atap-places{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
     183.atap-place{border:1px solid #dcdcde;border-radius:8px;padding:4px 14px}
  • atap-ai-customer-service/trunk/assets/admin.js

    r3841326 r3843715  
    479479  });
    480480})();
     481/* Company Info: the number of locations draws that many boxes; "We Have Our Own About Page" hides the box it replaces. */
     482(function () {
     483  var list = document.getElementById('atap-places'), n = document.getElementById('atap-place-count');
     484  var tpl = document.getElementById('atap-place-new'), own = document.getElementById('atap-own-about');
     485  if (n && list && tpl) {
     486    n.addEventListener('input', function () {
     487      var want = Math.min(50, parseInt(n.value, 10) || 0), i, el;
     488      if (want < 1) { return; }
     489      while (list.children.length < want) {
     490        i = list.children.length;
     491        el = document.createElement('div');
     492        el.innerHTML = tpl.innerHTML.split('places[999]').join('places[' + i + ']');
     493        el.querySelector('.atap-place-n').textContent = i + 1;
     494        list.appendChild(el.firstElementChild);
     495      }
     496      for (i = 0; i < list.children.length; i++) { list.children[i].style.display = i < want ? '' : 'none'; }
     497    });
     498  }
     499  if (own) {
     500    var bio = document.querySelector('.atap-bio'), note = document.querySelector('.atap-own-note');
     501    var draw = function () {
     502      note.style.display = own.checked ? '' : 'none';
     503      bio.style.display = own.checked && bio.getAttribute('data-page') === '1' ? 'none' : '';
     504    };
     505    own.addEventListener('change', draw);
     506    draw();
     507  }
     508})();
  • atap-ai-customer-service/trunk/atap.php

    r3841571 r3843715  
    33 * Plugin Name:       aTap – AI Customer Service
    44 * Description:       An AI assistant and business service for your store: answers customers from your own pages, posts and products, and reports on what they ask, want and buy. Manage it all from the aTap menu.
    5  * Version:           1.3.2
     5 * Version:           1.3.3
    66 * Requires at least: 6.0
    77 * Requires PHP:      7.4
    … …  
    1919}
    2020
    21 define( 'ATAP_VERSION', '1.3.2' );
     21define( 'ATAP_VERSION', '1.3.3' );
    2222define( 'ATAP_FILE', __FILE__ );
    2323define( 'ATAP_DIR', plugin_dir_path( __FILE__ ) );
  • atap-ai-customer-service/trunk/includes/class-atap-admin.php

    r3841571 r3843715  
    2727                add_action( 'admin_post_atap_lib_upload', array( __CLASS__, 'lib_upload' ) );
    2828                add_action( 'admin_post_atap_lib_delete', array( __CLASS__, 'lib_delete' ) );
     29                add_action( 'admin_post_atap_company', array( __CLASS__, 'save_company' ) );
     30                add_action( 'wp_ajax_atap_selling', array( __CLASS__, 'selling_ajax' ) );
    2931                add_action( 'admin_post_atap_dismiss_notice', array( __CLASS__, 'dismiss_notice' ) );
    3032        }
    … …  
    8486                        'atap-reports'   => array( __( 'Reports', 'atap-ai-customer-service' ), 'page_reports' ),
    8587                        'atap-billing'   => array( __( 'Subscription & Add-ons', 'atap-ai-customer-service' ), 'page_billing' ),
     88                        'atap-company'   => array( __( 'Company Info', 'atap-ai-customer-service' ), 'page_company' ),
    8689                        'atap-account'   => array( __( 'Account', 'atap-ai-customer-service' ), 'page_account' ),
    8790                        'atap-settings'  => array( __( 'Settings', 'atap-ai-customer-service' ), 'page_settings' ),
    … …  
    134137                        'atap-reports'   => '#reports',
    135138                        'atap-billing'   => '#billing',
     139                        'atap-company'   => '#company-info',
    136140                        'atap-account'   => '#billing',
    137141                        'atap-settings'  => 'choose-what-it-learns',
    … …  
    419423                $sel_copy = isset( $_GET['atap_copy'] ) ? absint( $_GET['atap_copy'] ) : 0;
    420424                $sel_read = isset( $_GET['atap_read'] ) ? sanitize_text_field( wp_unslash( $_GET['atap_read'] ) ) : '';
    421                 $mode     = isset( $_GET['atap_mode'] ) && 'upload' === $_GET['atap_mode'] ? 'upload' : 'write';
     425                $mode     = isset( $_GET['atap_mode'] ) && in_array( $_GET['atap_mode'], array( 'upload', 'selling' ), true ) ? sanitize_key( $_GET['atap_mode'] ) : 'write';
     426                $sel_sell = isset( $_GET['atap_sell'] ) ? sanitize_text_field( wp_unslash( $_GET['atap_sell'] ) ) : '';
    422427                // the sidebar's search for pages, posts and other kinds (1.2.6): which kind, and the words
    423428                $find_t   = isset( $_GET['atap_qt'] ) ? sanitize_key( wp_unslash( $_GET['atap_qt'] ) ) : '';
    … …  
    517522                // ---------------- main stage
    518523                echo '<section class="atap-kb-stage">';
    519                 $title = $sel_doc ? '' : ( $sel_read ? '' : ( $sel_copy ? __( 'New Article From a Copy', 'atap-ai-customer-service' ) : ( 'upload' === $mode ? __( 'Upload Documents', 'atap-ai-customer-service' ) : __( 'Write or Paste an Article', 'atap-ai-customer-service' ) ) ) );
     524                $title = $sel_doc ? '' : ( $sel_read ? '' : ( $sel_copy ? __( 'New Article From a Copy', 'atap-ai-customer-service' ) : ( 'selling' === $mode ? '' : ( 'upload' === $mode ? __( 'Upload Documents', 'atap-ai-customer-service' ) : __( 'Write or Paste an Article', 'atap-ai-customer-service' ) ) ) ) );
    520525                echo '<div class="atap-kb-bar"><h2 class="atap-kb-title">' . esc_html( $title ) . '</h2><div class="atap-kb-actions">';
    521526                $w_on = ! $sel_doc && ! $sel_read && 'write' === $mode;
    … …  
    523528                echo '<a class="button ' . ( $w_on ? 'button-primary' : '' ) . '" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge' ) ) . '">' . esc_html__( 'Write', 'atap-ai-customer-service' ) . '</a> ';
    524529                echo '<a class="button ' . ( $u_on ? 'button-primary' : '' ) . '" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge&atap_mode=upload' ) ) . '">' . esc_html__( 'Upload', 'atap-ai-customer-service' ) . '</a>';
     530                $s_on = ! $sel_doc && ! $sel_read && 'selling' === $mode;
     531                echo ' <a class="button ' . ( $s_on ? 'button-primary' : '' ) . '" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge&atap_mode=selling' ) ) . '">' . esc_html__( 'Selling Points', 'atap-ai-customer-service' ) . '</a>';
    525532                echo '</div></div>';
    526533                if ( ! $lib['ok'] ) {
    … …  
    532539                } elseif ( $sel_copy ) {
    533540                        self::stage_write( $sel_copy );
     541                } elseif ( 'selling' === $mode ) {
     542                        self::stage_selling( $sel_sell );
    534543                } elseif ( 'upload' === $mode ) {
    535544                        self::stage_upload();
    … …  
    776785
    777786        /** A page, post or product from the site: what the assistant read, and the way to fix it - the WordPress editor. */
     787        /**
     788         * Selling Points: aTap asks what makes the business and each product special, and the chat sells with the answers.
     789         * The questions, the words and the saving are aTap's; the page talks to this site's own admin-ajax (selling_ajax).
     790         */
     791        private static function stage_selling( $subject ) {
     792                wp_enqueue_script( 'atap-selling', ATAP_URL . 'assets/selling-points.js', array(), self::asset_ver( 'selling-points.js' ), true );
     793                wp_add_inline_script(
     794                        'atap-selling',
     795                        '(function(){var c=' . wp_json_encode(
     796                                array(
     797                                        'ajax'    => admin_url( 'admin-ajax.php' ),
     798                                        'nonce'   => wp_create_nonce( 'atap_selling' ),
     799                                        'subject' => $subject,
     800                                )
     801                        ) . ';AtapSelling.mount(document.getElementById("atap-selling"),function(d){var b=new FormData();b.append("action","atap_selling");'
     802                        . 'b.append("nonce",c.nonce);b.append("data",JSON.stringify(d));return fetch(c.ajax,{method:"POST",body:b,credentials:"same-origin"})'
     803                        . '.then(function(r){return r.json();}).then(function(j){return j.data||{};});},c.subject);})();'
     804                );
     805                echo '<div id="atap-selling"></div>';
     806        }
     807
     808        /** admin-ajax: one step of Selling Points, sent on to aTap with the site key. */
     809        public static function selling_ajax() {
     810                check_ajax_referer( 'atap_selling', 'nonce' );
     811                if ( ! current_user_can( self::CAP ) ) {
     812                        wp_send_json_error( array( 'error' => __( 'Not allowed.', 'atap-ai-customer-service' ) ), 403 );
     813                }
     814                $in   = json_decode( isset( $_POST['data'] ) ? wp_unslash( $_POST['data'] ) : '', true ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- JSON; every value is sanitized below
     815                $in   = is_array( $in ) ? $in : array();
     816                $send = array();
     817                foreach ( array( 'do', 'subject', 'question', 'find' ) as $k ) {
     818                        $send[ $k ] = isset( $in[ $k ] ) && is_string( $in[ $k ] ) ? sanitize_text_field( $in[ $k ] ) : '';
     819                }
     820                foreach ( array( 'answer', 'more' ) as $k ) {
     821                        $send[ $k ] = isset( $in[ $k ] ) && is_string( $in[ $k ] ) ? sanitize_textarea_field( $in[ $k ] ) : '';
     822                }
     823                $send['points'] = array();
     824                foreach ( isset( $in['points'] ) && is_array( $in['points'] ) ? array_slice( $in['points'], 0, 8 ) : array() as $p ) {
     825                        $send['points'][] = is_string( $p ) ? sanitize_textarea_field( $p ) : '';
     826                }
     827                $user            = wp_get_current_user();
     828                $send['wp_user'] = array(
     829                        'name'  => $user->display_name,
     830                        'email' => $user->user_email,
     831                );
     832                $res             = ATap_Api::post( '/api/wp/selling-points', $send, 80 );
     833                if ( ! $res['ok'] ) {
     834                        wp_send_json_error( array( 'error' => $res['error'] ? $res['error'] : __( 'aTap could not be reached just now.', 'atap-ai-customer-service' ) ) );
     835                }
     836                wp_send_json_success( $res['body'] );
     837        }
     838
    778839        private static function stage_site_item( $key, $learned ) {
    779840                $id = (int) preg_replace( '/^post:/', '', $key );
    … …  
    786847                                echo '<a class="button button-primary" href="' . esc_url( $edit ) . '">' . esc_html__( 'Edit in WordPress', 'atap-ai-customer-service' ) . '</a> ';
    787848                        }
    788                         echo '<a class="button" target="_blank" rel="noopener" href="' . esc_url( get_permalink( $p ) ) . '">' . esc_html__( 'View on Site', 'atap-ai-customer-service' ) . '</a></p>';
     849                        echo '<a class="button" target="_blank" rel="noopener" href="' . esc_url( get_permalink( $p ) ) . '">' . esc_html__( 'View on Site', 'atap-ai-customer-service' ) . '</a>';
     850                        if ( isset( $learned[ $key ] ) && in_array( $p->post_type, array( 'product', 'download', 'fluent-products' ), true ) ) {
     851                                echo ' <a class="button" href="' . esc_url( admin_url( 'admin.php?page=atap-knowledge&atap_mode=selling&atap_sell=' . rawurlencode( $key ) ) ) . '">' . esc_html__( 'Selling Points', 'atap-ai-customer-service' ) . '</a>';
     852                        }
     853                        echo '</p>';
    789854                }
    790855                if ( ! isset( $learned[ $key ] ) ) {
    … …  
    21702235        }
    21712236
     2237        /*
     2238         * COMPANY INFO (1.3.3; David, 2026-12-03: "they just type out their hours Monday through Friday 9:00 to 5:00 Saturday and
     2239         * Sunday 10:00 to 12:00 done" / "how many locations do you have"). Kept in the business's aTap account; nothing is stored here.
     2240         */
     2241        public static function page_company() {
     2242                self::header( __( 'Company Info', 'atap-ai-customer-service' ) );
     2243                if ( ! self::require_connection() ) {
     2244                        return;
     2245                }
     2246                $r = ATap_Api::get( '/api/wp/company' );
     2247                if ( ! $r['ok'] ) {
     2248                        self::error_box( $r );
     2249                        self::footer();
     2250                        return;
     2251                }
     2252                $about  = isset( $r['body']['about'] ) ? (array) $r['body']['about'] : array();
     2253                $page   = ! empty( $about['page'] ) ? (array) $about['page'] : array();
     2254                $places = ! empty( $r['body']['places'] ) ? array_values( (array) $r['body']['places'] ) : array( array() );
     2255                echo '<div class="atap-card"><form method="post" action="' . esc_url( admin_url( 'admin-post.php' ) ) . '">';
     2256                wp_nonce_field( 'atap_company' );
     2257                echo '<input type="hidden" name="action" value="atap_company">';
     2258                echo '<h2>' . esc_html__( 'About Your Business', 'atap-ai-customer-service' ) . '</h2>';
     2259                echo '<p><label><input type="checkbox" id="atap-own-about" name="use_page" value="1" ' . checked( ! empty( $about['use_page'] ), true, false ) . '> <strong>' . esc_html__( 'We Have Our Own About Page', 'atap-ai-customer-service' ) . '</strong></label></p>';
     2260                echo '<p class="description atap-own-note">' . ( $page
     2261                        /* translators: %s: the title of the website's About page */
     2262                        ? esc_html( sprintf( __( 'Your assistant uses the page "%s".', 'atap-ai-customer-service' ), $page['title'] ) )
     2263                        : esc_html__( 'We did not find an About page on your website yet. Your assistant uses what you type below until there is one.', 'atap-ai-customer-service' ) ) . '</p>';
     2264                echo '<p class="atap-bio" data-page="' . ( $page ? '1' : '0' ) . '"><label>' . esc_html__( 'Tell customers about your business: what you do and anything special.', 'atap-ai-customer-service' ) . '<br><textarea class="large-text" rows="6" maxlength="4000" name="bio" placeholder="' . esc_attr__( 'Family owned since 1998. Pet friendly. Veterans discount. Everything we sell is made in the USA.', 'atap-ai-customer-service' ) . '">' . esc_textarea( isset( $about['bio'] ) ? (string) $about['bio'] : '' ) . '</textarea></label></p>';
     2265                if ( ! empty( $r['body']['platform'] ) ) {
     2266                        echo '<p>' . esc_html__( 'Your locations and hours come from your own system. Change them there and your assistant uses them.', 'atap-ai-customer-service' ) . '</p>';
     2267                        submit_button( __( 'Save', 'atap-ai-customer-service' ) );
     2268                        echo '</form></div>';
     2269                        self::footer();
     2270                        return;
     2271                }
     2272                echo '<h2>' . esc_html__( 'Locations and Hours', 'atap-ai-customer-service' ) . '</h2><p class="description">' . esc_html__( 'Type them the way you would say them. Your assistant tells customers exactly this.', 'atap-ai-customer-service' ) . '</p>';
     2273                echo '<p><label><strong>' . esc_html__( 'How Many Locations Do You Have?', 'atap-ai-customer-service' ) . '</strong> <input type="number" min="1" max="50" id="atap-place-count" name="place_count" class="small-text" value="' . esc_attr( (string) count( $places ) ) . '"></label></p>';
     2274                echo '<div id="atap-places" class="atap-places">';
     2275                foreach ( $places as $i => $p ) {
     2276                        self::place_card( $i, (array) $p );
     2277                }
     2278                echo '</div><template id="atap-place-new">';
     2279                self::place_card( 999, array() );
     2280                echo '</template>';
     2281                submit_button( __( 'Save', 'atap-ai-customer-service' ) );
     2282                echo '</form></div>';
     2283                self::footer();
     2284        }
     2285
     2286        private static function place_card( $i, $p ) {
     2287                $fields = array(
     2288                        'name'    => __( 'Name', 'atap-ai-customer-service' ),
     2289                        'address' => __( 'Address', 'atap-ai-customer-service' ),
     2290                        'phone'   => __( 'Phone', 'atap-ai-customer-service' ),
     2291                );
     2292                /* translators: %s: the location's number, e.g. 2 */
     2293                echo '<div class="atap-place"><h3>' . sprintf( esc_html__( 'Location %s', 'atap-ai-customer-service' ), '<span class="atap-place-n">' . esc_html( (string) ( $i + 1 ) ) . '</span>' ) . '</h3>';
     2294                foreach ( $fields as $k => $label ) {
     2295                        echo '<p><label>' . esc_html( $label ) . '<br><input type="text" class="widefat" name="places[' . esc_attr( (string) $i ) . '][' . esc_attr( $k ) . ']" value="' . esc_attr( isset( $p[ $k ] ) ? (string) $p[ $k ] : '' ) . '"></label></p>';
     2296                }
     2297                echo '<p><label>' . esc_html__( 'Hours', 'atap-ai-customer-service' ) . '<br><textarea class="widefat" rows="3" maxlength="500" name="places[' . esc_attr( (string) $i ) . '][hours]" placeholder="' . esc_attr__( 'Monday through Friday 9:00 to 5:00, Saturday and Sunday 10:00 to 12:00', 'atap-ai-customer-service' ) . '">' . esc_textarea( isset( $p['hours'] ) ? (string) $p['hours'] : '' ) . '</textarea></label></p></div>';
     2298        }
     2299
     2300        public static function save_company() {
     2301                if ( ! current_user_can( self::CAP ) ) {
     2302                        wp_die( esc_html__( 'You are not allowed to do that.', 'atap-ai-customer-service' ) );
     2303                }
     2304                check_admin_referer( 'atap_company' );
     2305                $count = isset( $_POST['place_count'] ) ? max( 1, min( 50, absint( $_POST['place_count'] ) ) ) : 1;
     2306                $sent  = isset( $_POST['places'] ) && is_array( $_POST['places'] ) ? array_slice( array_values( wp_unslash( $_POST['places'] ) ), 0, $count ) : array(); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- each field is sanitized below.
     2307                $out   = array();
     2308                foreach ( $sent as $p ) {
     2309                        $row = array();
     2310                        foreach ( array( 'name', 'address', 'phone', 'hours' ) as $k ) {
     2311                                $v         = isset( $p[ $k ] ) && is_string( $p[ $k ] ) ? $p[ $k ] : '';
     2312                                $row[ $k ] = 'hours' === $k ? sanitize_textarea_field( $v ) : sanitize_text_field( $v );
     2313                        }
     2314                        $out[] = $row;
     2315                }
     2316                $res = ATap_Api::post(
     2317                        '/api/wp/company',
     2318                        array(
     2319                                'places'   => $out,
     2320                                'use_page' => ! empty( $_POST['use_page'] ),
     2321                                'bio'      => isset( $_POST['bio'] ) ? sanitize_textarea_field( wp_unslash( $_POST['bio'] ) ) : '',
     2322                        )
     2323                );
     2324                ATap_Connect::notice( $res['ok'] ? 'success' : 'error', $res['ok'] ? __( 'Saved. Your assistant uses it now.', 'atap-ai-customer-service' ) : $res['error'] );
     2325                wp_safe_redirect( admin_url( 'admin.php?page=atap-company' ) );
     2326                exit;
     2327        }
     2328
    21722329        // ------------------------------------------------------------------ Settings
    21732330        public static function page_settings() {
  • atap-ai-customer-service/trunk/includes/class-atap-owner.php

    r3841509 r3843715  
    105105                                'question' => mb_substr( $question, 0, 1000 ),
    106106                                'wp_user'  => array(
    107                                         'id'   => (int) $user->ID,
    108                                         'name' => $user->display_name,
     107                                        'id'    => (int) $user->ID,
     108                                        'name'  => $user->display_name,
     109                                        'email' => $user->user_email,
    109110                                ),
    110111                        ),
    … …  
    135136                echo '<form class="atap-owner-form"><input type="text" class="widefat atap-owner-q" maxlength="1000" placeholder="' . esc_attr__( 'How many orders did we get yesterday?', 'atap-ai-customer-service' ) . '" aria-label="' . esc_attr__( 'Your question', 'atap-ai-customer-service' ) . '"> ';
    136137                echo '<p><button type="submit" class="button button-primary">' . esc_html__( 'Ask', 'atap-ai-customer-service' ) . '</button></p></form>';
    137                 echo '<div class="atap-owner-a" aria-live="polite" style="white-space:pre-wrap"></div></div>';
     138                echo '<div class="atap-owner-a" aria-live="polite" style="white-space:pre-wrap"></div>';
     139                echo '<p class="description">' . esc_html__( 'AI can misunderstand things or get them wrong. Check it yourself before you act on it.', 'atap-ai-customer-service' ) . '</p></div>';
    138140        }
    139141}
  • atap-ai-customer-service/trunk/readme.txt

    r3841571 r3843715  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.3.2
     7Stable tag: 1.3.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    1313== Description ==
    1414
    15 **See it working:** [try the demo sites](https://ai.atapai.com/demo/wp) - a shop, a service business and a news site, each with the chat on it, and the reports their owner sees.
     15**See it working:** [try the demo sites](https://ai.atapai.com/demo/wp) - a shop, a service business and a news site, and the reports their owner sees.
    1616
    1717aTap is an AI shop assistant that works for your business. It answers your customers from what you have already published, shows your products as picture cards, tells signed-in customers about their own orders, keeps wish lists, and reports what visitors ask, look for and could not find.
    … …  
    2626* Products from WooCommerce, Easy Digital Downloads and FluentCart, with prices, options and stock.
    2727* More carts to come.
    28 * Every change you save is learned as soon as you save it.
     28* Every change is learned as soon as you save it.
    2929
    3030**Teach it anything else**
    3131
    32 * Write an article, or upload price lists, manuals, FAQs, warranties and policies (PDF, Word, Excel, PowerPoint, text and more), and tie them to the products they are about.
     32* **Selling Points:** not sure what to write? The AI asks what makes your business and products special, and your chat sells with your answers.
     33* **Company Info:** no About page? Type your story, locations and hours in a few boxes.
     34* Write an article, or upload price lists, manuals, FAQs, warranties and policies (PDF, Word, Excel and more), and tie them to the products they are about.
    3335
    3436**Answers your customers can use**
    3537
    3638* Product cards with picture, price and stock, in the customer's own language.
    37 * On paid plans it can look up what your site does not say, such as a product's full specifications.
     39* On paid plans it can look up what your site does not say.
    3840
    3941**You and your team**
    … …  
    4143* **Chat Manager:** read every chat, and take over one as a person.
    4244* **Learned from Chats:** answers your team gives in live chats are added to what the assistant knows.
    43 * **Learned from Web Lookups:** on paid plans, what a lookup finds about a product is kept with its source. If a lookup finds it is made in China, it knows that from then on.
     45* **Learned from Web Lookups:** on paid plans, what a lookup finds about a product is kept with its source.
    4446
    4547**Plans**
    … …  
    5153**Special launch price for our first 100 businesses on WordPress Professional.**
    5254
    53 Add-ons for paid plans: Order Help, Full Reports, Wish List, More Web Lookups, More Conversations and Team Chat. See the FAQ for what each plan and add-on includes.
    54 
    55 Card details never touch your site or aTap: you pay on Stripe's secure page. The only account you need is your aTap account, created in one step when you press Connect.
     55Add-ons for paid plans: Order Help, Full Reports, Wish List, More Web Lookups, More Conversations and Team Chat. See the FAQ for details.
     56
     57Card details never touch your site or aTap: you pay on Stripe's secure page. The only account you need is your aTap account, created when you press Connect.
    5658
    5759== External services ==
    … …  
    6264* **While connected:** the title, address, text, excerpt, categories, brand and picture address of every published item of the kinds you choose in aTap > Settings - and, for products, price, sale price, SKU, stock and attributes - are sent to aTap, and again whenever one is saved, unpublished or deleted. Drafts, private and password-protected items, and the cart, checkout and account pages, are never sent.
    6365* **Articles and documents you add** in aTap > Knowledge are sent to aTap and stored there, so the assistant can answer from them. You can remove any of them at any time.
     66* **Company Info:** the locations, addresses, phone numbers, opening hours and notes about your business you type in aTap > Company Info are sent to aTap and stored there, so the assistant can answer from them.
     67* **Selling Points:** what you type or say about your business and products in Selling Points is sent to aTap with your display name and email address, and stored there, so the assistant can use the words you approve. The Speak button uses your browser's own speech recognition, which may send the sound to the browser's maker. When you ask for help with an answer, aTap keeps the question with your name and email address so its team can offer help.
    6468* **On your site's pages:** the chat window script is loaded from https://ai.atapai.com/static/atap-widget.js, and what a visitor types into it is sent to aTap to be answered. The chat window also counts, for your reports, the page it was loaded on (the page's path, without its query string), when it is opened, and which product cards are clicked - counts per day, with no cookies and nothing about the visitor.
    6569* **Customers signed in to your store:** when a visitor is signed in to your site, the chat window asks your site who they are. Your site answers with a short-lived note, signed with a secret your site and aTap share, of their WordPress user id, first and last name, email address and phone number (the billing phone, if they have one), and whether they are one of your site's administrators - an administrator's chats are your own tests, counted on their own and never against your plan. The note goes with their chat messages, and aTap keeps their name, email address and phone number with their chat records, for your records and aTap's. Their first name is also shown at the top of the chat (for example "Welcome, Sam"). Visitors who are not signed in are not identified.
    … …  
    6872* **Orders (on every paid plan (Professional or Business), or while Order Help is on):** each order from your shopping cart is sent as it is placed and as it changes: order number, status, dates, currency, total, items (name, quantity, product id), shipping method, tracking numbers, which cart it came from, and the WordPress user id of the customer. Orders carry no names, addresses, phone numbers, email addresses or payment details. So that a signed-in customer can be told about their own orders, their orders are matched on the user id in the signed note described above.
    6973* **If your site uses SureCart:** SureCart keeps its orders in SureCart's own service. To read them, this plugin uses the SureCart plugin you already have and the connection it already holds: it asks SureCart for an order when SureCart says the order changed, and once an hour for the newest orders. Nothing is asked of you, and the same fields as above are kept.
    70 * **Asking aTap about your shop (paid plans: Professional and Business):** a question typed into "Ask aTap About Your Shop" (on the WordPress Dashboard and the aTap Dashboard), or into the chat window on WordPress's own list and overview screens in admin, is sent from this site's server to aTap with the asking user's WordPress id and display name, and answered about this business only. Only administrators and shop managers can ask.
     74* **Asking aTap about your shop (paid plans: Professional and Business):** a question typed into "Ask aTap About Your Shop" (on the WordPress Dashboard and the aTap Dashboard), or into the chat window on WordPress's own list and overview screens in admin, is sent from this site's server to aTap with the asking user's WordPress id, display name and email address, and answered about this business only. Only administrators and shop managers can ask. When a question asks for advice, aTap keeps it with that name and email address so its team can offer help.
    7175* **Starting a chat:** the first time in a day a visitor opens the chat, they slide a handle to the end (or press the right arrow key). The handle's positions and timings during that slide are sent to aTap to tell a person from an automated script - nothing else about the visitor, no cookie; the result is kept in the browser tab only.
    7276* **Settings:** this plugin's own settings (whether the chat window shows, whether it hides on checkout, the "Powered by aTap" line, which kinds of content are sent), the chat window's colors (color, text color and greeting color), its corner roundness and the logo picture you choose, the names of your site's public content types and your store's country (the two-letter code from WooCommerce or Easy Digital Downloads, used to read phone numbers typed without a country code) are sent to aTap when you save them and hourly, so they also appear - and can be changed - in your aTap account. A change made there is read back here.
    … …  
    151155A small line under the chat window. It is off unless you turn it on: the plugin asks you once after you connect, and you can change your answer at any time in aTap > Chat Widget, or in your aTap account under Plugin Settings > Chat Bubble.
    152156
     157= I do not know what to write about my business or my products. Can it help? =
     158Yes. Open aTap > Knowledge > Selling Points. The AI asks you questions such as why people should buy from you, and you answer the way you would talk to a customer, typed or spoken. If you are stuck, press Help Me Answer for ideas. You can do your whole business, one product, or a whole brand or category. Nothing is used until you approve the words, and you can change them at any time.
     159
     160= My website has no About page. Where do I put my hours and locations? =
     161In aTap > Company Info. Type what customers should know about your business, then the name, address, phone number and hours of each location. The assistant answers from it right away. If your site has its own About page, tick We Have Our Own About Page and it reads that instead.
     162
    153163= What can I upload? =
    154164PDF, Word, PowerPoint, Excel, CSV, plain text, Markdown, HTML, RTF and OpenDocument files, up to 20 MB each, as many as you like.
    … …  
    177187
    178188== Changelog ==
     189
     190= 1.3.3 =
     191* New Selling Points, under Knowledge: the AI asks what makes your business and each product special, one question at a time, typed or spoken. If you do not know what to say, Help Me Answer gives you ideas. You approve the words, and your chat uses them when a customer is deciding.
     192* New Company Info page: type your locations, addresses and opening hours, and what customers should know about your business (pet friendly, vegan, veteran discounts). The assistant answers from it right away. If you already have an About page, tick one box and it reads that instead.
     193* Ask aTap About Your Shop and Selling Points remind you that AI can get things wrong, so check its advice before you act on it.
     194* Deleting a spare, inactive copy of the plugin no longer disconnects your site.
    179195
    180196= 1.3.2 =
  • atap-ai-customer-service/trunk/uninstall.php

    r3841326 r3843715  
    77if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
    88        exit;
     9}
     10
     11// A spare copy is being deleted while another copy of aTap is running on this site: leave the connection alone.
     12if ( class_exists( 'ATap_Api', false ) ) {
     13        return;
    914}
    1015
Note: See TracChangeset for help on using the changeset viewer.