=== TA4A FeedPilot ===
Contributors: ta4a
Donate link: https://www.ta4a.net/
Tags: rss, rss to post, auto blog, ai rewriter, feed
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automate smart content publishing from RSS & Atom feeds with AI rewriting (Gemini & OpenAI), full-text extraction, and Arabic UTF-8 support.

== Description ==

**TA4A FeedPilot** is a state-of-the-art, high-performance RSS & Atom feed automation plugin for WordPress. Engineered for digital publishers, news agencies, content curators, and bloggers, it automates the entire ingestion lifecycle—from feed fetching to intelligent full-text article extraction, featured image management, and automated content rewriting powered by **Google Gemini** and **OpenAI**.

With specialized native support for Arabic UTF-8 character preservation, RTL layouts, Cloudflare anti-bot handling, and SSRF security hardening, **TA4A FeedPilot** is the definitive auto-blogging solution for WordPress 6.0 through 6.7+ and modern PHP 8.1, 8.2, 8.3, and 8.4.

---

### 🌟 Key Features

* **Multi-Source RSS & Atom Engine:** Ingest content smoothly from RSS 2.0, RSS 1.0 (RDF), RSS 0.9x, and Atom feeds.
* **🤖 Integrated AI Content Rewriter:** Rephrase incoming articles into 100% unique, human-like journalistic prose using Google Gemini (1.5 Flash, 2.0 Flash, 1.5 Pro) or OpenAI (GPT-4o-mini, GPT-4o).
* **📄 Smart Full-Text Article Extraction:** Automatically scrape the original article body instead of relying on brief RSS snippets. Intelligently strips ads, tracking scripts, sidebars, and junk while keeping article text and inline media.
* **🖼️ Advanced Media Manager & Deduplication:** Securely downloads remote images into the WordPress Media Library, sets the post thumbnail (Featured Image), and prevents duplicate media downloads using URL hash indexing. Bypasses external hotlink protections with automated Referer headers.
* **🇸🇦 Flawless Arabic & RTL Support:** Fully optimized to preserve Arabic UTF-8 characters, complex XML namespaces (`<content:encoded>`, `<atom:content>`), CDATA blocks, and diacritics without broken encoding.
* **🔍 Strict Anti-Duplicate Protection:** Triple-layer duplicate guard checks feed GUIDs, normalized original URLs, and sanitized titles to avoid re-publishing articles even if source URLs change.
* **🛡️ Hardened Security & SSRF Protection:** Validates all destination URLs against SSRF vulnerabilities, blocks private RFC1918 subnets, and sanitizes all incoming content.
* **☁️ Cloudflare & Rate-Limiting Resilience:** Automatic browser header mimicry, exponential backoff, and retry handling for HTTP 403 and 429 responses.
* **⚡ Concurrency Lock & WP-Cron Optimization:** Transient mutex locks prevent overlapping cron executions or server overloads.
* **Modern Bilingual Dashboard:** Interactive admin panel in Arabic and English with real-time status indicators, execution statistics, and 1-click test/preview modal.

---

### 🇸🇦 نبذة باللغة العربية (Arabic Overview)

**إضافة TA4A FeedPilot الذكية لأتمتة جلب ونشر الخلاصات الإخبارية (RSS to Post):**
إضافة ووردبريس احترافية وعصرية لإدارة ونشر المحتوى التلقائي من أي خلاصة RSS أو Atom، مع دمج تقنيات الذكاء الاصطناعي (Google Gemini و OpenAI) لإعادة صياغة الأخبار والمقالات بأسلوب صحفي حصري غير مكرر.

**أبرز المميزات:**
* استخراج محتوى المقال الأصلي بالكامل (Full-Text) وإزالة الإعلانات والقوائم الجانبية تلقائياً.
* إعادة صياغة المحتوى والعناوين بالذكاء الاصطناعي لإنتاج مقالات حصرية متوافقة مع السيو (SEO).
* تحميل الصور لمكتبة الوسائط وتعيين الصورة البارزة مع منع تكرار تحميل نفس الصورة.
* دعم حصين للغة العربية وترميز UTF-8 دون أي تشوه في الحروف أو التشكيل.
* توافق كامل مع PHP 8.2 و 8.3 و 8.4 وووردبريس 6.7+.

== Installation ==

1. Upload the `ta4a-feedpilot` folder to the `/wp-content/plugins/` directory, or install directly through **Plugins > Add New > Upload Plugin** in WordPress.
2. Activate the plugin through the **Plugins** screen.
3. (Optional) Go to **FeedPilot > AI & Settings** to configure your Google Gemini or OpenAI API keys.
4. Navigate to **FeedPilot > Add Feed**, paste your RSS feed URL, choose category, toggle AI rewriting or full-text extraction, and save.
5. Your feed will automatically publish new stories on your configured schedule!

== Frequently Asked Questions ==

= Does this plugin support Arabic feeds and RTL formatting? =
Yes, absolutely! TA4A FeedPilot was built from the ground up to support Arabic character encodings (UTF-8, Windows-1256), CDATA blocks, and RTL content structures.

= How does the AI content rewriting work? =
You can connect your Google Gemini API key (free at Google AI Studio) or OpenAI API key. When a new article is ingested, FeedPilot instructs the AI model to rephrase the article into engaging, journalistic prose while keeping all facts, names, and dates accurate.

= What happens if an RSS feed only provides a short summary? =
Enable the **Smart Full-Text Extraction** option in the feed settings. FeedPilot will visit the original article URL, extract the clean full body text, strip ads and navigation sidebars, and publish the complete article.

= Will images fill up my server with duplicates? =
No. FeedPilot features an intelligent media deduplication engine that hashes source image URLs. If an image has already been downloaded, it will reuse the existing media library attachment.

= Is the plugin compatible with PHP 8.3 and 8.4? =
Yes, TA4A FeedPilot 2.0.0 is thoroughly tested and 100% compliant with PHP 7.4, 8.0, 8.1, 8.2, 8.3, and 8.4.

== Screenshots ==

1. Feed Automation Dashboard with real-time KPI metrics, status badges, and execution statistics.
2. Feed Configuration Screen showing AI rewriter settings, full-text extraction, and filters.
3. FeedPilot Global Settings with Google Gemini & OpenAI API configuration and system diagnostic check.

== Changelog ==

= 2.0.0 =
* Major release under the TA4A brand (https://www.ta4a.net/).
* Added Google Gemini & OpenAI integration for automatic content rewriting.
* Added Smart Full-Text Article Extraction with ad and sidebar removal.
* Added MediaManager with image deduplication and anti-hotlink bypass.
* Added Concurrency Mutex Lock (CronLock) to prevent overlapping cron runs.
* Upgraded HTTP client with SSRF protection, browser mimicry, and 429/403 retry handling.
* Complete dashboard redesign with KPI cards, status badges, and live diagnostics.
* Standardized text domain to `ta4a-feedpilot` with complete bilingual Arabic & English support.
* Full compatibility with PHP 8.2, PHP 8.3, and PHP 8.4.

== Upgrade Notice ==

= 2.0.0 =
Upgrade to TA4A FeedPilot 2.0.0 for AI content rewriting (Gemini & OpenAI), full-text extraction, enhanced media deduplication, and PHP 8.3/8.4 support.
