Skip to content

About

Official WordPress plugin for Chatty AI chatbots — no code editing required

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Chatty WordPress Plugin

Add the Chatty AI chat widget to any WordPress site — no code editing required.

Paste your Bot ID, save, and the widget appears on your site — deferred, non-blocking, and styled exactly the way you configured it in the Chatty dashboard.

CI Release License: GPLv2 WordPress 5.8+ PHP 7.2+ Stars

Install · Settings · Shortcodes · Page targeting · Identity hook · Development · FAQ


Why this plugin

Zero code editing Configure everything from Settings → Chatty Widget, or place [chatty_widget] / [personaliai_chat] shortcodes inside Gutenberg, Elementor, Divi, or Beaver Builder.
Loads deferred Enqueued in the footer with native strategy => 'defer' on WordPress 6.3+ and an automatic defer fallback on WordPress 5.8–6.2 — never blocks page render.
Cloud or self-hosted Works out of the box with Chatty Cloud (https://chatty.personaliai.com) or any self-hosted HTTPS Chatty deployment via Chatty Host URL.
Real page targeting Show the widget everywhere, only on chosen page IDs/URL patterns, everywhere except chosen paths, or via shortcodes only — with query-string stripping and trailing-slash normalization.
WooCommerce HPOS & Multisite ready Declares WooCommerce High-Performance Order Storage (custom_order_tables) compatibility and cleans up options across all sites on multisite uninstall.
Clean hooks & singleton API Bootstrapped on plugins_loaded via Chatty_Widget_Plugin::instance(), allowing themes and plugins to unhook actions cleanly.

Install

From a release zip:

  1. Grab chatty-by-personaliai.zip from the latest release
  2. In your WordPress admin: Plugins → Add New → Upload Plugin
  3. Choose the zip, click Install Now, then Activate
  4. Go to Settings → Chatty Widget and paste your Bot ID — find it in your Chatty dashboard → your bot → Embed & Integrate
  5. Save — the widget now appears on your site

From source, for development against a local WordPress install — see Development.

Settings

All under Settings → Chatty Widget:

Setting What it does
Bot ID (required) Which Chatty bot to load (4–128 alphanumeric, hyphen, or underscore characters).
Floating Widget Enable or disable the global floating launcher across your site (disable if you only want shortcode embeds).
Chatty Host URL Optional HTTPS origin for self-hosted Chatty deployments (defaults to https://chatty.personaliai.com; HTTP allowed only for localhost / 127.0.0.1).
Accent Color Optional #RRGGBB override. Leave blank to use the bot's dashboard color.
Launcher Position Bottom right or bottom left.
Mobile Fullscreen Open fullscreen on mobile instead of a floating panel.
Proactive Greeting Bubble Show a teaser bubble a few seconds after page load.
Notification Sound Chime when a new reply arrives.
Display Mode All Pages, Include Only, or Exclude — see Page targeting.
Pages to Include/Exclude Comma-separated page IDs and/or URL patterns.
Hide for Admins Don't show the floating widget to logged-in administrators.

Shortcodes

Both [chatty_widget] and [personaliai_chat] are registered and accept identical attributes:

Inline support desk embed:

[chatty_widget inline="true" height="650px" width="100%"]
[personaliai_chat inline="true" bot_id="your-bot-id" height="600px" color="#0EA5E9"]

Per-page floating widget override (overrides the global bot, position, or accent color on that page, even when the global floating toggle is off):

[personaliai_chat bot_id="custom-sales-bot-uuid" position="bottom-left" color="#F97316"]

Supported attributes:

Attribute Default Notes
bot_id Saved Bot ID Optional bot override ([a-zA-Z0-9_-]{4,128}).
inline false Set true to render a lazy-loaded responsive <iframe> pointing to {api_host}/embed/{bot_id}.
height 600px Validated CSS length (px, %, vh, vw, rem, em) for inline embeds.
width 100% Validated CSS length for inline embeds.
position Saved Position Accepts left, right, bottom-left (mapped to left), or bottom-right (mapped to right).
color Saved Color Optional #RRGGBB accent color override.
title Chatty AI Assistant Accessible title attribute on inline iframes.

Page targeting

Set Display Mode to Include Only or Exclude, then list page IDs and/or URL patterns (comma-separated) in Pages to Include/Exclude:

12, 45, /shop/*, /about
  • Bare numbers are strictly matched against get_queried_object_id() (positive IDs only — archive/404 pages returning 0 never falsely match patterns).
  • URL patterns are matched case-insensitively against the request path (with query strings such as ?utm_source=... stripped and trailing slashes normalized) and against the canonical site URL derived from home_url().
  • * matches any sequence of characters, so /shop/* matches every URL under /shop/.

Logged-in user identity

To identify logged-in WordPress customers in the Chatty inbox safely, mint a short-lived HS256 JWT on your server and return it from the chatty_identity_jwt filter. Never embed your Chatty signing secret in browser JavaScript.

add_filter(
	'chatty_identity_jwt',
	function ( $token, $user, $bot_id ) {
		if ( ! $user instanceof WP_User || ! $user->exists() ) {
			return '';
		}
		// Mint a short-lived (<= 5 min) HS256 JWT with iss=chatty-customer,
		// aud="chatty:{$bot_id}", and sub=(string) $user->ID using your server-side secret.
		return my_site_mint_chatty_jwt( $user, $bot_id );
	},
	10,
	3
);

When the filter returns a valid compact JWT, the plugin attaches an inline script via wp_add_inline_script() that calls window.Chatty.identify(token) once chatty:ready fires.

Requirements

  • WordPress 5.8+
  • PHP 7.2+
  • A Chatty account (or self-hosted Chatty instance) with a bot set up

Development

The plugin has no build step — it's plain PHP. To work on it against a real WordPress site:

git clone https://github.com/PersonaliAI/chatty-wordpress-plugin.git
cd chatty-wordpress-plugin
ln -s "$(pwd)/chatty-by-personaliai" /path/to/wordpress/wp-content/plugins/chatty-by-personaliai

Run lint, WPCS, and PHPUnit locally:

composer install
find chatty-by-personaliai -name '*.php' -print0 | xargs -0 -n1 php -l
vendor/bin/phpcs --standard=WordPress-Extra --extensions=php chatty-by-personaliai/
vendor/bin/phpunit

Project layout:

chatty-by-personaliai/
  chatty-by-personaliai.php                 Plugin bootstrap, constants, plugins_loaded & WooCommerce HPOS hooks
  includes/
    class-chatty-widget-plugin.php          Core class: settings, sanitization, targeting, shortcodes, identity hook
  readme.txt                                WordPress.org plugin-directory readme
  uninstall.php                             Single-site and multisite option cleanup on uninstall
tests/
  bootstrap.php                             PHPUnit + Brain\Monkey bootstrap
  TestCase.php                              Base test case
  SanitizeSettingsTest.php                  Input validation & sanitization tests
  UrlMatchesPatternsTest.php                URL pattern, query-stripping, trailing-slash, and host tests
  AddScriptAttributesTest.php               Script attribute injection & WP < 6.3 defer fallback tests
  PageTargetingAndShortcodeTest.php         Strict ID targeting, shortcodes, api_host, and identity JWT tests

See CONTRIBUTING.md for coding standards and the CI workflow.

FAQ

Where do I find my Bot ID? In your Chatty dashboard, select your bot, then open the "Embed & Integrate" tab.

Does this slow down my site? No — the script loads deferred in the footer, and the full chat interface only loads when a visitor opens it.

Does this work with WooCommerce? Yes — the plugin declares WooCommerce HPOS (custom_order_tables) compatibility and works across product, cart, and checkout pages (use page targeting if you want to include or exclude specific store routes).

I entered my Bot ID but don't see the widget. Make sure Floating Widget is enabled, click "Save Changes," check the site's front end (not wp-admin), and clear any page cache plugin.

More in chatty-by-personaliai/readme.txt.

License

GPLv2 or later — see LICENSE.

About

Official WordPress plugin for Chatty AI chatbots — no code editing required

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages