AI Share & Summarize — Full changelog

For each release, see the entries below. The latest version is always at the top.
The current release notes also live in readme.txt under "== Changelog ==".

= 2.1.0 =
* New: Summary block appearance — choose a style for the inline AI summary block and its Generate button (minimal, outline, brand, dark, or custom colors), set the background and text colors, and place the icon on the left, on the right, or hidden.
* New: Customizable summary text — set your own label for the summary block heading and for the visitor-facing "Generate AI summary" button (both translatable; leave empty to keep the defaults).
* Improved: The AI summary now renders each sentence on its own line for easier reading, for both the AI Client and the extractive providers.
* Improved: Summary accessibility — visible keyboard focus on the block toggle and the Generate button, and focus moves to the freshly generated summary so screen readers announce the new content.
* Fix: The summary in the "before content" position did not appear on sites whose theme, plugins or snippets rewrite `the_content` with `DOMDocument` (image optimizers, lazy-load, "nofollow" on image links, table-of-contents, etc.), which dropped the block when reserializing the content. The before-content summary is now injected after those filters and its critical CSS is printed in the page `<head>`, so the block survives; the share buttons keep their position.
* Fix: Hardening — the section/title tag is now built through an allowlist helper (closing the class of the 2.0.x XSS against future refactors), the activation-notice dismissal now also verifies the user capability, and a redundant `unserialize()` was removed from the SEO noindex detection.

= 2.0.4 =
* Fix: Contributor+ stored XSS through the `title_style` attribute of the `[ayudawp_share_buttons]` shortcode. The value was emitted in HTML tag-name position with only `esc_attr()`, which does not encode spaces or `=`, so a user with the `edit_posts` capability could inject arbitrary attributes and event handlers. `title_style` is now validated against an allowlist (`h2`-`h6`, `p`, `span`, `div`) at every entry point (admin save, shortcode attribute, render). Reported by Haitam Lazaar.

= 2.0.3 =
* Fix: Buttons not appearing on entries without a manual excerpt when the active theme or a third-party plugin calls `the_excerpt()` / `get_the_excerpt()` from the `<head>` to compose Open Graph, Twitter Card or similar meta descriptions. WordPress's `wp_trim_excerpt()` applies the `the_content` filter internally to auto-truncate posts without a manual excerpt — the 1.9.2+ id-match guard accepted that early invocation as legitimate, marked the post as processed and blocked the subsequent real call from the post template. The filter now early-returns and stays out of the processed-posts guard when running inside the excerpt pipeline.

= 2.0.2 =
* Fix: Buttons not appearing on entries other than the latest published post on themes/plugins that call `setup_postdata()` from a header/sidebar without a matching `wp_reset_postdata()`. The strict id-match guard added in 1.9.2 (for Divi Theme Builder, FSE and Bricks) now falls back to verifying that the filtered content belongs to the queried post when `get_the_ID()` and `get_queried_object_id()` disagree, so legitimate singular content still gets the buttons while widgets and footers running `the_content` on arbitrary text remain protected.

= 2.0.1 =
* Fix: Visitor-facing "Generate AI summary" click made the summary box look empty until the page was reloaded — the placeholder element was being replaced by the inline critical CSS `<style>` block instead of the actual `<aside>` summary. The replacement now targets the `<aside>` element explicitly.

