=== Click Guide ===
Contributors: codeinfinity
Tags: help, onboarding, tour, assistant, walkthrough
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 1.0.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Embed the Click Guide help layer on your WordPress site. Answers user questions from your own documentation and shows them where to click.

== Description ==

Click Guide is an embeddable help layer that answers user questions from your own documentation and, when the answer is a task, highlights the exact control on the page and waits while your user clicks it.

This plugin adds Click Guide to a WordPress site with one setting: your publishable key. It does not proxy anything, does not store customer content, and does not talk to Click Guide from PHP -- it just renders the same one-line script tag the install docs at https://clickguide.co.za/install describe, reading its options from the settings screen.

You will need a Click Guide account to get a publishable key. Register at https://app.clickguide.co.za.

= What the plugin does =

* Adds a "Click Guide" screen under Settings.
* Stores your publishable key, launcher label, and launcher position in one WordPress option.
* Renders the Click Guide script tag in the footer of every page.
* Lets you gate visibility: everyone, logged-in users only, administrators only (useful while testing), or off.

= What the plugin does not do =

* No custom tables, no post meta, no user meta -- just one row in wp_options.
* No outbound HTTP from PHP. The plugin never contacts the Click Guide backend.
* No tracking scripts, no analytics beacons, no fonts loaded from third parties.
* No content is stored on your site beyond the publishable key.

== Installation ==

1. Upload the `click-guide` folder to `/wp-content/plugins/`, or install through Plugins > Add New once the plugin is published on WordPress.org.
2. Activate the plugin.
3. Go to Settings > Click Guide.
4. Paste your publishable key from the Click Guide console (https://app.clickguide.co.za), then Save.
5. Add your site's URL as an allowed origin on the key inside the console. Keys refuse requests from any origin not on that list.

== Frequently Asked Questions ==

= Is the publishable key a secret? =

No. Publishable keys are safe to expose in page source. They are scoped to the origins you list in the Click Guide console, and they can only read published guides for the environment they belong to. Do not paste a secret key here; the plugin will refuse a key that does not have the publishable shape (`cg_pk_...`).

= Will Click Guide appear for logged-out visitors? =

By default, yes. Change "Show Click Guide to" on the settings screen if you want to restrict it to logged-in users or administrators.

= Does it work with caching plugins? =

Yes. The script tag is rendered inline in the footer, no separate asset requests, no cache-busting needed.

= Can I load Click Guide only on specific pages? =

Add a filter to your theme's functions.php:

    add_filter( 'click_guide_should_render', function ( $should, $settings ) {
        return $should && is_page( 'help' );
    }, 10, 2 );

The filter can only reduce the audience, not expand it beyond what the admin setting selected.

= What if I forget my key or want to disable Click Guide temporarily? =

Set "Show Click Guide to" to "Nobody" in the settings. The script tag stops rendering; nothing else needs to change. Re-activating is one click.

== Changelog ==

= 1.0.0 =
* First release.
