=== News API Importer ===
Contributors: amar-alamrany
Tags: news, importer, auto-post, api, campaigns
Requires at least: 6.0
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later

Import news articles from an Api News provider into your WordPress website. Create independent campaigns for individual source categories, each with its own schedule, destination category, batch size, and publishing rules.

== Developer and Support ==
Developer: Ammar Al-Omrani
Website: https://misryoum.com/
Developer page: https://www.facebook.com/amar.alamrany
Support email: amar.tohamy20@gmail.com
Phone: 00201147925730
Additional phone: 00201019742170

== Features ==
* Entire plugin interface and settings page are in English.
* Connect to the clean API URL without /wp-json.
* Automatically fetch provider-enabled source categories after the API URL and key are saved.
* Create multiple independent category campaigns.
* Create a general-feed campaign for the latest 20 articles.
* Configure a separate schedule for each campaign: 15 minutes, 30 minutes, hourly, 3 hours, 6 hours, 12 hours, or daily.
* Configure the maximum new articles per run (up to 8 per category campaign or 20 for the general feed).
* Save imported posts as drafts or publish automatically.
* Download featured images to the local Media Library.
* Match source categories automatically or select a local destination category.
* Append the original source credit below imported content.
* Prevent duplicate imports using the original article URL.
* Run, pause, resume, or delete each campaign independently.
* View overall import statistics and per-campaign run details.
* Supports WordPress Cron and external Cron triggering.

== Installation and Setup ==
1. In WordPress, open Plugins > Add New > Upload Plugin.
2. Upload api-news-client.zip and activate it.
3. Open the News API Importer menu.
4. Enter the clean API Base URL, for example https://example.com/api-news/v1.
5. Enter the API key generated on the provider website.
6. Click Save Connection & Fetch Categories. The category list is retrieved from the provider and contains only categories enabled by its administrator.
7. Create a campaign for each category you want to import. Choose its schedule, destination category, batch size, publication status, image handling, and source-credit option.
8. Use Run This Campaign Now to test the connection. Start with Save as Draft until you have reviewed the imported content.

== Campaigns ==
Each campaign has its own source category, schedule, batch size, local category mapping, post status, featured image setting, and source attribution setting. Campaigns can be paused, resumed, run manually, or deleted without removing previously imported posts.

== Cron ==
The plugin uses WordPress Cron. On low-traffic websites, scheduled tasks may run late. For more reliable scheduling, create an external hosting Cron Job that requests:
https://YOUR-CLIENT-SITE.com/wp-cron.php?doing_wp_cron

Run the Cron Job every five minutes. It triggers all due WordPress campaign events. Do not add the API key to the Cron URL.

== Copyright and Attribution ==
Importing an article or image does not automatically grant redistribution rights. Obtain permission when required and keep the original source attribution.
