=== Tumpu Articles ===
Contributors: lukmankhim
Donate link: https://tumpupress.com
Tags: automation, content, rest-api, seo, custom-post-type
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.6.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Receive articles from automation tools through a REST API, or generate them with your chosen AI provider, then publish to an editable archive.

== Description ==

Tumpu Articles connects automation workflows to WordPress. It works in two ways
that can be used together.

**1. Receive from outside**

Automation tools such as Node-RED, n8n, or Make send articles through a REST API
using bearer token authentication. This suits setups where the writing process
already runs elsewhere.

**2. Generate on its own**

Choose an AI provider, enter your API key, then set a schedule. The plugin calls
the service and saves the result, with no extra server required.

Supported providers: DeepSeek, OpenAI, Google Gemini, Anthropic Claude, and any
service that uses an OpenAI-compatible request format through the custom endpoint
option.

**Main features**

* Article archive with its own permalink
* Every article stays a normal editable entry, usable with the block editor or a page builder
* A shortcode to place an article list on any page
* HTML sanitizer that removes scripts, inline styles, event attributes, and duplicate top-level headings
* Duplicate-topic prevention based on titles already published
* A log of the last fifty activities
* New articles are saved as drafts by default

**Shortcode**

`[tumpu_articles jumlah="6" kolom="3" excerpt="ya" gambar="ya"]`

== External services ==

This plugin can contact a third-party service, but only after the administrator
selects a provider, enters an API key, and then presses the generate button or
enables the scheduled task. If the API key field is left empty, no data is sent
anywhere. Only the provider you select is contacted.

**Data sent to any provider**

The prompt text you write on the settings page, the selected model name, a token
limit, and the titles of articles already published on the site. The titles are
sent so the model does not repeat the same topics. No visitor data is sent.

**When it is sent**

Only when the generate button is pressed, when the connection test is run, or
when the scheduled task runs.

**DeepSeek**
Endpoint: https://api.deepseek.com
Terms: https://platform.deepseek.com/downloads/DeepSeek%20Terms%20of%20Use.html
Privacy: https://cdn.deepseek.com/policies/en-US/deepseek-privacy-policy.html

**OpenAI**
Endpoint: https://api.openai.com
Terms: https://openai.com/policies/terms-of-use
Privacy: https://openai.com/policies/privacy-policy

**Google Gemini**
Endpoint: https://generativelanguage.googleapis.com
Terms: https://ai.google.dev/gemini-api/terms
Privacy: https://policies.google.com/privacy

**Anthropic Claude**
Endpoint: https://api.anthropic.com
Terms: https://www.anthropic.com/legal/consumer-terms
Privacy: https://www.anthropic.com/legal/privacy

**Custom endpoint**
When the custom endpoint option is chosen, the destination is entirely defined by
the user. Review that service's terms and privacy policy before using it.

== Installation ==

1. Upload the `tumpu-articles` folder to `/wp-content/plugins/`, or install it from the Plugins menu.
2. Activate the plugin through the Plugins menu.
3. Open Articles then Settings.
4. Copy the endpoint URL and token to use an external automation tool, or enter an API key to let the plugin generate articles on its own.

== Frequently Asked Questions ==

= Which AI providers are supported? =

DeepSeek, OpenAI, Google Gemini, and Anthropic Claude are available as direct
options. Other services that use an OpenAI-compatible request format can be used
through the custom endpoint option.

= Do I have to use an AI service? =

No. If the API key field is left empty, the plugin only works as a receiver
through the REST API and does not contact any external service.

= How do I send an article from an automation tool? =

Send a POST request to `/wp-json/tumpu/v1/article` with the header
`Authorization: Bearer TOKEN` and a JSON body containing the `judul` and `konten`
fields. The `status` and `excerpt` fields are optional.

= Where are articles shown? =

In the `/article` archive. An article list can also be placed on any page using
the `[tumpu_articles]` shortcode.

= Can the articles be edited? =

Yes. Each article appears under the Articles menu and can be edited like a normal
entry.

= Why are articles saved as drafts? =

As a safeguard so the output can be reviewed first. The default status can be
changed on the settings page.

= Is my data removed when the plugin is deleted? =

Settings, the activity log, and the title list are removed. Articles that have
already been created are deliberately kept so your content stays safe.

== Screenshots ==

1. The settings page with connection, API key, prompt, and schedule.
2. The article list in the admin area with a source column.
3. The article archive as seen by visitors.

== Credits ==

Developed by Lukman (https://lukmankhim.com) for TumpuPress
(https://tumpupress.com), a studio serving the digital needs of the interior,
architecture, and premium material industry in Indonesia.

== Changelog ==

= 1.6.1 =
* Moved the settings-page script into a properly enqueued file instead of inline output.
* Updated the plugin header URI.

= 1.6.0 =
* Added a choice to store articles as a separate article type or as standard posts, so content stays visible even if the plugin is removed.
* Added one-click bulk conversion between the two storage types. Converting standard posts back only affects posts created by this plugin, leaving the site's own posts untouched.

= 1.5.0 =
* Added a built-in grid layout for the article archive, so an existing archive URL already linked in a site menu looks clean without depending on the theme. Can be turned off.

= 1.4.0 =
* Added a welcome and setup screen shown once after activation, guiding the blog page, author, and content source choices.

= 1.3.0 =
* Added a one-click Blog page that lists articles in a grid, created automatically on activation so nothing shows up empty.
* The shortcode gains a sumber attribute to list plugin articles, standard posts, or both.

= 1.2.0 =
* The archive slug is now configurable, so each site can match its own structure (for example blog or artikel). Permalinks refresh automatically on save.
* Added a global default author for articles created through automation or AI.

= 1.1.0 =
* Added an optional developer credit line that can be shown below the article list, off by default.
* AI provider is now selectable: DeepSeek, OpenAI, Google Gemini, Anthropic Claude, and a custom endpoint.
* The model field offers provider-specific suggestions and remains free to type.
* Existing settings are migrated automatically on update.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.2.0 =
Adds a configurable archive slug and a default author option.

= 1.1.0 =
Adds AI provider selection. Existing settings are migrated automatically.

= 1.0.0 =
First release.