= 2.0.0 =
* New: Inline AI summary feature — the plugin's namesake "Summarize" capability now generates a short summary of each post and shows it inline in a collapsible block alongside the share buttons
* New: Two-tier provider cascade — Level A uses the WordPress 7.0 AI Client (`wp_ai_client_prompt()`) with credentials managed centrally in Settings > Connectors (OpenAI, Anthropic, Google), so no API keys are configured in this plugin
* New: Level C PHP extractive fallback for sites on WP < 7.0 or without an AI Connector — picks the most representative sentences using token-frequency scoring with a Jaccard-similarity filter to avoid redundant sentences
* New: Dedicated "AI Summary" settings section with independent post-type selection, position, default collapsed state, sentence count (also used by the AI prompt), extractive fallback opt-out and per-feature controls
* New: Block editor sidebar panel to view the current summary, edit it manually (which locks it against auto-regeneration) and trigger a synchronous regeneration on demand
* New: Classic editor meta box equivalent — view, edit and force regeneration on next save, with admin notice showing the result or the underlying AI error
* New: Visitor-facing "Generate AI summary" button for posts without a stored summary, with admin setting to keep generation extractive-only (zero cost) or allow the AI Client (rate-limited to 1 generation per IP per minute)
* New: `[ayudawp_aiss_summary]` shortcode to render the summary outside the auto-insert flow (accepts a `post_id` attribute)
* New: REST endpoints `POST /aiss/v1/summary/regenerate` (capability `edit_post`) and `POST /aiss/v1/summary/generate` (public, rate-limited)
* New: Schema.org microdata on the summary block (`CreativeWork` + `abstract`) plus `data-nosnippet` so search engines understand it's a derived summary and don't compete it as a featured snippet against the original content
* New: Last AI Client error is persisted and surfaced in the settings page, so configuration issues are visible without enabling `WP_DEBUG`
* New: `aiss_summary` icon in `AyudaWP_AISS_Icons` for the collapsible block header
* New: Filter `ayudawp_aiss_extractive_stopwords` to extend the extractive summarizer with additional languages (ships with English and Spanish)
* New: Filter `ayudawp_aiss_extractive_weights` to tune lead bonus, title-word weight, minimum sentence length and similarity threshold of the extractive summarizer
* New: Async generation via WP-Cron (`wp_schedule_single_event`) so the editor save never blocks waiting for the AI provider; explicit user actions (sidebar "Regenerate now", classic-editor "Regenerate on next save") run synchronously for immediate feedback
* Improved: Frontend "Generate AI summary" button rewritten in vanilla JS (outside the jQuery ready cycle) so it survives aggressive defer/async optimizations from caching and performance plugins
* Improved: Critical inline CSS is now printed alongside the summary HTML so the collapsible block stays visually correct even when the main stylesheet is deferred with `rel="preload"`
* Improved: Shortcodes (`[gallery]`, `[caption]`, plugin-defined ones, etc.) are now stripped from post content before summarization so the resulting summary no longer includes raw shortcode markup
* Improved: Minimum WordPress version raised to 5.6 to use `wp_after_insert_post`, which fires after meta updates and avoids redundant regenerations

= 1.9.2 =
* Fixed: Share buttons not appearing with Divi Theme Builder (Divi 4 and Divi 5), FSE block templates and Bricks Builder — these render the post content through the `the_content` filter without a standard WP loop, so the previous `in_the_loop()` and `is_main_query()` guards blocked the auto-insertion. The singular-page path now relies on `is_singular()` plus a post-ID match between `get_the_ID()` and `get_queried_object_id()`, with a per-request "already processed" guard so the same post can never receive duplicate button blocks. Archives keep the original main-loop check

= 1.9.1 =
* Fixed: Empty space below the footer on themes that don't clip body overflow — universal tooltips were created at the end of `<body>` with no initial coordinates, extending the document scroll height by their static size

= 1.9.0 =
* Added: Optional "Dark mode adaptation" setting (Disabled by default / Auto). When set to Auto, a tiny script measures the real background luminance of the buttons container and only adapts colors when it is genuinely dark — so light pages stay untouched even if the visitor's OS prefers dark
* Added: Light border on X, Threads and Grok buttons over dark backgrounds so they stand out from the page (Auto mode)
* Added: Section and global titles now also display when using the "Icons only" button style
* Improved: Outline style shows X, Threads and Grok in white over dark backgrounds (instead of unreadable black) — Auto mode
* Improved: Minimal style text and titles use legible light colors on dark backgrounds — Auto mode
* Changed: Version history moved to a dedicated changelog.txt file served from the plugin's public SVN, keeping readme.txt focused on the current release

