Changeset 3843715
- Timestamp:
- 12/04/2026 04:22:25 AM (less than one hour ago)
- Location:
- atap-ai-customer-service
- Files:
-
- 2 added
- 14 edited
- 1 copied
-
tags/1.3.3 (copied) (copied from atap-ai-customer-service/trunk )
-
tags/1.3.3/assets/admin.css (modified) (1 diff)
-
tags/1.3.3/assets/admin.js (modified) (1 diff)
-
tags/1.3.3/assets/selling-points.js (added)
-
tags/1.3.3/atap.php (modified) (2 diffs)
-
tags/1.3.3/includes/class-atap-admin.php (modified) (10 diffs)
-
tags/1.3.3/includes/class-atap-owner.php (modified) (2 diffs)
-
tags/1.3.3/readme.txt (modified) (9 diffs)
-
tags/1.3.3/uninstall.php (modified) (1 diff)
-
trunk/assets/admin.css (modified) (1 diff)
-
trunk/assets/admin.js (modified) (1 diff)
-
trunk/assets/selling-points.js (added)
-
trunk/atap.php (modified) (2 diffs)
-
trunk/includes/class-atap-admin.php (modified) (10 diffs)
-
trunk/includes/class-atap-owner.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (9 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
atap-ai-customer-service/tags/1.3.3/assets/admin.css
r3841326 r3843715 180 180 .atap .atap-plan-line1{display:block;font-size:12px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;color:#646970} 181 181 .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 479 479 }); 480 480 })(); 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 3 3 * Plugin Name: aTap – AI Customer Service 4 4 * 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. 25 * Version: 1.3.3 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 19 19 } 20 20 21 define( 'ATAP_VERSION', '1.3. 2' );21 define( 'ATAP_VERSION', '1.3.3' ); 22 22 define( 'ATAP_FILE', __FILE__ ); 23 23 define( 'ATAP_DIR', plugin_dir_path( __FILE__ ) ); -
atap-ai-customer-service/tags/1.3.3/includes/class-atap-admin.php
r3841571 r3843715 27 27 add_action( 'admin_post_atap_lib_upload', array( __CLASS__, 'lib_upload' ) ); 28 28 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' ) ); 29 31 add_action( 'admin_post_atap_dismiss_notice', array( __CLASS__, 'dismiss_notice' ) ); 30 32 } … … 84 86 'atap-reports' => array( __( 'Reports', 'atap-ai-customer-service' ), 'page_reports' ), 85 87 'atap-billing' => array( __( 'Subscription & Add-ons', 'atap-ai-customer-service' ), 'page_billing' ), 88 'atap-company' => array( __( 'Company Info', 'atap-ai-customer-service' ), 'page_company' ), 86 89 'atap-account' => array( __( 'Account', 'atap-ai-customer-service' ), 'page_account' ), 87 90 'atap-settings' => array( __( 'Settings', 'atap-ai-customer-service' ), 'page_settings' ), … … 134 137 'atap-reports' => '#reports', 135 138 'atap-billing' => '#billing', 139 'atap-company' => '#company-info', 136 140 'atap-account' => '#billing', 137 141 'atap-settings' => 'choose-what-it-learns', … … 419 423 $sel_copy = isset( $_GET['atap_copy'] ) ? absint( $_GET['atap_copy'] ) : 0; 420 424 $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'] ) ) : ''; 422 427 // the sidebar's search for pages, posts and other kinds (1.2.6): which kind, and the words 423 428 $find_t = isset( $_GET['atap_qt'] ) ? sanitize_key( wp_unslash( $_GET['atap_qt'] ) ) : ''; … … 517 522 // ---------------- main stage 518 523 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' ) ) ) ) ); 520 525 echo '<div class="atap-kb-bar"><h2 class="atap-kb-title">' . esc_html( $title ) . '</h2><div class="atap-kb-actions">'; 521 526 $w_on = ! $sel_doc && ! $sel_read && 'write' === $mode; … … 523 528 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> '; 524 529 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>'; 525 532 echo '</div></div>'; 526 533 if ( ! $lib['ok'] ) { … … 532 539 } elseif ( $sel_copy ) { 533 540 self::stage_write( $sel_copy ); 541 } elseif ( 'selling' === $mode ) { 542 self::stage_selling( $sel_sell ); 534 543 } elseif ( 'upload' === $mode ) { 535 544 self::stage_upload(); … … 776 785 777 786 /** 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 778 839 private static function stage_site_item( $key, $learned ) { 779 840 $id = (int) preg_replace( '/^post:/', '', $key ); … … 786 847 echo '<a class="button button-primary" href="' . esc_url( $edit ) . '">' . esc_html__( 'Edit in WordPress', 'atap-ai-customer-service' ) . '</a> '; 787 848 } 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>'; 789 854 } 790 855 if ( ! isset( $learned[ $key ] ) ) { … … 2170 2235 } 2171 2236 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 2172 2329 // ------------------------------------------------------------------ Settings 2173 2330 public static function page_settings() { -
atap-ai-customer-service/tags/1.3.3/includes/class-atap-owner.php
r3841509 r3843715 105 105 'question' => mb_substr( $question, 0, 1000 ), 106 106 '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, 109 110 ), 110 111 ), … … 135 136 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' ) . '"> '; 136 137 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>'; 138 140 } 139 141 } -
atap-ai-customer-service/tags/1.3.3/readme.txt
r3841571 r3843715 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 27 Stable tag: 1.3.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 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. 16 16 17 17 aTap 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. … … 26 26 * Products from WooCommerce, Easy Digital Downloads and FluentCart, with prices, options and stock. 27 27 * More carts to come. 28 * Every change you saveis learned as soon as you save it.28 * Every change is learned as soon as you save it. 29 29 30 30 **Teach it anything else** 31 31 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. 33 35 34 36 **Answers your customers can use** 35 37 36 38 * 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. 38 40 39 41 **You and your team** … … 41 43 * **Chat Manager:** read every chat, and take over one as a person. 42 44 * **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. 44 46 45 47 **Plans** … … 51 53 **Special launch price for our first 100 businesses on WordPress Professional.** 52 54 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 stepwhen you press Connect.55 Add-ons for paid plans: Order Help, Full Reports, Wish List, More Web Lookups, More Conversations and Team Chat. See the FAQ for details. 56 57 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 when you press Connect. 56 58 57 59 == External services == … … 62 64 * **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. 63 65 * **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. 64 68 * **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. 65 69 * **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. … … 68 72 * **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. 69 73 * **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. 71 75 * **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. 72 76 * **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. … … 151 155 A 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. 152 156 157 = I do not know what to write about my business or my products. Can it help? = 158 Yes. 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? = 161 In 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 153 163 = What can I upload? = 154 164 PDF, Word, PowerPoint, Excel, CSV, plain text, Markdown, HTML, RTF and OpenDocument files, up to 20 MB each, as many as you like. … … 177 187 178 188 == 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. 179 195 180 196 = 1.3.2 = -
atap-ai-customer-service/tags/1.3.3/uninstall.php
r3841326 r3843715 7 7 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 8 8 exit; 9 } 10 11 // A spare copy is being deleted while another copy of aTap is running on this site: leave the connection alone. 12 if ( class_exists( 'ATap_Api', false ) ) { 13 return; 9 14 } 10 15 -
atap-ai-customer-service/trunk/assets/admin.css
r3841326 r3843715 180 180 .atap .atap-plan-line1{display:block;font-size:12px;font-weight:600;letter-spacing:.3px;text-transform:uppercase;color:#646970} 181 181 .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 479 479 }); 480 480 })(); 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 3 3 * Plugin Name: aTap – AI Customer Service 4 4 * 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. 25 * Version: 1.3.3 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 19 19 } 20 20 21 define( 'ATAP_VERSION', '1.3. 2' );21 define( 'ATAP_VERSION', '1.3.3' ); 22 22 define( 'ATAP_FILE', __FILE__ ); 23 23 define( 'ATAP_DIR', plugin_dir_path( __FILE__ ) ); -
atap-ai-customer-service/trunk/includes/class-atap-admin.php
r3841571 r3843715 27 27 add_action( 'admin_post_atap_lib_upload', array( __CLASS__, 'lib_upload' ) ); 28 28 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' ) ); 29 31 add_action( 'admin_post_atap_dismiss_notice', array( __CLASS__, 'dismiss_notice' ) ); 30 32 } … … 84 86 'atap-reports' => array( __( 'Reports', 'atap-ai-customer-service' ), 'page_reports' ), 85 87 'atap-billing' => array( __( 'Subscription & Add-ons', 'atap-ai-customer-service' ), 'page_billing' ), 88 'atap-company' => array( __( 'Company Info', 'atap-ai-customer-service' ), 'page_company' ), 86 89 'atap-account' => array( __( 'Account', 'atap-ai-customer-service' ), 'page_account' ), 87 90 'atap-settings' => array( __( 'Settings', 'atap-ai-customer-service' ), 'page_settings' ), … … 134 137 'atap-reports' => '#reports', 135 138 'atap-billing' => '#billing', 139 'atap-company' => '#company-info', 136 140 'atap-account' => '#billing', 137 141 'atap-settings' => 'choose-what-it-learns', … … 419 423 $sel_copy = isset( $_GET['atap_copy'] ) ? absint( $_GET['atap_copy'] ) : 0; 420 424 $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'] ) ) : ''; 422 427 // the sidebar's search for pages, posts and other kinds (1.2.6): which kind, and the words 423 428 $find_t = isset( $_GET['atap_qt'] ) ? sanitize_key( wp_unslash( $_GET['atap_qt'] ) ) : ''; … … 517 522 // ---------------- main stage 518 523 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' ) ) ) ) ); 520 525 echo '<div class="atap-kb-bar"><h2 class="atap-kb-title">' . esc_html( $title ) . '</h2><div class="atap-kb-actions">'; 521 526 $w_on = ! $sel_doc && ! $sel_read && 'write' === $mode; … … 523 528 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> '; 524 529 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>'; 525 532 echo '</div></div>'; 526 533 if ( ! $lib['ok'] ) { … … 532 539 } elseif ( $sel_copy ) { 533 540 self::stage_write( $sel_copy ); 541 } elseif ( 'selling' === $mode ) { 542 self::stage_selling( $sel_sell ); 534 543 } elseif ( 'upload' === $mode ) { 535 544 self::stage_upload(); … … 776 785 777 786 /** 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 778 839 private static function stage_site_item( $key, $learned ) { 779 840 $id = (int) preg_replace( '/^post:/', '', $key ); … … 786 847 echo '<a class="button button-primary" href="' . esc_url( $edit ) . '">' . esc_html__( 'Edit in WordPress', 'atap-ai-customer-service' ) . '</a> '; 787 848 } 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>'; 789 854 } 790 855 if ( ! isset( $learned[ $key ] ) ) { … … 2170 2235 } 2171 2236 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 2172 2329 // ------------------------------------------------------------------ Settings 2173 2330 public static function page_settings() { -
atap-ai-customer-service/trunk/includes/class-atap-owner.php
r3841509 r3843715 105 105 'question' => mb_substr( $question, 0, 1000 ), 106 106 '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, 109 110 ), 110 111 ), … … 135 136 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' ) . '"> '; 136 137 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>'; 138 140 } 139 141 } -
atap-ai-customer-service/trunk/readme.txt
r3841571 r3843715 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.3. 27 Stable tag: 1.3.3 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 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. 16 16 17 17 aTap 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. … … 26 26 * Products from WooCommerce, Easy Digital Downloads and FluentCart, with prices, options and stock. 27 27 * More carts to come. 28 * Every change you saveis learned as soon as you save it.28 * Every change is learned as soon as you save it. 29 29 30 30 **Teach it anything else** 31 31 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. 33 35 34 36 **Answers your customers can use** 35 37 36 38 * 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. 38 40 39 41 **You and your team** … … 41 43 * **Chat Manager:** read every chat, and take over one as a person. 42 44 * **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. 44 46 45 47 **Plans** … … 51 53 **Special launch price for our first 100 businesses on WordPress Professional.** 52 54 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 stepwhen you press Connect.55 Add-ons for paid plans: Order Help, Full Reports, Wish List, More Web Lookups, More Conversations and Team Chat. See the FAQ for details. 56 57 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 when you press Connect. 56 58 57 59 == External services == … … 62 64 * **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. 63 65 * **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. 64 68 * **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. 65 69 * **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. … … 68 72 * **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. 69 73 * **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. 71 75 * **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. 72 76 * **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. … … 151 155 A 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. 152 156 157 = I do not know what to write about my business or my products. Can it help? = 158 Yes. 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? = 161 In 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 153 163 = What can I upload? = 154 164 PDF, Word, PowerPoint, Excel, CSV, plain text, Markdown, HTML, RTF and OpenDocument files, up to 20 MB each, as many as you like. … … 177 187 178 188 == 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. 179 195 180 196 = 1.3.2 = -
atap-ai-customer-service/trunk/uninstall.php
r3841326 r3843715 7 7 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { 8 8 exit; 9 } 10 11 // A spare copy is being deleted while another copy of aTap is running on this site: leave the connection alone. 12 if ( class_exists( 'ATap_Api', false ) ) { 13 return; 9 14 } 10 15
Note:
See TracChangeset
for help on using the changeset viewer.