=== AskThis AI Social Sharing ===
Contributors: askthis
Tags: share buttons, social sharing, chatgpt, ai seo, aeo
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 0.1.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

AI SEO and social sharing: one-tap "ask an AI" buttons plus AI Graph meta tags so answer engines summarize and cite your content correctly.

== Description ==

AskThis adds a lightweight (<12KB) sharing widget to your posts, pages and WooCommerce products:

* AI share buttons — visitors send your page to any of 14 AI engines (ChatGPT, Claude, Gemini, Perplexity, Copilot, Grok, Mistral, DeepSeek, DuckDuckGo, Brave, Kagi, Consensus, SciSpace and Andi) with a neutral, citation-friendly prompt built for the page type.
* Social share buttons — 28 networks, pick the ones you want: Facebook, X (Twitter), LinkedIn, WhatsApp, Pinterest, Reddit, Telegram, email, SMS and copy link; Line, VK, Viber, Weibo, Bluesky, Threads, Tumblr, Pocket, Hacker News, Flipboard and Xing; plus copy-to-app sharing for Messenger, Instagram, TikTok, Snapchat, WeChat, KakaoTalk and Mastodon.
* AI Graph meta tags (`ai:type`, `ai:title`, `ai:summary`, `ai:cite_as`, and product tags like `ai:price` and `ai:availability`) that tell AI answer engines how to read, summarize and cite your pages.
* One-click setup — press **Connect to AskThis** and the plugin creates (or signs you in to) a free AskThis account and fills in your Site ID for you. Nothing to copy across by hand.
* WooCommerce and ecommerce aware: product pages automatically map title, price, currency, brand and stock status into the AI tags and prompts, so an AI answering "is this the right product for me" reads accurate e-commerce data instead of guessing.

**AI SEO / answer engine optimization.** Search is shifting from ten blue links to answers
written by AI. AskThis gives you both halves of that: AI Graph meta tags describe your page
in a vocabulary answer engines can read, so you are summarized accurately and cited by name
rather than paraphrased away — and the AI share buttons let a reader carry your page into
ChatGPT, Claude, Gemini or Perplexity with a prompt that asks the engine to cite the source.
This is what AI SEO, answer engine optimization (AEO) and generative engine optimization
(GEO) describe: being readable, quotable and attributable to machines, not just to people.
In practice it means AI visibility in AI search — an LLM that reaches your page can identify
what it is, summarize it faithfully and produce an AI citation pointing back to you, which is
the difference between traffic from search engines and being quietly absorbed into an answer.

The widget loads asynchronously from a CDN and never blocks page rendering, and works with classic and block themes.

**Cache friendly.** Changing a setting clears the page cache for you — AskThis triggers a purge in LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache and SG Optimizer, so you never have to wonder why a layout change did not appear on the front end.

Place it automatically after your content, or manually with the **AskThis Share Widget** block, the `[askthis]` shortcode, or the classic **AskThis Share Widget** widget in any widget area.

== Installation ==

1. Install via Plugins → Add New and search for **AskThis**, or upload the plugin zip (it unpacks to `askthis-ai-social-sharing/` in `/wp-content/plugins/`).
2. Activate the plugin through the Plugins screen.
3. Go to **Settings → AskThis** and press **Connect to AskThis**. You will be sent to askthis.io to approve the connection — sign in, or create a free account in a few seconds — and brought straight back with your Site ID filled in.
4. Choose layout, networks, AI platforms and theme. Done — the widget appears after your content.

Already have a Site ID? You can skip the connection and paste it into the Connection section by hand instead.

To place the widget manually, disable "Auto-insert" and use the AskThis Share Widget block (or `[askthis]`) wherever you want it.

== Frequently Asked Questions ==

= Do I need an AskThis account? =

Yes, and the free one is enough to start. Pressing **Connect to AskThis** creates it for you (or signs you in to the one you already have) and fills in your Site ID. The account is what your share and AI buttons report to, which is how you get analytics.

= How do I sign in to AskThis afterwards? =