= 1.8.0 =
* Added: NoIndexer plugin integration for noindex content detection — uses the full priority resolution (individual meta, bulk rules, exclusions)
* Added: NoIndexer and Periscope plugins to the promotional banner rotation
* Improved: SEO integration settings now display all detected noindex providers

= 1.7.4 =
* Fixed: Block editor sidebar panel translations now load correctly via wp_localize_script() instead of relying on JSON translation files

= 1.7.3 =
* Improved: Block editor now uses a native sidebar panel (PluginDocumentSettingPanel) instead of a classic meta box for the post exclusion checkbox
* Improved: Compatible with WordPress 7.0 real-time collaboration (RTC) — the classic meta box no longer disables collaborative editing
* Improved: Sidebar panel includes plugin dashicon for better visual identification
* Improved: Fallback to classic meta box in the block editor if the sidebar script is missing

= 1.7.2 =
* Fixed: Buttons appearing in footer or sidebar on themes that apply the_content filter outside the main loop
* Fixed: Missing styles when using shortcodes with page builders that process content after asset enqueue (Bricks Builder, etc.)
* Fixed: Mastodon instance and title text were stored as default values on new installations instead of being placeholder-only
* Improved: Frontend asset enqueue logic centralised in a single helper function shared by auto-insert and shortcode modes

= 1.7.1 =
* Fixed: Admin CSS specificity issues with WordPress 7.0 new button and dashicon styles
* Fixed: Export CSV button icon alignment broken by WP core .button .dashicons override
* Fixed: Promotional banner buttons forced to 40px height by WP core min-height reset
* Fixed: AI/Social type badges now have consistent height across all platforms
* Fixed: Data retention row vertical alignment improved for mixed-height controls
* Added: New service recommendation in promotional banner rotation
* Tested up to WordPress 7.0

= 1.7.0 =
* Added: Period comparison for analytics — compare with previous period, same period last year, or a custom date range
* Added: Comparison indicators on stat cards showing percentage change with color-coded arrows
* Added: Timeline chart automatically switches to total view with dashed comparison line when comparison is active
* Added: Two-column HTML tooltip on comparison chart showing both periods with change percentage and difference
* Added: Export CSV dropdown with two options: "Current period" (full data) and "Timeline summary" (daily breakdown)
* Added: Timeline export includes comparison columns automatically when comparison is active
* Added: Client-side paginated navigation with arrow buttons replacing "Load more" on both analytics tables
* Added: Top and bottom paginators on platforms and content tables, synced and only visible when more than 10 rows
* Added: Dashicon before plugin name on analytics and settings page titles
* Added: REST API endpoints: stats/compare, timeline/compare, export/timeline
* Added: Database method for zero-filled timeline data (used for comparison alignment by index)
* Fixed: Platform type labels (AI/Social) in the top platforms table are now translatable
* Improved: Tables load all results in a single request for faster client-side pagination

= 1.6.2 =
* Fix: Prevent button text wrapping on themes with larger font sizes or narrower button widths

= 1.6.1 =
* Fixed: Settings link in plugins screen now correctly points to the Settings tab instead of the default Analytics tab
* Fixed: Mastodon instance field now uses placeholder instead of a pre-filled default value
* Fixed: Global title field now uses placeholder instead of a pre-filled default value, consistent with section title fields

