=== Milyutin Code Article Reposter for VK ===
Contributors: milyutinkv
Tags: vkontakte, auto-poster, ai, yandex-gpt, social-media
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically repost your WordPress articles to VKontakte with a short summary generated by Yandex GPT or using the first paragraph.

== Description ==

**Milyutin Code Article Reposter for VK** is a WordPress plugin that automatically publishes your articles to a VKontakte group.

*   **Automatic publishing** – triggers when you publish a post.
*   **Two sources for the short summary:**
    *   **Yandex GPT** – generates a concise preview using a neural network (requires API key and Folder ID).
    *   **First paragraph (excerpt)** – uses the first paragraph of the article. Free and simple.
*   **Manual publishing** – each post editor has a "Publish now" button for manual sending. If the post is already published, you can re-publish it.
*   **Auto‑update on post changes** – when you update an existing published post, the plugin automatically updates the text in VK.
*   **Smart logging** – all actions are logged to a separate log file, viewable in the admin area.
*   **Fully translatable** – all strings are ready for translation.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via "Add New" in the WordPress admin.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to **"Milyutin Code Article Reposter for VK"** in the left admin menu.
4. Fill in the fields:
    *   **Group ID:** numeric ID of your VK group (e.g., `123456789`).
    *   **Community Access Key:** get the key in your VK community settings under "Management" → "Working with API" → "Create key". Select permissions: "Community management", "Photos", "Files", "Stories", "Wall".
5. Choose the summary source (Yandex GPT or first paragraph).
6. Click **"Save Settings"**.

== Frequently Asked Questions ==

= Do I have to pay for Yandex GPT? =

Yes, Yandex GPT is a paid service, but they offer a free trial grant. If you prefer not to pay, select the "First paragraph" mode.

= Can I publish to multiple groups? =

Not yet, but we plan to add this feature in the future.

= Why are images no longer attached to posts? =

Starting September 7, 2026, VKontakte changed the API rules for community access keys. Community keys cannot use the photo upload method. The plugin now publishes text posts with a link. We are working on an alternative solution.

= Where can I see the plugin logs? =

There is a "Logs" submenu under the plugin menu, where all events are displayed.

== Screenshots ==

1. Plugin settings page.
2. "Publish to VK" meta box in the post editor.
3. Example of a published post in VKontakte.

== Changelog ==

= 1.0.2 =
* Removed image upload functionality due to new VK API restrictions (community access keys cannot upload photos).
* Updated token instructions: now uses community access key from VK community settings.
* Updated user-facing strings and translations.

= 1.0.1 =
* Added auto-update of VK posts when the WordPress post is updated.
* Improved image upload reliability with hybrid approach (deprecated in 1.0.2).
* Fixed internationalization issues.
* Replaced inline scripts/styles with proper enqueuing.
* Added "Publish again" button in the meta box for already published posts.

= 1.0.0 =
* Initial stable release.

== Upgrade Notice ==

= 1.0.2 =
* Important update: adapted to new VK API restrictions. Image upload temporarily removed. Now uses community access key.

== External services ==

This plugin uses the following external services:

1. **VKontakte API** – used for publishing posts and retrieving group information.
   - Data sent: post title, content, excerpt, access token.
   - When: during automatic or manual post publication, and during post updates.
   - Terms of Service: https://vk.com/terms
   - Privacy Policy: https://vk.com/privacy

2. **Yandex GPT API** – used for generating article summaries (optional, only when enabled in settings).
   - Data sent: article content (first 3000 characters), API key, Folder ID.
   - When: during publication if Yandex GPT is selected as the summary source.
   - Terms of Service: https://yandex.ru/legal/cloud_termsofuse
   - Privacy Policy: https://yandex.ru/legal/confidential