=== ChatLira — Website Chat ===
Tags: live chat, customer support, chat widget
Requires at least: 6.5
Tested up to: 7.1.4
Requires PHP: 7.4
Stable tag: 0.1.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect a published ChatLira widget to WordPress with its public site key and service URLs.

== Description ==

This connector loads the real ChatLira widget on public WordPress pages. Appearance, text, channels, operators and other support features are managed in your ChatLira dashboard. Saving WordPress settings does not publish or alter the ChatLira configuration.

A working ChatLira service and a configured widget are required. This ZIP does not include the chat backend or store conversations in WordPress. It is a local distribution, not a WordPress.org submission or a registry-reviewed plugin.

The widget is disabled after activation. An administrator with manage_options permission must configure and enable it. No operator password or private service token is required.

= External service and privacy =

The administrator chooses the widget script URL and API URL. When enabled, this plugin loads JavaScript from that script URL in the visitor's browser; the widget connects to the configured ChatLira API, including realtime chat connections. WordPress itself does not request those service URLs.

The configured service receives connection metadata and, when a conversation is started, the page address. Visitor-supplied contact details, messages and attachments are processed by that service. The widget stores a visitor session and drafts in browser localStorage. Anonymous chat analytics may be sent when enabled in the ChatLira configuration. WordPress account names, passwords and operator credentials are not automatically sent.

There is no fixed production service domain, Terms URL or privacy-policy URL in this package. The site administrator must identify the actual service operator, endpoints, policies and retention practices in the website's privacy notice. A suggested text is added to the WordPress privacy-policy guide. The plugin does not provide a legal-compliance guarantee.

= Optional consent integration =

Enable require_consent to prevent this connector from loading the external widget script or connecting to ChatLira before your consent manager grants permission. The local bootstrap script still loads from WordPress. The plugin does not include a consent banner and does not persist consent decisions.

After an affirmative decision, call window.UpchatWordPress.grantConsent(). It returns Promise<boolean>; true means the widget has mounted. Call window.UpchatWordPress.revokeConsent() on withdrawal. Revocation prevents pending work from mounting and destroys the current widget. It cannot undo an already-issued script request and does not erase existing browser storage or service records.

== Installation ==

1. Obtain the upchat-wordpress-0.1.1.zip archive from your ChatLira dashboard.
2. In WordPress, open Plugins → Add New Plugin → Upload Plugin. Upload, install and activate the ZIP.
3. Open Settings → ChatLira. Enter the public site key, API URL and widget script URL from the selected widget's Installation tab in ChatLira.
4. Add the exact WordPress origin (scheme, host and port when used; no path) to that widget's allowed origins in ChatLira. Publish the widget settings.
5. Select auto or ru/en/fr/es/it/de, configure consent if needed, enable the widget and save.
6. Remove any older manual ChatLira embed, then check a public page. The theme must run the standard WordPress footer scripts.

Use HTTPS in production. URLs cannot contain credentials, query strings or fragments; the script path must end in .js. HTTP is accepted only for localhost, loopback, .local or .test addresses when WP_ENVIRONMENT_TYPE is local or development. An HTTPS page still requires HTTPS service URLs.

== Frequently Asked Questions ==

= Can I add my own chat button? =

Use [upchat_open label="Contact support"]. It opens the existing widget and does not bypass consent. You may also add data-upchat-open to a button. The normal widget launcher remains available.

= How does automatic language selection work? =

The plugin uses the first two characters of the WordPress site locale. Supported widget languages are ru, en, fr, es, it and de; other site languages fall back to en. A Russian administration translation is bundled in upchat/languages and has been verified in WordPress. Other administration strings remain translation-ready.

= Does uninstalling delete conversations? =

No. Uninstall removes the upchat_settings option, including site options on multisite. It does not remove data held by the configured ChatLira service or browser localStorage. Deactivation retains settings.

= What has been tested? =

The local integration was tested with WordPress 7.1.4 and PHP 8.2.4. The declared minimum versions are WordPress 6.5 and PHP 7.4; the full version matrix has not been tested. Service availability, production TLS, a site's consent manager and third-party themes remain deployment-specific.

== Changelog ==

= 0.1.1 =
* ChatLira name and supplied logo in the settings screen; existing option keys, shortcode, text domain and widget API remain compatible.


= 0.1.0 =
* Initial local connector with public configuration, published widget loading, optional consent integration and an open-chat shortcode.