= 1.6.0 =
* Added: Mastodon support with configurable instance field for federated sharing
* Added: Threads (Meta) social sharing button
* Added: Pinterest social sharing button
* Added: Qwen (Alibaba) AI platform integration with copy-to-clipboard behavior
* Added: Meta AI platform integration with copy-to-clipboard behavior
* Added: Official brand SVG icons from Simple Icons library for all supported platforms
* Added: Outline button style (brand-colored borders, transparent background, fills on hover)
* Added: Custom colors button style with built-in color picker (wp_color_picker)
* Added: 4 button size presets: compact, normal, large, and fluid
* Added: Optional section titles for separate AI and Social group headings
* Added: Drag & drop reordering within AI and Social groups in settings
* Added: Shortcode attributes: ai_title, social_title, size
* Changed: X (Twitter) brand color updated from blue (#1da1f2) to black (#000000)
* Changed: Default and Minimal styles merged into a single "Minimal (default)" style
* Changed: All platform brand colors updated to match current official guidelines
* Changed: SEO button type setting simplified to clean radio buttons with a single description
* Improved: CSS fully refactored using CSS custom properties, no more !important overrides
* Improved: Brand and icons-only styles now use a single hover rule (brightness filter) instead of per-platform hover declarations
* Improved: Centralized platform color definitions in functions-helpers.php for consistency across CSS, JS, and admin
* Improved: Icon rendering switched from stroke-based to fill-based SVG for sharper brand representation
* Improved: Mixed button order correctly displays the general title even when section titles are configured
* Improved: Mastodon, Threads, Pinterest, Qwen, and Meta AI added to analytics platform maps

= 1.5.5 =
* Improved: New plugin suggestion added.

= 1.5.4 =
* Fixed: Links from the Analytics and Settings plugins page now take you to the correct tabs.

= 1.5.3 =
* Changed: Analytics tab is now the default tab when opening the plugin settings page

= 1.5.2 =
* Added: Data retention settings with configurable period (1 month, 3 months, 6 months, 1 year, or forever)
* Added: Automatic daily purge of analytics data older than the configured retention period
* Added: "Delete all data" button for manual one-click analytics data removal
* Changed: "Data cleanup" setting renamed to "Data retention" with improved layout
* Improved: Retention period, uninstall cleanup, and manual deletion grouped in a single settings row

= 1.5.1 =
* Fixed: Click tracking now works correctly with full-page caching plugins (SiteGround Speed Optimizer, WP Super Cache, etc.)
* Fixed: Analytics REST API responses no longer cached by server-side caching plugins
* Improved: Dashboard widget uses transient cache to reduce database queries on admin homepage
* Improved: Removed aggressive cache invalidation on every click insert for better performance under load

= 1.5.0 =
* Added: Click analytics dashboard with timeline charts, platform breakdown, and content performance tables
* Added: Per-platform breakdown in timeline chart with brand colors and interactive legend
* Added: CSV export for analytics data (date, platform, type, post title, post URL, clicks)
* Added: REST API endpoints for analytics data (stats, timeline, timeline-by-platform, platforms, content, export)
* Added: Dashboard widget with 7-day sparkline chart and top platforms summary
* Added: VigIA integration - cross-reference share clicks with AI crawler visits
* Added: Dynamic promotional banner with AyudaWP plugin catalog rotation
* Added: Tabbed admin interface (Settings / Analytics)
* Added: Direct Analytics link in plugin row on the plugins screen
* Added: Platform type badges (Social / AI) in analytics tables
* Improved: Frontend CSS/JS only load on pages where buttons are actually displayed
* Improved: Posts with buttons disabled via meta box no longer load plugin assets
* Improved: Admin styles moved to external CSS file following WordPress coding standards
* Fixed: Export CSV button icon vertical alignment
* Fixed: Analytics dashboard failing to load due to incomplete localized data

= 1.4.1 =
* Fixed: Minor edits to the text on the settings page

= 1.4.0 =
* Added: Individual post/page exclusion via meta box (works with both classic and block editors)
* Added: SEO plugin integration to automatically exclude noindex content
* Added: Support for Yoast SEO, Rank Math, All in One SEO, SEOPress, and The SEO Framework
* Changed: LINE icon updated to be more distinctive (smiley face in speech bubble)
* Changed: Simplified settings page info box with link to plugin page for shortcode examples
* Changed: Promotional section redesigned with 3-column layout and plugin install modals
* Improved: Clean separation of includes in organized file structure
* Improved: Better defaults for new installations

= 1.3.1 =
* Fixed: DeepSeek button now works correctly using copy-to-clipboard method (web interface doesn't support URL parameters)
* Fixed: Microsoft Copilot button now works correctly using copy-to-clipboard method (?q= parameter no longer supported)
* Improved: DeepSeek and Copilot now use the same reliable approach as Gemini
* Improved: Added specific tooltips for DeepSeek and Copilot indicating copy-to-clipboard behavior
* Improved: Unified handling for all platforms that require copy-to-clipboard (Gemini, DeepSeek, Copilot)

= 1.3.0 =
* Added: Support for Reddit, Bluesky, and LINE social networks
* Added: Integration with DeepSeek, Mistral AI, and Microsoft Copilot
* Added: Universal tooltip system for ALL buttons (not just icons-only)
* Fixed: Inconsistent sizing between link and button elements
* Fixed: Hover effects now work uniformly across all button types
* Improved: Better tooltip positioning and styling
* Improved: Consistent 44px size for icons-only mode (both links and buttons)
* Improved: JavaScript event handling for better compatibility
* Improved: CSS transitions and animations for smoother interactions
* Improved: Mobile responsiveness for new platforms
* Updated: Icon set with new platform graphics
* Updated: Documentation with new platform information

= 1.2.0 =
* Added: Google AI button with direct integration to Google AI Mode
* Added: Support for Google's new AI Mode (udm=50) for direct AI responses
* Improved: Renamed "Google AI (Gemini)" to just "Gemini" for clarity
* Improved: Users can now choose between Google AI (automatic) or Gemini (copy & paste)
* Improved: Better support for regions where Google AI Mode is available
* Fixed: Links mode (`<a>` elements) now work correctly with added data attributes for JavaScript handling
* Updated: Frontend JavaScript to handle both Google AI and Gemini buttons
* Updated: Icon system with new Google AI icon (search with sparkle)
* Updated: CSS with styles for both Google AI and Gemini buttons
* Updated: Documentation with information about both Google AI options

= 1.1.4 =
* Added: Button alignment option (left/centered) for better design control
* Improved: All buttons now have uniform width (180px) for consistent appearance
* Improved: Buttons stack vertically on mobile (480px and below) preventing text overflow
* Improved: Icons-only mode properly centered when alignment is set to centered
* Improved: Better responsive behavior with optimized button widths across all screen sizes
* Fixed: Text wrapping issues in buttons with longer labels like "X (Twitter)"

= 1.1.3 =
* Fixed: Resolved JavaScript event handler conflicts that prevented buttons from working on some sites when logged in
* Improved: Better event handling with capture phase to prevent interference from other plugins
* Improved: More elegant centered notification for Google AI prompt copying
* Improved: Enhanced compatibility with themes and plugins that modify JavaScript execution
* Fixed: Resolved button functionality issues in WordPress admin environment

= 1.1.2 =
* Improved: Removed more unnecessary colours and icons in plugin settings page

= 1.1.1 =
* Improved: Removed all unnecessary colours and icons in plugin settings page

= 1.1.0 =
* Added: SEO settings section with option to choose between `<a>` links or `<button>` elements
* Added: Full support for button elements as an alternative to links
* Added: Detailed explanations of SEO implications for each option
* Improved: JavaScript to handle both link and button elements seamlessly
* Improved: CSS to ensure consistent styling for both element types
* Improved: Admin interface with new SEO section and better organization
* Fixed: Better accessibility for button elements
* Updated: Documentation to explain SEO benefits of each approach

= 1.0.9 =
* Fixed: Added missed translations for tooltips

= 1.0.8 =
* Added: Icons-only button style for modern, minimalist design
* Added: Option to show icons alongside text in any existing style
* Added: Icon style selection (circular or square corners for icons-only mode)
* Added: Enhanced tooltips for icons-only buttons showing platform names
* Added: Responsive grid layout for icons-only mode on mobile devices
* Added: Data cleanup control - optional automatic data deletion on plugin uninstall
* Added: Improved icon system with lightweight SVG graphics
* Improved: Complete code restructuring with modular architecture for better performance
* Improved: Separated functionality into individual class files in /includes folder
* Improved: Enhanced mobile responsiveness for all button styles
* Improved: Better default values (AIs first, brand colors, span titles, circular icons)
* Improved: Enhanced admin interface with icon previews and danger zone styling
* Fixed: Better CSS specificity to prevent theme conflicts
* Updated: All icon graphics for better platform recognition
