' . esc_html__( 'When you visit our shop and accept analytics cookies, we record the products and categories you view, searches you make on our site, how you arrived (for example a search engine or an advert), the type of device and browser you use, roughly how long you spend on the site and, if enabled, your approximate town worked out from your internet connection. Your IP address is not stored.', 'basketwise' ) . '
'; $t .= '' . esc_html__( 'We record what you add to your basket and whether you reach the checkout, using the basket session WooCommerce needs to run the shop. If you type your email address, name or phone number at checkout, we may save them before the order is placed so we can email you a reminder if you leave items in your basket. Every reminder has an unsubscribe link.', 'basketwise' ) . '
'; $t .= '' . esc_html__( 'This information is deleted automatically after the period set by the shop (90 days by default). Cookies used: brai_vid (identifies your browser for up to a year, only after you accept analytics cookies), brai_s (marks a single visit, 30 minutes) and brai_h (notes that a person rather than an automated program is using the site; it holds no identifier).', 'basketwise' ) . '
'; wp_add_privacy_policy_content( 'Basketwise', wp_kses_post( $t ) ); } ); add_filter( 'wp_privacy_personal_data_exporters', function ( $exporters ) { $exporters['basketwise'] = array( 'exporter_friendly_name' => __( 'Basketwise', 'basketwise' ), 'callback' => function ( $email ) { global $wpdb; $items = array(); foreach ( $wpdb->get_results( $wpdb->prepare( 'SELECT * FROM %i WHERE email = %s', brai_table( 'visitors' ), $email ), ARRAY_A ) as $r ) { $data = array(); foreach ( array( 'name', 'email', 'phone', 'status', 'cart', 'first_seen', 'last_seen', 'device', 'browser', 'city', 'region', 'country', 'contacted_at', 'note' ) as $k ) { if ( isset( $r[ $k ] ) && '' !== (string) $r[ $k ] ) { $data[] = array( 'name' => $k, 'value' => (string) $r[ $k ], ); } } $items[] = array( 'group_id' => 'basketwise', 'group_label' => __( 'Basketwise', 'basketwise' ), 'item_id' => 'brai-' . $r['vid'], 'data' => $data, ); } /* Emails the shop sent to this address. */ foreach ( brai_mail_log( 'all', $wpdb->esc_like( $email ), '', 200, 0 ) as $m ) { if ( strtolower( $m['to_email'] ) !== strtolower( $email ) ) { continue; } $items[] = array( 'group_id' => 'basketwise-emails', 'group_label' => __( 'Basketwise emails', 'basketwise' ), 'item_id' => 'brai-mail-' . $m['id'], 'data' => array_values( array_filter( array( array( 'name' => __( 'Sent', 'basketwise' ), 'value' => $m['ts'], ), array( 'name' => __( 'Subject', 'basketwise' ), 'value' => '' !== $m['subject'] ? $m['subject'] : 'Basket reminder ' . (int) $m['step'], ), '' !== trim( (string) $m['body'] ) ? array( 'name' => __( 'Message', 'basketwise' ), 'value' => $m['body'], ) : null, ) ) ), ); } return array( 'data' => $items, 'done' => true, ); }, ); return $exporters; } ); add_filter( 'wp_privacy_personal_data_erasers', function ( $erasers ) { $erasers['basketwise'] = array( 'eraser_friendly_name' => __( 'Basketwise', 'basketwise' ), 'callback' => function ( $email ) { global $wpdb; $vids = $wpdb->get_col( $wpdb->prepare( 'SELECT vid FROM %i WHERE email = %s', brai_table( 'visitors' ), $email ) ); foreach ( $vids as $v ) { $wpdb->delete( brai_table( 'events' ), array( 'vid' => $v ) ); $wpdb->delete( brai_table( 'visitors' ), array( 'vid' => $v ) ); $wpdb->delete( brai_table( 'messages' ), array( 'vid' => $v ) ); } $wpdb->delete( brai_table( 'messages' ), array( 'to_email' => $email ) ); return array( 'items_removed' => count( $vids ) > 0, 'items_retained' => false, 'messages' => array(), 'done' => true, ); }, ); return $erasers; } );