At [app.askthis.io](https://app.askthis.io) with the email and password you chose while connecting, or with Google, GitHub or Microsoft if you used one of those. The plugin never sets or stores a password — you create the account yourself on askthis.io, so the credentials are yours and are managed there, including password resets.

= What does the plugin send when I press Connect? =

Your site address and the email address of the administrator who pressed the button, and nothing else — no WordPress password, no user list, no post content. It is sent only on that click; the plugin transmits nothing on activation. You can edit the email on the AskThis page before approving.

= Can I use this on more than one site? =

Yes, though how many depends on your AskThis plan: the free plan covers **one** site, Pro covers five, and Business and above are unlimited. Each site gets its own Site ID, settings and analytics under the same account. If you connect a second site on the free plan the connection is refused with a message telling you so — nothing breaks.

= Does it work on WordPress multisite? =

Yes. Settings are per site, which is what you want: each site in the network is a separate site in AskThis with its own Site ID, its own buttons and its own analytics. Network-activate the plugin, then connect each site from its own **Settings → AskThis**. There is no network-wide settings screen, and one subsite's configuration never affects another's.

= How do I disconnect, and does it delete anything? =

**Settings → AskThis → Disconnect.** It only switches the widget off on this site: your site, its settings and its history stay in your AskThis account, so reconnecting later picks up exactly where you left off. Deleting the plugin removes its options from WordPress and likewise leaves your AskThis account untouched.

= Does the plugin slow my site down? =

No. One async script tag is added; nothing render-blocking, no jQuery, no external CSS. If the CDN is unreachable the page renders normally without the widget.

= Does it work with WooCommerce? =

Yes. Product pages get a product-type prompt and additional AI Graph tags: price, currency, brand (from the `brand`/`pa_brand` attribute) and availability from live stock status.

= Does it track my visitors? =

The plugin itself stores nothing about visitors. The widget records pseudonymous, consent-gated interaction events only (no names, emails or IPs), per the AskThis privacy policy.

= Can I change the CDN URL? =

Yes, in code: `add_filter( 'askthis_script_url', fn() => 'https://widgets.example.com/widget.js' );`

= Where does the widget appear? =

On single posts (article prompts), pages (generic prompts) and WooCommerce products (product prompts). Archives, feeds and embeds are excluded.

== Screenshots ==

1. The widget on a published post — social share buttons plus "Ask AI" buttons that open ChatGPT, Gemini, Perplexity or Claude with a pre-built, source-citing prompt for the page.
2. Settings → AskThis on a fresh install: one button connects your site. It creates a free AskThis account (or signs you in to your existing one) and fills in your Site ID for you — nothing to copy across by hand.
3. Pick exactly which buttons appear: 28 share networks in three groups, and 14 AI engines. Every network is free on every plan; engines above your plan are shown but inactive.
4. The AskThis Share Widget block, placed mid-post in the editor — for when you want the share row somewhere other than after your content.
5. Once connected, the settings screen shows which AskThis workspace this site belongs to, what to do next, and a one-click disconnect. Your plan's features are listed on the right and apply automatically — nothing to reinstall.

== External services ==

This plugin connects to AskThis (askthis.io), the service that powers the
sharing widget and its analytics. An AskThis account and Site ID are required
for the plugin to do anything.

Four separate connections are made:

1. Widget script -- cdn.askthis.io
   On every page where the widget is enabled, the visitor's browser loads
   https://cdn.askthis.io/widget.js. No data is sent by the plugin; this is a
   script request, so the visitor's IP address and user agent reach AskThis as
   they would with any externally hosted script.

2. Site ID verification -- api.askthis.io
   When an administrator saves the plugin settings, the site makes one
   server-side request to https://api.askthis.io/api/v1/sites/{site-id}/config
   to confirm the Site ID is valid. Only the Site ID is sent. No visitor data
   and no site content are included. If the request fails the setting is still
   saved; verification is advisory.

3. Interaction analytics -- ingest.askthis.io
   When a visitor views or interacts with the widget, the widget sends event
   data to https://ingest.askthis.io. Each event contains: the event type
   (view, share, ai_click, question), your Site ID, the platform or AI engine
   chosen, the URL of the page, and a timestamp. If a visitor types a question
   into the AI panel, that question text is included. Events are batched in the
   browser and sent periodically, not on every interaction.
   AskThis derives a pseudonymous identifier at its edge for deduplication. The
   plugin itself stores nothing about visitors and sets no cookies.

4. Connecting your site -- askthis.io and api.askthis.io
   Only when an administrator presses "Connect to AskThis", the browser is sent
   to https://app.askthis.io/connect carrying this site's address and the
   signed-in administrator's email address. On that page you sign in to AskThis
   (or create a free account) and approve the connection; approving it creates
   an AskThis account and a site record for this address if you do not already
   have them. You are then returned here with a single-use code, which this site
   exchanges once, server-side, at https://api.askthis.io/api/v1/connect/exchange
   for your Site ID. Nothing is sent unless you press the button, and no
   WordPress password, user list or content is included at any point.
   You can instead skip this entirely and paste a Site ID by hand.

Service provided by Agochar Tech LLP.
Terms of service: https://askthis.io/legal/terms/
Privacy policy: https://askthis.io/legal/privacy/

== Changelog ==

= 0.1.4 =
* Fixed: the widget now appears when you place the **AskThis Share Widget** block or the `[askthis]` shortcode on a page where auto-insert is switched off, or on a custom post type. Previously the spot stayed empty with nothing to explain it.
* Connect links now stay valid for an hour, so a slower confirmation email no longer strands you part-way through setting up a new account.
* New: a **Site Health** check that tells you when AskThis is not connected, or when your server cannot reach it — the plugin used to fail silently in both cases.
* New: an **AskThis** panel in Tools → Site Health → Info, with the details support asks for first.
* New: suggested privacy-policy text, available under Settings → Privacy → Policy Guide, describing what the widget sends and to whom.
* Setup instructions and FAQ rewritten around one-click Connect, including what is sent, how to sign in, multisite, and how many sites each plan allows.

= 0.1.3 =
* New: **Connect to AskThis** — one button creates (or signs you in to) your free AskThis account and fills in your Site ID for you. No more copying it across from the dashboard.
* New: a get-started panel and an activation notice, so a fresh install says what it needs instead of showing an empty Site ID box.
* New: a connected status card showing which AskThis workspace and plan this site is attached to, with a Disconnect button.
* Disconnecting only switches the widget off here — your site and its history stay in your AskThis account, so reconnecting picks up where you left off.
* Clearer messages when a connection cannot be completed, each saying what to do next.

= 0.1.2 =
* Listing screenshots replaced: the widget on a real post, the settings screen, the button pickers and the editor block — all captured in a real WordPress admin.
* Fixed the Plugin URI, which pointed at a page that did not exist.
* Corrected the manual-install folder name in the installation steps.
* Tested against WordPress 7.1.
* Translation template regenerated — 13 admin strings added in 0.1.1 were missing from it and could not be translated.

= 0.1.1 =
* The settings screen's layout CSS now loads through `wp_add_inline_style()` on `admin_enqueue_scripts` instead of a printed style tag, and only on that screen.

= 0.1.0 =
* Initial release.
* Settings screen (Settings → AskThis): site ID (verified against the AskThis API on save), layout, networks, AI platforms, theme, position, auto-insert.
* "Unlock premium AI features" panel linking to plan & billing on the AskThis dashboard — paid features apply to your site automatically once you upgrade.
* Async widget injection with the WordPress 6.3 loading strategy (manual async attribute on 6.0–6.2).
* AI Graph v1.0 meta tags for posts, pages and WooCommerce products (incl. price, currency, brand, availability, category path, published/updated dates, language and author).
* Gutenberg block `askthis/share-widget`, `[askthis]` shortcode, and a classic widget-area widget.

== Upgrade Notice ==

= 0.1.4 =
Fixes the block and shortcode rendering nothing when auto-insert is off or on custom post types. Recommended for anyone placing the widget by hand.

= 0.1.3 =
Adds one-click connect and a proper first-run experience. Existing installs are unaffected — your Site ID and settings are untouched, and nothing is sent anywhere unless you press Connect.

= 0.1.2 =
Documentation and listing only — no functional change. Safe to skip if you are running 0.1.1.

= 0.1.1 =
Loads the settings screen's CSS through the WordPress enqueue system.

= 0.1.0 =
First release.
