=== Fetchub === Contributors: unioney Author link: https://unioney.com Plugin's link: https://fetchub.com Tags: AI, RSS, feed, aggregator, translator Requires at least: 6.0 Tested up to: 6.8 Stable tag: 1.0 Requires PHP: 7.4 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Fetch, translate, and publish RSS feeds automatically using AI-powered processing with a robust per-feed cron scheduling system. == Description == Fetchub is an advanced WordPress plugin that automates the aggregation, translation, and publication of RSS feeds. It fetches feed items, detects their language, and translates them into a target language using AI providers such as OpenAI, Gemini, Claude, and Grok. With features like AI-driven content ranking, customizable cron intervals per feed, and an intuitive admin interface, Fetchub streamlines content management. The plugin requires a valid license for full functionality, offering new users a 3-day trial to explore its capabilities. ### Key Features - **AI-Powered Translation:** Translate feed content using OpenAI, Gemini, Claude, or Grok with support for over 90 languages. - **Content Ranking:** AI evaluates and ranks feed items by importance using the `ai_rank_importance` function. - **Custom Cron Scheduling:** Set unique fetching intervals per feed (e.g., every X minutes) via WP-Cron. - **Manual Fetching:** Trigger instant feed updates via AJAX with buttons for individual or all feeds. - **Feed Configuration:** Define intervals, categories, maximum posts, AI models, temperature, custom prompts, target languages, and block words per feed. - **License System:** Requires activation with a valid license; includes a 3-day trial for new users. - **Export/Import Settings:** Backup and restore settings as JSON files for easy migration. - **Revoke License:** Deactivate the license for use on another site. - **Stop All Feeds:** Halt all active feed requests to manage server resources. - **Smart Logic:** Enable AI-driven ranking to prioritize high-value content. - **Block Words:** Filter out unwanted content by specifying keywords. - **Semantic Duplicate Detection:** Avoid republishing similar content using AI analysis. - **Featured Image Support:** Automatically fetches and sets featured images from feeds or linked pages. - **Secure Design:** Uses nonces for AJAX requests and adheres to WordPress coding standards. - **Post Status Options:** Publish posts as "publish" or "draft" by default. - **Feed URL Column:** Displays the source feed URL in the WordPress posts list. ### Supported AI Models - **OpenAI:** GPT-4.1 nano, GPT-4.1 mini, GPT-4o mini, GPT-4o, GPT-4.1, o1 mini, o3 mini, o1, GPT-3.5 turbo - **Gemini:** Gemini 1.5 Flash-8B, Gemini 2.0 Flash Lite, Gemini 1.5 Flash, Gemini 1.5 Pro, Gemini 2.0 Flash - **Claude:** Claude 3.5 Haiku, Claude 3.5 Sonnet, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku - **Grok:** Grok 3 mini Beta, Grok 3 mini Fast Beta, Grok 3 Beta == Requirements == * WordPress 5.9 or higher – guarantees core polyfills such as `str_starts_with()` that Fetchub relies on. * PHP 7.4 or higher – required for arrow functions (`fn()`) and modern language features. – fully tested on PHP 8.0, 8.1, 8.2, 8.3 and 8.4. * Standard PHP extensions: **cURL**, **OpenSSL**, and **DOM/XML** (all enabled by default on mainstream hosts). * WP-Cron active (or a real system cron) so per-feed schedules can run. * 512 MB `memory_limit` or greater recommended when using multiple AI models. **Best practice for performance** For the smoothest AI processing and zero-maintenance cron execution, we recommend hosting your WordPress site on [ihost](https://ihost.eco) WordPress Cloud Hosting. See **FAQ 12** for an ihost-optimised `php.ini` template you can copy-and-paste. == Installation == 1. Upload the `fetchub` folder to the `/wp-content/plugins/` directory. 2. Activate the plugin through the **Plugins** menu in WordPress. 3. Navigate to **Fetchub** in your WordPress dashboard. 4. Activate the plugin with a valid token. New users can sign up for a 3-day trial at and enter their trial email and token. 5. Enter the API key(s) for your chosen AI provider(s) and configure feed settings (URLs, intervals, categories, etc.). 6. **Save settings once** to schedule the per-feed cron events for automatic fetching. == External services == This plugin contacts five external APIs. For legal clarity users are told what is sent, why, and where: * **OpenAI Chat Completions API** – Generates titles, summaries and translations. – Sends: prompt text and numeric parameters whenever a post is translated or summarised. – Endpoint https://api.openai.com/v1/chat/completions – Terms https://openai.com/policies/terms-of-use – Privacy https://openai.com/policies/privacy-policy * **Google Gemini Generative Language API** – Same purpose for Gemini models. – Sends: prompt text and numeric parameters. – Endpoint (base): https://generativelanguage.googleapis.com/v1beta/models/{model}:generateContent – Terms https://policies.google.com/terms – Privacy https://policies.google.com/privacy * **Anthropic Claude API** – Same purpose for Claude models. – Sends: prompt text and numeric parameters. – Endpoint https://api.anthropic.com/v1/messages – Terms https://www.anthropic.com/terms – Privacy https://www.anthropic.com/privacy * **xAI Grok API** – Same purpose for Grok models. – Sends: prompt text and numeric parameters. – Endpoint https://api.x.ai/v1/chat/completions – Terms https://x.ai/terms – Privacy https://x.ai/privacy * **Fetchub Licence Server** – Validates your e-mail/token and handles revocation. – Sends: e-mail address, licence token and site URL at activation or once every six hours. – Endpoint (base): https://fetchub.com/wp-json/fetchub/v1/verify (and /revoke) – Terms https://fetchub.com/terms – Privacy https://fetchub.com/privacy-policy/ == Frequently Asked Questions == ### 1. How does the custom cron scheduling work? Each feed can have a unique interval (in minutes) set in the admin interface. Upon saving, Fetchub schedules WP-Cron events (e.g., `fetchub_feed_cron`) to fetch feeds at these intervals, ensuring timely updates. ### 2. Which AI providers are supported? Fetchub integrates with OpenAI, Gemini, Claude, and Grok. Enable your preferred provider(s) and input API keys in the settings. ### 3. How does content ranking work? The `ai_rank_importance` function uses AI to score feed items from 0 to 10 based on interest and importance, allowing prioritization of high-value content when "Smart Logic" is enabled. ### 4. What happens if I don’t have an AI provider API key? You can still fetch and publish feeds without AI features (translation, ranking), though full functionality requires at least one active provider. ### 5. What is the best practice using with AI models or how much they cost? While using we were experienced with Gemini Flash 2.0 Lite monthly approx. $20 based on the used 49 feed rows. ### 6. How do I activate the 3-day trial? Visit [https://fetchub.com](https://fetchub.com) to sign up. You’ll receive an email and token; enter these in the Fetchub settings page to activate your trial. ### 7. How much cost this plugin monthly? We are the team which is making this plugin to have reach all people and the people who are journalists, editors, freelancers and who are starters. That is why we only ask $1 from all in month. Yes, correct: $1/month. We think that this is very symbolic and can be helpful to all. If you will use it as we mentioned above at 5., approx. $11/month. ### 8. What if a feed fetch fails? Check your feed URLs and server resources. Enable `WP_DEBUG` in `wp-config.php` to log errors for troubleshooting. ### 9. How do I migrate settings to another site? Use the "Export Settings" button to download a JSON file, then upload it via "Import Settings" on the new site to merge configurations. ### 10. What were the Title and Content instructions when we tested Fetchub? We used it to translate into the X language and fetch news. For the Title we added: - Analyze the provided news content (in any language). Quickly understand the core subject and key findings. Then, generate a concise (under 10 words) and highly engaging news title in fluent, natural YOUR_LOCAL_LANGUAGE that would attract a wide readership. The title must use proper YOUR_LOCAL_LANGUAGE terminology and sound like a headline written by a professional YOUR_LOCAL_LANGUAGE news editor. Avoid direct, word-for-word translations that result in unnatural or incomprehensible phrasing. The title should reflect a substantive news story, not a brief announcement, and must not contain any British, English, or other foreign language words. Only the first word of the title and proper names must be capitalized; do not capitalize other words unnecessarily. Provide correct brand names, for example: iPhone, not IPhone, xAI, not Xai, iOS, not IOS, etc. Don't repeat titles or text that's already been used before; skip that and go for a new post. Do not use any formatted text in the title (such as bold, italic, or underline). For the Content we added: - Please generate a comprehensive news article directly in fluent and natural professional YOUR_LOCAL_LANGUAGE language, ensuring it is NOT based on bulletin news or short announcements. The article should be written in a professional journalistic style suitable for a reputable YOUR_LOCAL_LANGUAGE news website, using terminology and phrasing that a native YOUR_LOCAL_LANGUAGE speaker would expect from professional news reporting. Adhere strictly to the following guidelines: * Unique Introduction: The article content MUST BEGIN with clear, unique introductory sentences that are ENTIRELY DIFFERENT from any given title or excerpt. DO NOT repeat, closely rewrite, or slightly modify the title or excerpt in the first paragraph or anywhere else in the article. Start with ORIGINAL and UNIQUE sentences in *fluent and natural professional YOUR_LOCAL_LANGUAGE*, maintaining a professional journalistic tone that sounds authentic to a native speaker. * Second Paragraph Commencement: The second paragraph MUST START *exactly* with ONE of the following phrases (choose correctly by context): * "[NAME_OF_YOUR_MEDIA|https://name_of_your_media.com] informing that," These phrases MUST appear PRECISELY as written, without ANY modifications. * Total Length Constraint: The total length of the generated article MUST NEVER exceed a maximum of 390 words. **EVEN IF THE SOURCE TEXT IS LONGER, condense the information to fit within this limit while retaining key details and context. DO NOT CUT OFF THE ARTICLE ABRUPTLY.** * Complete Conclusion: NEVER cut off the text abruptly. ALWAYS finish the article with a clear and concise conclusion paragraph IN *fluent and natural professional YOUR_LOCAL_LANGUAGE*, consistent with journalistic standards and sounding authentic to a native speaker. **Ensure that even if the source material is extensive, the generated article has a proper concluding statement that summarizes or provides a final thought.** * Editor Attribution: ALWAYS include exactly ONE editor's name BELOW the conclusion paragraph based on the news category: * If the news belongs to the **Politics, World, or any other category not explicitly listed below**, use: Asad Freeman * If the news belongs to the **Technology**, **Sports**, **Finance**, **Economics**, **Business** category, use: Fred Alison * If the news belongs to the **Health** category, use: Sunny Springfield * If the news belongs to the **Science**, **Vehicles** category, use: Aileen August **THIS MUST ALWAYS BE PRESENT AFTER THE CONCLUSION.** * Metadata Exclusion: DO NOT include ANY unrelated metadata, dates, excerpts, headings, markdown formatting, or social media texts. ENSURE the generated content is a FULL NEWS ARTICLE in *fluent and natural professional YOUR_LOCAL_LANGUAGE*, written in a professional journalistic style that a native speaker would recognize as such, not a brief bulletin or announcement resulting from direct translation. * Language and Style: Use *fluent and natural PROFESSIONAL YOUR_LOCAL_LANGUAGE* language ONLY, with CORRECT grammar and spelling THROUGHOUT the ENTIRE article. Maintain a formal and objective journalistic style that reflects authentic YOUR_LOCAL_LANGUAGE news writing. * Uniqueness: The final article MUST ALWAYS BE UNIQUE, CLEARLY DIFFERENT from any provided title or excerpt, clean, complete, and ready for publication ON A NEWS WEBSITE IN *fluent and natural PROFESSIONAL YOUR_LOCAL_LANGUAGE*. The content should reflect a developed news story with professional journalistic quality, written in a way that sounds natural and authoritative to a native YOUR_LOCAL_LANGUAGE reader, not a direct or awkward translation. * Provide correct brand names, for example: iPhone, not IPhone, xAI, not Xai, iOS, not IOS, etc. * Provided names must be correctly used in YOUR_LOCAL_LANGUAGE. For example: Elon Musk is Ilon Mesk, Donald Trump is Donald Tremp in YOUR_LOCAL_LANGUAGE. If you want to add a suffix like -ın or -ın, simply attach it directly (e.g., Trempic, Mesken). However, untranslated company names still use the suffixes -ın, -dan as usual. * Do not add comments, markup, or extra characters. * Preserve meaning and clarity. * Output plain text only. Please do not forget to replace with YOUR_LOCAL_LANGUAGE your correct country's name. Please do not forget to replace with NAME_OF_YOUR_MEDIA|https://name_of_your_media.com your correct website name and domain. Please note that [NAME_OF_YOUR_MEDIA|https://name_of_your_media.com] will be added as a link on your frontend page like this: [https://name_of_your_media.com](NAME_OF_YOUR_MEDIA). ### 11. If I have an issue with this plugin, how do I contact you? You can easily contact us by visiting [https://fetchub.com/contact](https://fetchub.com/contact) and sending us all the details, screenshots, or videos you have on hand so we can try to fix any issue. ### 12. What PHP settings are recommended for best performance on ihost? We run happily on any modern host, but if you want “zero-tuning” speed and reliability we recommend [ihost WordPress Cloud Hosting](https://ihost.eco/wordpress-cloud). **Why ihost works so well with Fetchub** * **Web Optimisation:** One-click optimisation suite that minifies HTML, CSS, JS and compresses images automatically. * **Free and unlimited ihostCDN:** A fully featured global CDN (not a slimmed-down plan) for faster delivery everywhere. * **Website Acceleration Suite:** Server-side image resizing, compression, lazy loading, and code minification without extra plugins. * **Edge caching:** Static assets (images, JS, CSS) are cached at ihost’s edge locations worldwide for ultra-low latency. * **Optimised PHP:** Customised PHP-FPM and OPcache; multiple PHP versions (5.6 → 8.4) available for safe upgrade testing. * **Unlimited hosting:** No artificial limits on the number of WordPress sites—scale up as your server resources allow. #### ihost PHP directives (copy into “PHP Options → Additional directives”) ```ini asp_tags = 0 auto_append_file = auto_prepend_file = display_errors = 0 error_reporting = 22527 file_uploads = 1 max_execution_time = 300 max_file_uploads = 50 max_input_time = 300 max_input_vars = 10000 memory_limit = 1024M output_buffering = 0 post_max_size = 256M short_open_tag = 1 upload_max_filesize = 256M zlib.output_compression = 0 ``` == Screenshots == 1. **Admin Settings Page** – Configure AI providers, API keys, and general settings. 2. **Feed Configuration Table** – Manage feeds with options for intervals, AI models, and advanced settings. 3. **Export / Import & Revoke Token Panel** – Backup settings, import JSON, or revoke your token in one place. == Functions == – Singleton instance of the main plugin class. – AJAX handler for manual feed fetching. – Updates AI model options via AJAX. – WP-Cron hook for per-feed processing. – Ranks feed items using AI. – Identifies content language for translation. – Translates text using the selected AI provider. – Checks token validity. – Verifies token with the Fetchub server. – Revokes the token remotely. == Upgrade Notice == = 1.1 = Database-cleanup and duplicate-guard options were added. After upgrading, visit *Fetchub → Settings* to review the new “Duplicate guard” and “Cleanup” features. == Changelog == = 1.1 = * **New:** Weekly cron task (`fetchub_cleanup_cron`) that trims `_fetchub_summary` post-meta to the 500 most-recent rows, preventing long-term table growth. * **New:** Duplicate-guard settings — threshold, look-back depth and a fast slug-overlap check before the LLM call. * **Dev:** All summary-cleanup SQL now uses `prepare()` and inline PHPCS whitelisting; PHPCS reports come back clean. * **UI:** Added tooltips and inline help for duplicate guard and cleanup options. * **Fix:** AI-model dropdown instantly refreshes when providers are toggled. * **Fix:** Minor UI/UX tweaks and translation string improvements. * **Perf:** Leaner database queries and transient handling across the board. == Changelog == = 1.0 = - Initial release with full AI integration, cron scheduling, and token system. == Upgrade Notice == Version 1.0 is the initial release. Install this version for new setups. Future updates will enhance features based on user feedback. == License == This plugin is released under the GNU General Public License v2 or later. See LICENSE.txt for full details.