=== Provimedia GEO Widget === Contributors: provimedia Tags: geo, generative engine optimization, citation, answer block, structured data Requires at least: 6.0 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 1.0.0 License: GPL-2.0-or-later License URI: https://www.gnu.org/licenses/gpl-2.0.html Citable Answer Blocks for Generative Engine Optimization (GEO). Optimize your content for AI-powered search engines. == Description == Geo Widget creates structured, citable answer blocks (Answer Cards) directly in the WordPress Gutenberg Editor. This optimizes your content specifically for AI-powered search engines like Google AI Overviews, Bing Copilot, or Perplexity. Each block consists of a question, answer, bullet points, and sources — including copy buttons so readers and AI systems can correctly cite your content. = Who is this plugin for? = * Content creators who want to be cited in AI answers * SEO teams focusing on Generative Engine Optimization * Editorial teams needing structured fact blocks in articles * Developers integrating Answer Cards into external systems via REST API == Features == = Gutenberg Block "Answer Card" = * **Question Field** — Input field with character limit (max. 140 characters) and live counter * **Answer Field** — Multi-line text field for the citable answer * **Word Counter with Traffic Light Indicator** — Real-time color-coded assessment of answer length: * Gray: Too short (under 40 words) * Green: Ideal length (40-80 words) * Yellow: Getting long (81-120 words) * Red: Too long (over 120 words) * **Bullet Points (Key Points)** — Up to 6 key statements with add/remove buttons * **Source Management** — Up to 6 sources with label, URL, publisher, and date * **Anchor ID** — Automatically generated from the question, with umlaut support. Manually overridable with reset option * **Server-Side Rendering** — Output is fully rendered server-side (no frontend JavaScript required) = Copy Buttons = * **Copy Link** — Copies the permalink including anchor fragment to clipboard * **Copy Citation** — Copies a formatted citation: "Question" — Post Title (Site Name, Date) URL * **Visual Feedback** — Button shows "Copied!" and is briefly disabled * **Fallback for Older Browsers** — Automatic fallback when Clipboard API is unavailable * **Configurable Display** — Controllable via sidebar: link only, citation only, or both = REST API = * **Public Endpoint** — `GET /wp-json/provimedia-geo-widget/v1/answers` returns all Answer Cards as JSON * **Filter by Post** — Parameter `post_id` to retrieve blocks from a specific post * **Pagination** — Parameters `per_page` and `page` with response headers `X-WP-Total` and `X-WP-TotalPages` * **Read-only** — GET requests only, no write operations * **Disableable** — Can be completely disabled in settings = Settings Page = * **Enable/Disable REST API** — Toggles the public API endpoint on or off * **Include Answer in Citation** — Adds the answer text to the citation * **Default Copy Mode** — Global default: Link & Citation, Link only, or Citation only * **Strict Word Limit** — Enforces the 120-word limit when saving = Security = * Input sanitization of all attributes * Consistent late-escaping against XSS * Protocol whitelist for URLs (http/https only) * No innerHTML or eval in frontend JavaScript * Drafts and password-protected posts excluded from API * SQL injection protection via parameterized queries * Whitelist validation of all setting values * Nonce protection (CSRF) on settings page * External links with `rel="noopener noreferrer"` = Clean Uninstallation = * On uninstall, all plugin options and transients are completely removed from the database = Compatibility = * WordPress 6.0 or higher * PHP 7.4 or higher * Gutenberg Block API v3 * RTL support (automatically generated stylesheets) * Translation-ready (Text Domain: provimedia-geo-widget) == Installation == 1. Upload the ZIP file via **Plugins → Add New → Upload Plugin** 2. Activate the plugin under **Plugins → Installed Plugins** 3. Add the "Answer Card" block via the Gutenberg Editor to a post 4. Configure global settings under **Settings → Geo Widget** == Frequently Asked Questions == = What is Generative Engine Optimization (GEO)? = GEO refers to optimizing web content for AI-powered search engines. Unlike traditional SEO, it focuses on having content correctly cited and referenced as a source by AI systems. = Which AI search engines benefit from this? = Structured answer blocks improve citability in Google AI Overviews, Bing Copilot, Perplexity, ChatGPT Search, and similar systems. = How long should an answer be? = The ideal length is 40-80 words. The integrated word counter with traffic light indicator helps maintain the optimal length. = Can I disable the REST API? = Yes, under **Settings → Geo Widget** you can completely disable the API endpoint. = What happens on uninstallation? = All plugin data (options and transients) are completely removed from the database. Block content in your posts remains as HTML. = Does the plugin work with page builders? = The plugin uses the native Gutenberg Block Editor. Page builders that support Gutenberg blocks are compatible. == Screenshots == 1. Answer Card block in the Gutenberg Editor with question field, answer, word counter, and key points 2. Source management with label, URL, publisher, date, and auto-generated anchor ID 3. Rendered Answer Card on the frontend with cited sources and copy buttons 4. Plugin settings page under Settings > Geo Widget with REST API, citation, and copy mode options == Development == The compiled JavaScript and CSS files in the `/build` directory are generated from source files in the `/src` directory using WordPress build tools. = Source Code = All source code is included in the plugin: * `/src/index.js` - Editor block component (React/JSX) * `/src/frontend.js` - Copy button functionality (Vanilla JS) * `/src/editor.scss` - Editor-only styles (SCSS) * `/src/style.scss` - Frontend styles (SCSS) = Build Instructions = 1. Install Node.js (v18 or higher recommended) 2. Navigate to the plugin directory 3. Run `npm install` to install dependencies 4. Run `npm run build` to compile assets = Build Commands = * `npm run build` - Compile production assets * `npm run start` - Watch mode for development * `npm run lint` - Run code linting * `npm run test` - Run unit tests = Dependencies = * @wordpress/scripts - WordPress build toolchain * @wordpress/blocks - Block registration API * @wordpress/block-editor - Block editor components * @wordpress/components - UI components * @wordpress/i18n - Internationalization utilities * @wordpress/element - React abstraction layer * @wordpress/url - URL validation utilities == Changelog == = 1.0.0 = * Initial release * Gutenberg Block "Answer Card" with question, answer, bullet points, and sources * Copy buttons (Link and Citation) with Clipboard API and fallback * REST API endpoint with filtering and pagination * Settings page with 4 configurable options * Full security hardening (escaping, sanitization, whitelist validation) * Clean uninstallation == Upgrade Notice == = 1.0.0 = Initial release of the Geo Widget plugin.