=== Trendly AI Post - AI Content Generator, ChatGPT, Gemini, Claude and Google News Auto Blog ===
Contributors: nitishsharma6, mandeepsingh11
Author: Sprout Sage Solutions
Author URI: https://sproutsagesolutions.com
Tags: ai content generator, chatgpt, auto blog, google news, ai writer
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Free AI content generator for WordPress. Auto-write SEO posts from trending Google News using ChatGPT, Gemini or Claude. No coding.

== Description ==

Trendly AI Post is a free AI content generator for WordPress. It picks up real trending topics from Google News and writes a full blog post for you in one click, with the title, headings, featured image, internal links, FAQ section and schema already in place.

You bring your own API key from any one of these three AI services:

* Google Gemini (free tier available)
* OpenAI ChatGPT (GPT-4o mini, GPT-4o, GPT-4.1)
* Anthropic Claude (Haiku, Sonnet, Opus)

And pick how you want the images:

* Pexels stock photos (free)
* DALL-E 3 by OpenAI
* Google Imagen 3

That is it. No subscription, no premium tier, no hidden upsells. The whole plugin is GPL and stays free forever.

Built and maintained by **Sprout Sage Solutions** — developed by Nitish Sharma and Mandeep Singh. See our [WordPress.org profile](https://profiles.wordpress.org/nitishsharma6/) for other plugins and support.

= What you get =

* One-click SEO post. The plugin writes the full article with title, intro, H2 and H3 headings, FAQ, internal links, featured image and JSON-LD schema. Ready to publish.
* Trending topics from 25+ regions (India, US, UK, AU, DE, FR, IT, ES, BR, JP and more). Fetched live from Google News every cron run and deduped so you never write the same story twice.
* Three AI brains. Gemini for free and fast. GPT-4o or Claude Sonnet for premium long-form. Claude Opus for the most nuanced output. Configure all three at once and switch per post if you want.
* Automatic featured images. Free Pexels stock photos, or AI-generated images using DALL-E 3 or Imagen 3 with smart prompt rewriting so they look editorial.
* Auto schedule or manual. Set 1 or 2 posts per day on autopilot, or generate manually from the Generate page. Drafts can go to a Review Queue so you stay in control.
* SEO built in. Article and FAQPage JSON-LD schema, OpenGraph and Twitter Card meta, auto Table of Contents, reading-time badge, internal linking automation and a Related Articles grid. No extra SEO plugin needed.
* Brand Voice trainer. Paste 3 paragraphs of your own writing, click Analyze and every new post will sound like you.
* Custom prompt templates. News, How-to, Listicle and Opinion ship built-in. Clone any one of them and tweak the tone, length and structure.
* Analytics page. See exactly how many posts you have generated, which AI wrote them, how features are landing and what your top source topics are.
* Privacy first. No telemetry, no tracking pixels, no third-party CDN, no OAuth. Your API keys live in your own database and never leave your server.

= How it works =

1. Pick your AI provider (Gemini, OpenAI or Claude) and paste your API key. Free tiers are available for all three.
2. Pick your image source (Pexels, DALL-E 3 or Imagen 3).
3. Choose a region and a writing style (News, How-to, Listicle, Opinion or your own template).
4. Turn on auto-schedule, or generate manually from a trending topic or your own idea.
5. Each post comes out with a featured image, internal links, FAQ accordion, JSON-LD schema and social captions. Fully SEO-ready.

= Who is this for =

Bloggers, niche site owners, news publishers, affiliate marketers, agencies, SaaS founders and ecommerce store owners. Basically anyone who wants a steady content schedule without spending hours every day brainstorming and writing.

If you run a tech blog, a sports news site, a finance affiliate site or a lifestyle niche site, this plugin will keep your archive fresh and Google happy.

== External Services ==

This plugin connects to the following external services:

1. Google News RSS - to fetch trending news data
   Data sent: region parameter for news feed
   Terms: https://news.google.com/

2. Gemini API (by Google AI) - to generate AI-based post content (when Gemini is the selected text provider) and optionally AI-generated featured images via Imagen
   Data sent: text prompts; image prompts derived from your post topic
   Terms: https://ai.google.dev/terms
   Privacy: https://ai.google.dev/gemini-api/terms

3. OpenAI API - to generate AI-based post content (when OpenAI is the selected text provider) and optionally AI-generated featured images via DALL-E
   Data sent: text prompts; image prompts derived from your post topic
   Terms: https://openai.com/policies/row-terms-of-use/
   Privacy: https://openai.com/policies/row-privacy-policy/

4. Anthropic Claude API - to generate AI-based post content (when Claude is the selected provider)
   Data sent: text prompts
   Terms: https://www.anthropic.com/legal/commercial-terms
   Privacy: https://www.anthropic.com/legal/privacy

5. Pexels API - to fetch and download stock images
   Data sent: search keywords
   Terms: https://www.pexels.com/api/terms/

= Features =

**AI writers (pick any):**
* Google Gemini (2.5 Flash / 2.5 Pro) - free tier, fast, recommended for most users
* OpenAI ChatGPT (GPT-4o mini, GPT-4o, GPT-4.1) - paid, best for long-form quality
* Anthropic Claude (Haiku 4.5 / Sonnet 4.6 / Opus 4.7) - paid, best for nuanced writing

**Image sources (pick any):**
* Pexels - free stock photos, no usage cost
* OpenAI DALL-E 3 / gpt-image-1 - AI-generated images
* Google Imagen 3 (via Gemini) - AI-generated images

**Content automation:**
* Trending topic discovery from Google News across 25+ regions
* Custom prompt templates - News, How-to, Listicle, Opinion ship built-in, plus your own with variable substitution
* Brand Voice trainer - paste 3 writing samples and every new post mimics your style
* Auto-schedule 1-2 posts per day, or generate manually
* Auto-publish or send to a Review Queue with bulk approve / discard
* Duplicate prevention - recognizes the same trending topic even when worded differently

**On-page SEO (built-in, no extra plugin needed):**
* JSON-LD Article / NewsArticle schema in `<head>`
* JSON-LD FAQPage schema for Google rich results
* OpenGraph + Twitter Card meta (og:image, og:type, article:published_time, etc.)
* Auto Table of Contents from H2/H3 headings with jump-link IDs
* Reading-time badge ("X min read")
* AI-generated FAQ accordion (3-8 Q&A pairs per post)
* Related Articles grid using internal-linking matches
* Internal linking automation - Dice-coefficient relevance scoring + word-boundary anchor placement

**Social:**
* AI-generated captions for X (Twitter), LinkedIn, Facebook
* Optional frontend share buttons (X, LinkedIn, Facebook, WhatsApp, Reddit) - privacy-first, no OAuth, no auto-posting

**Analytics:**
* All-time / 30-day / 7-day / today generation counts
* 14-day generation timeline bar chart
* AI provider mix + image source mix
* Feature adoption rings (featured image / internal links / social captions)
* Status distribution + top source topics

**Privacy & compliance:**
* No telemetry, no tracking, no external CDN
* API keys stored encrypted in your wp_options
* Per-user hourly rate limit prevents runaway AI calls
* Fully GPL-compatible - no premium tier, no upsells

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/trendly-ai-post` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Use the Trendly AI Post menu to configure the plugin
4. Add your Google Gemini API key and Pexels API key in the settings
5. Configure your preferred region, post length, category, and author
6. Enable auto-scheduling or manually generate posts as needed

== Frequently Asked Questions ==

= Is Trendly AI Post free? =

Yes.100% free. No premium tier, no upsells, no locked features. The plugin itself is GPL-licensed. You only pay your AI provider for usage (Gemini has a generous free tier; OpenAI and Claude are pay-per-token).

= Do I need an API key? =

Yes. you'll need at least one AI provider key (Gemini, OpenAI, or Claude) and optionally a Pexels key for free stock images. All keys are free to obtain:

* Google Gemini: https://ai.google.dev/
* OpenAI: https://platform.openai.com/api-keys
* Anthropic Claude: https://console.anthropic.com/
* Pexels: https://www.pexels.com/api/

= Which AI provider should I pick? =

* **Just want to try it free?** Pick **Google Gemini 2.5 Flash**. Generous free tier, fast.
* **Need the best long-form writing?** **OpenAI GPT-4o** or **Claude Sonnet 4.6**. Paid but premium output.
* **Nuanced, opinionated writing?** **Claude Opus 4.7** is the top tier.

You can configure all three at once and switch between them per post.

= Does this work with ChatGPT? =

Yes. The plugin supports OpenAI's GPT-4o mini, GPT-4o, and GPT-4.1 models via the OpenAI API. Paste your OpenAI API key in Settings -> Providers and pick your preferred model.

= Does it write SEO-optimized content? =

Yes. Every generated post ships with:

* Article + FAQPage JSON-LD schema for Google rich results
* OpenGraph + Twitter Card meta tags
* Auto Table of Contents with anchor IDs
* AI-generated FAQ accordion
* Internal links to related posts on your site
* Reading-time badge
* Featured image with alt text from title
* SEO-friendly slug + meta description

= How many posts can I auto-generate per day? =

The auto-schedule supports 1 or 2 posts per day at your preferred time. You can also generate unlimited posts manually from the Generate page (subject to your AI provider's rate limits).

= Will it write in my voice? =

Yes. use the **Brand Voice trainer**. Paste 3 paragraphs of your existing writing, click Analyze, and Trendly derives a style profile that's prepended to every prompt going forward. Works across all three AI providers.

= Can I generate posts in languages other than English? =

Yes. Pick any region from the 25+ supported (India, US, UK, AU, DE, FR, IT, ES, BR, JP, etc.) and the AI will follow Google News' regional language for that locale.

= Does it work with my existing theme? =

Yes. works with **any standard WordPress theme**. Posts are written to the standard WordPress post type with normal HTML. No custom post types, no shortcodes, no theme overrides. Your existing posts are untouched on install.

= Does this plugin send any data to third parties? =

Only when you generate a post. The plugin sends your post topic to the AI provider you selected (Gemini / OpenAI / Claude) and image search keywords to your image provider (Pexels / OpenAI / Imagen). No analytics, no telemetry, no tracking pixels, no third-party CDN. See the full External Services section above for details.

= Will my existing posts be modified? =

No. Trendly only enhances posts that the plugin itself generated. Your existing posts are completely untouched on install. You can toggle this scope in Settings -> Single post enhancements.

= How does the duplicate-prevention work? =

The plugin normalizes each topic (lowercase, strips punctuation, sorts tokens, drops short words) and hashes the result. "Apple unveils iPhone 17" and "iPhone 17 launched by Apple" collide as duplicates and only one gets generated.

= Where do I get support? =

Use the [WordPress.org support forum](https://wordpress.org/support/plugin/trendly-ai-post/) for any questions or bug reports. Maintained personally by Nitish Sharma.

== Screenshots ==

1. **Dashboard**.Provider status, today's generation count, recent activity, and one-click quick actions.
2. **Generate page**.Pick a trending topic or enter your own; choose length, image source, prompt template, and publish status.
3. **Analytics**.14-day generation timeline, AI provider mix, image source mix, feature-adoption rings, status distribution, and top source topics.
4. **Settings**.Pick from Gemini, ChatGPT, or Claude. Image source: Pexels, DALL-E, or Imagen. Per-provider API key fields with live "Test connection" buttons.
5. **Generated single post**.Reading-time pill, auto Table of Contents, AI-generated FAQ accordion, and Related Articles grid - all SEO-ready out of the box.

== Changelog ==

= 2.0.0 =
* New: Completely redesigned admin. The whole dashboard is now a modern single-page app with a dark sidebar, rounded cards, stat tiles and a cleaner layout - every screen (Dashboard, Generate, Prompt Templates, Brand Voice, Analytics, Review Queue, Settings) lives in one fast interface.
* Improvement: Navigation is instant - switching screens no longer reloads the page. Old bookmarked menu URLs redirect automatically into the new app.
* Improvement: Settings, templates, brand voice and the review queue update in place without full-page reloads.
* Change: Now requires WordPress 6.2 or newer.
* Note: All your existing settings, templates, brand voice and generated posts are carried over unchanged.

= 1.9.0 =
* New: AI-generated FAQ section. One round-trip per post produces 3-8 Q&A pairs (configurable) stored in post meta. Renders as an accessible `<details>`/`<summary>` accordion at the end of the article.
* New: JSON-LD `FAQPage` schema injected into `<head>` so the FAQ is eligible for Google rich results.
* New: Reading-time pill ("X min read") at the top of the post, calculated at generation time from word count and stored in `_trendly_reading_time` meta.
* New: Auto-generated Table of Contents from H2/H3 headings. Adds `id` attributes to headings so jump-links work. Hidden automatically when a post has fewer than 3 headings.
* New: "Related articles" grid at the end of every post, derived from the internal linker's `_trendly_internal_links` meta - featured-image cards that link to genuinely topical neighbors.
* New: Settings -> Single post enhancements card with toggles for each of the four sections plus a "limit to generated posts" scope option.
* Improvement: Internal linker now has a soft-fallback pass - when strict word-boundary matching produces zero anchors (typical for niche-topic posts on small sites), the linker retries once with relaxed rules (4+ char tokens, no common-noun filter, cap of 1 anchor) so users still see at least one related link.
* Tested up to WordPress 7.0.

= 1.8.0 =
* New: Analytics page. Dedicated admin screen with hero stats (all-time / 30d / 7d / today), a 14-day generation timeline bar chart, AI-provider mix, image-source mix, feature adoption rings (featured image / internal links / social captions), status distribution, and top source topics.
* New: Posts now record `_trendly_provider_used`, `_trendly_image_provider_used`, and `_trendly_length` meta so historical attribution is accurate even after you switch providers.
* New: `Trendly_Analytics` service - derives every metric from existing post meta in one $wpdb query, caches aggregates for 5 minutes, and auto-flushes on post create/update/delete/trash/untrash.
* Improvement: All charts are pure CSS - no third-party charting library, no extra HTTP requests, no tracking pixels.
* Tested up to WordPress 7.0.

= 1.7.0 =
* New: Auto social sharing. Every new generated post gets platform-tuned captions (X/Twitter, LinkedIn, Facebook) written by your active AI provider in a single round-trip and stored in post meta.
* New: "Trendly - Social Captions" meta box on the post edit screen - copy any caption with one click, or open the share-intent URL in a new tab to publish to X, LinkedIn, Facebook, WhatsApp, or Reddit.
* New: Optional frontend share buttons (Settings -> Social sharing -> Frontend buttons). Position above/below/both, scope to Trendly-generated posts only, pick which platforms appear. Inline SVG icons - no external CDN, no tracking pixels, no JavaScript required to render.
* New: Regenerate captions on demand from the meta box - same per-user 20/hour rate limit as other AI calls.
* Privacy: Share buttons use click-to-share intent URLs - no OAuth, no auto-posting, no data leaves the visitor's browser until they click. Captions live in your database only.
* Tested up to WordPress 7.0.

= 1.6.0 =
* New: Internal linking automation. After a post is generated, Trendly scans your last 50 published posts, scores each by topical overlap (Dice coefficient over tokenized title + body, with stopwords filtered), and injects 1-3 contextual links into the new post's paragraphs.
* New: Settings -> Content defaults -> "Internal links" toggle and "Max links per post" (1-5) for fine control.
* New: `_trendly_internal_links` post meta records which post IDs were linked into a given post - useful for analytics and future link-recycling features.
* Improvement: Anchor tags are tagged with `class="trendly-internal-link"` so themes can style them and the linker remains idempotent (never re-injects on the same post).
* Improvement: Settings card titles now use a tinted icon badge for consistent vertical alignment across providers, image sources, content defaults, and auto-schedule.
* Tested up to WordPress 7.0.

= 1.5.0 =
* New: AI-generated featured images. Choose between Pexels stock photos (free), OpenAI DALL-E 3, or Google Imagen 3.the same API key powers text + image generation.
* New: Image provider abstraction (Trendly_Image_Provider_Interface) - third-party add-ons can register additional image providers via the `trendly_image_providers` filter.
* New: Image-source picker in Settings with the same 3-card UI as the AI provider picker.
* Improvement: Image fetching is now unified across providers - Pexels downloads its URLs, AI providers decode base64 to temp files, the post generator just sideloads.
* Improvement: Editorial-style image prompt rewriter ("Professional, high-quality, no text in image") applied automatically to AI-generated images.
* Tested up to WordPress 7.0.

= 1.4.0 =
* New: Brand Voice trainer. Paste up to 3 paragraphs of your own writing and Trendly uses your active AI provider to derive a style profile that mimics your voice on every new generation.
* New: Toggle the voice on/off without losing the saved samples and profile.
* New: Voice profile is prepended to every prompt across all providers (Gemini, OpenAI, Claude) when enabled - works alongside custom prompt templates.
* New: Low-level provider - complete() method exposed for power-user features and future analytics.
* Tested up to WordPress 7.0.

= 1.3.0 =
* New: Custom prompt templates. Create reusable templates with custom tone, structure, and voice. Ships with 4 built-in templates (News, How-to, Listicle, Opinion).
* New: Template picker on the Generate page - override the default template on a per-generation basis.
* New: Default template selector in Settings -> Content defaults.
* New: Variable substitution in templates - use `{topic}`, `{words}`, and `{site_name}` anywhere in instructions or structure.
* New: Clone built-in templates to customize them; built-ins themselves stay protected from deletion.
* New: Each generated post records the template it was generated from in `_trendly_template_id` post meta.
* Tested up to WordPress 7.0.

= 1.2.0 =
* New: Multi-provider AI support. Choose between Google Gemini, OpenAI (ChatGPT), or Anthropic Claude for content generation.
* New: Model picker per provider (Gemini 2.5 Flash/Pro, GPT-4o mini/4o/4.1, Claude Haiku 4.5 / Sonnet 4.6 / Opus 4.7).
* New: Per-provider "Test connection" button in Settings - validate each provider's key independently.
* New: Provider abstraction layer (Trendly_AI_Provider_Interface) - third-party add-on plugins can now register additional providers via the `trendly_ai_providers` filter.
* New: Image-source settings card is now separate from AI-provider settings for clearer organization.
* Improvement: Onboarding wizard now prompts users to pick a provider, paste the key, and validate before continuing.
* Improvement: Existing Gemini users see zero behavior change.`ai_provider` defaults to `gemini` and existing keys keep working.
* Improvement: All providers share a unified HTML normalization pipeline so the editor sees the same post shape regardless of which model produced the draft.
* Tested up to WordPress 7.0.

= 1.1.0 =
* New: Dashboard landing page with setup status, generation stats, recent generations, and quick actions.
* New: Setup Wizard that runs on first activation - connect AI keys, set content defaults, generate your first post.
* New: Review Queue with bulk approve / discard. Generated drafts wait for your review before going live.
* New: "Auto-publish" setting - choose between Draft (recommended) or Publish immediately for auto-scheduled posts.
* New: Generate Content page redesigned with trend cards, source attribution, live filter, skeleton loader, and per-card success/error states.
* New: Settings page reorganized into clear card sections (Credentials / Content defaults / Auto-schedule).
* New: JSON-LD Article/NewsArticle schema, og:site_name, og:locale, og:image dimensions, article:published_time / modified_time / author / section / tag for richer search and social previews.
* New: Improved duplicate detection - recognizes the same trending topic even when worded differently.
* New: Trending topics are now cached for 15 minutes per region to reduce duplicate fetches.
* Improvement: Pending-review count badge in the admin menu (like the Comments count).
* Improvement: WP "Discourage search engines" setting is detected and surfaced on the Dashboard so generated posts don't silently fail to rank.
* Fix: Removed duplicate canonical tag (WordPress core already emits one).
* Tested up to WordPress 7.0.

= 1.0.2 =
* Security: API key fields now use password inputs to prevent shoulder-surfing.
* Security: All scheduled cron events are now correctly cleared when settings change or the plugin is deactivated.
* Compatibility: Slug-shortening behavior now applies only to plugin-generated posts. Posts created by users or other plugins are no longer affected.
* Improvement: "Test API Keys" now performs real connectivity checks against Gemini and Pexels and reports per-service status.
* Improvement: AI-generated content now preserves formatting (bold, italics, lists, links) more reliably and is filtered through wp_kses_post for safety.
* Improvement: Per-user hourly rate limit added to prevent runaway AI generation.
* Improvement: Translations now load correctly for custom language files in /languages.
* Fix: Removed the silent placeholder content fallback. The plugin now shows a clear setup prompt instead of inserting template content when API keys are missing.
* Fix: Resolved an XML parsing notice that could surface when Google News RSS returned malformed responses.
* Tested up to WordPress 7.0.

= 1.0.1 =
* Updated compatibility with WordPress 6.9
* Minor bug fixes and performance improvements

= 1.0.0 =
* Initial release
* Google News trending topic integration
* Google Gemini AI content generation
* Pexels image integration
* Automatic scheduling (1-2 posts/day)
* Duplicate prevention system
* SEO preview meta box
* Multi-region support (25+ countries)

== Upgrade Notice ==

= 1.9.0 =
Major single-post upgrade. AI-generated FAQ accordion with FAQPage schema, auto Table of Contents, reading-time badge, and Related Articles grid. Plus soft-fallback for the internal linker so even niche posts get at least one link.

= 1.8.0 =
New Analytics page. see exactly how many posts you've generated, which AI provider wrote them, and how features are landing. Numbers cached for 5 minutes and auto-refresh on post changes.

= 1.7.0 =
Auto social sharing. AI-written captions for X, LinkedIn, and Facebook on every new post, plus optional frontend share buttons. No OAuth, no auto-posting, no tracking.

= 1.6.0 =
Internal linking automation. Trendly now auto-inserts contextual links to your existing posts into every newly generated post. Big SEO lever, no extra API cost. Toggle in Settings, Content defaults.

= 1.5.0 =
AI-generated featured images. Choose Pexels stock photos (free) or AI images via DALL-E 3 or Imagen 3.same API key as your text provider.

= 1.4.0 =
Brand Voice trainer. Paste samples of your writing, click Analyze, and every new post will sound like you.

= 1.3.0 =
Custom prompt templates. Create reusable writing styles (News, How-to, Listicle, Opinion all ship built-in) and pick one per post or set a site-wide default.

= 1.2.0 =
Multi-provider AI: choose between Gemini, OpenAI, or Claude. Existing Gemini users see no behavior change. your key keeps working.

= 1.1.0 =
Major UI overhaul. New Dashboard, Setup Wizard, Review Queue, redesigned Settings and Generate pages, plus JSON-LD schema and richer OpenGraph meta for better SEO and social previews.

= 1.0.2 =
Recommended security and reliability update. Password-masked API keys, real connectivity checks, scoped slug rewriting, and improved formatting in AI-generated posts.

= 1.0.1 =
Updated compatibility with WordPress 6.9 and minor bug fixes.

= 1.0.0 =
Initial release of Trendly AI Post - Generate SEO-optimized content from trending topics automatically!