=== Smallchat for Wordpress ===
Contributors: dotzak
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl.html
Tags: chat, smallchat, small.chat, slack, live-chat, live-help, live-support
Tested up to: 7.1
Requires at least: 6.3
Requires PHP: 7.4
Stable tag: 1.1.0

Add Smallchat to a WordPress website, allowing visitors to talk to teams via Slack.

== Description ==
Easily add the [Smallchat](https://small.chat/) client to a WordPress site, allowing visitors to talk to teams via [Slack](https://slack.com/).

The official [installation instructions](https://docs.small.chat/installation) from Smallchat are to install a plugin which allows you to add arbitrary JS to your site. This plugin loads only the Smallchat embed JS code, instead, which is useful for environments where there may be restrictions on the plugins allowed to be installed.

== External services ==

This plugin loads the Smallchat chat widget from Smallchat's servers, a third-party service operated by Nicer LLC.

* **What it is used for:** displaying the Smallchat live chat widget so that visitors can talk to your team via Slack.
* **What is sent, and when:** once a client ID has been saved, every front-end page view by a visitor causes the visitor's browser to request `https://embed.small.chat/<your client ID>.js`. That request necessarily discloses the visitor's IP address and browser details to Smallchat. If a visitor chooses to use the widget, whatever they type, and any details they provide, are sent to Smallchat and relayed to your Slack workspace.
* **Who sees it:** the script is not loaded for logged-in administrators, editors and authors (see the `smchat4wp_hidden_roles` filter), nor at all until a client ID is saved.
* **Consent:** the widget loads without waiting for visitor consent. If your site requires consent before loading third-party scripts, make sure you obtain it, or only enable this plugin for visitors who have given it.
* **Service links:** [Smallchat Terms of Use](https://small.chat/terms), [Privacy Policy](https://small.chat/terms#privacy), [GDPR information](https://small.chat/terms#gdpr).

== Installation ==
= Prequisites =

Before using this plugin you need to add [Smallchat to Slack](https://my.small.chat/). After you\'ve added Smallchat to Slack, you can get your client ID from the embed code.

= Configuration =

1. Activate the plugin
1. Navigate to WP Admin > Settings > Smallchat.
1. Add your client ID

After that the Smallchat client will appear on the front end for visitors and other users, but not for logged-in administrators, editors and authors, and it will appear in the WP Customizer preview.

To change which roles do not see the widget, use the `smchat4wp_hidden_roles` filter, which receives an array of role slugs (default: `editor`, `administrator`, `author`):

`add_filter( 'smchat4wp_hidden_roles', function ( $roles ) { return array( 'administrator' ); } );`

== Changelog ==

This plugin is not under active development. Smallchat have not significantly changed their embed code since I originally wrote this, so it is unlikely that this plugin will need to be updated in the future.

Version bumps will be made to ensure that the plugin is compatible with the latest version of WordPress.

= 1.1.0 =

Release date: 2026-10-20

* Tested up to WordPress 7.1. Now requires WordPress 6.3 and PHP 7.4.
* Load the embed script with WordPress' native `async` strategy, and stop appending a WordPress version to the embed URL
* Sanitize the client ID on save and on read
* Add the `smchat4wp_hidden_roles` filter
* Add a Settings link on the Plugins screen, tidy the settings page markup, and make the settings image alt text translatable
* Remove the saved settings when the plugin is deleted
* Document the external Smallchat service in the readme
* Avoid PHP warnings on PHP 8+ when no client ID has been saved yet

= 1.0.2 =

Release date: 2026-10-20

This release is a version bump after testing to ensure that the plugin is compatible with WordPress 7.1.

* Bump WordPress tested up to version to 7.1
* Avoid PHP warnings on PHP 8+ when no client ID has been saved yet

= 1.0.1 =

Release date: 2023-01-25

This release is just a version bump after testing to ensure that the plugin is compatible with WordPress 6.1.1.

* Bump WordPress tested up to version to 6.1.1
* Changed license from GPLv2 to GPLv3
