=== PublicaCubo ===
Contributors: hostalcubo
Donate link: https://paypal.me/hostingalcubo
Tags: telegram, csv, auto post, import
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.7.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create WordPress posts automatically from Telegram (photo + text) and CSV, configured per site, with no third-party automation platforms.

== Description ==

PublicaCubo turns Telegram messages (photo + text) and CSV rows into WordPress posts, with all the configuration inside each site's admin panel. It does not rely on Zapier or Make: the plugin talks directly to the Telegram API.

Send a message with a photo and text to your Telegram bot and the post appears, with the photo as the featured image. You can also bulk-import posts from a CSV file.

= Features (free) =

* **Telegram:** send a photo with text to your bot and a post is created, with the photo as the featured image.
* **Secure webhook** with a secret token and an allowlist of authorized chats.
* **Deduplication:** it never publishes the same message twice.
* **CSV import** from the admin panel (columns: title, content, category, image, status).
* **Category, author and status** (draft or publish) are configurable, with an independent status per source.
* **Email notifications** when a post is created or when an error happens.
* **Event and error log.**

= Pro version (separate) =

A separate Pro version adds: multi-image galleries (Telegram albums and several image columns), automatic import from a Google Sheet published as CSV via WP-Cron, and a dynamic category by hashtag. The free version works fully on its own. More info: https://hostalcubo.com.ar/publicacubo

== External services ==

This plugin connects to third-party services to work. Below is what services it uses, when, and what data is sent.

**Telegram API (api.telegram.org) — required for the Telegram feature**
To receive your bot's messages and create the posts, the plugin communicates with the Telegram API using the bot token you configure.

* Data sent: your bot token, your site's webhook URL and a secret token (when registering the webhook); and a request to download the image of each message (with the token in the URL).
* Data received: the messages your bot receives (text and photos) and the download path of the images.
* When it happens: when you register or delete the webhook from the panel, and every time a message reaches your bot.
* Provider: Telegram FZ-LLC. Terms: https://telegram.org/tos — Privacy: https://telegram.org/privacy

== Installation ==

1. Upload the `publicacubo` folder to `/wp-content/plugins/`, or install the .zip from Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. Go to Settings → PublicaCubo.
4. Create a bot with @BotFather on Telegram and paste the token.
5. Save the changes and click "Register webhook" (your site must be reachable over HTTPS).
6. Send your bot a message with a photo and text: the post will appear.

For bulk import, use the "Import CSV" tab.

== Frequently Asked Questions ==

= Do I need a Telegram account? =
Yes. You create a free bot with @BotFather and paste its token in the settings. The plugin uses your own bot.

= Where does my data go? =
The plugin communicates with the Telegram API. See the "External services" section above. No data is sent to any other server.

= Is the webhook secure? =
Yes. The endpoint validates a secret token known only to your site and Telegram, and you can limit the authorized chats by ID.

= Does it publish directly or as a draft? =
You choose, and you can set a different status for Telegram and for CSV.

= What does the Pro version add? =
Multi-image galleries, automatic import from Google Sheets via WP-Cron, and a dynamic category by hashtag. The free version is fully functional on its own.

== Screenshots ==

1. PublicaCubo settings: Telegram bot, category, author and status.
2. Event log.
3. Importing posts from CSV.

== Changelog ==

= 0.7.1 =
* Each source now handles a single featured image end to end: the CSV importer maps one image column (imagen/image/foto/url) and the free plugin no longer collects multiple image URLs. Clarified the Pro notice in the admin (the Pro version is a separate plugin that adds features; nothing is locked in the free plugin).

= 0.7.0 =
* WordPress.org compliance: removed all Pro-only code from the free plugin (multi-image galleries, automatic Google Sheets import, and Telegram hashtag dynamic category). These features are now exclusively part of the separate Pro version hosted on our website. No license checks or locked features remain. The free plugin is fully functional on its own.

= 0.6.1 =
* Code quality pass for the WordPress.org review: replaced direct file operations with in-memory CSV parsing and `wp_delete_file()`, added a translators comment, reordered input unslashing, and removed `load_plugin_textdomain()` (WordPress.org loads translations automatically).
* readme and plugin header rewritten in English.

= 0.5.0 =
* First public version for the WordPress.org directory.
* Documented external services (Telegram and Google Sheets) in the readme.

= 0.1.0 =
* Initial version: Telegram with featured image, CSV import, secure webhook with secret token, deduplication and event log.

== Upgrade Notice ==

= 0.7.1 =
The free plugin handles a single featured image per post. Your settings are preserved.

= 0.7.0 =
Pro-only features moved out of the free plugin for WordPress.org compliance. Telegram (text + photo), CSV import and notifications keep working. Your settings are preserved.

= 0.6.1 =
Code quality improvements for the WordPress.org review. Your settings are preserved.
