Description
Krivoshein Autopost for MAX sends a published WordPress post to a chat or channel in the MAX messenger.
One post becomes one MAX message:
- an image, when the post has a featured image and images are enabled
- the text you choose: the content, the excerpt, the title, or a plain announcement
- an inline button, such as Read or Subscribe
This plugin is independent. It is not made by MAX, and it is not an official MAX product. You use your own bot token.
What it does
- More than one chat ID. One post can go to several channels or groups. A failure in one chat does not stop the others.
- A queue on WP-Cron, with a batch size, a pause between sends, retries, and a log.
- HTTP 429 stops the batch and does not use up a retry.
- Send one post now, from the editor or with WP-CLI.
- The bot token can stay in the plugin settings, or in wp-config.php as KRV_MAX_TOKEN. The settings field stores the token in the database. wp-config.php is the safer place.
New posts are queued when they are published. Posts that already existed when you installed the plugin are not sent until you queue them.
Development of this plugin happens in public at https://github.com/A-Krivoshen/max-autopost.
По-русски
Krivoshein Autopost for MAX отправляет опубликованную запись WordPress в чат или канал мессенджера MAX.
Одна запись становится одним сообщением MAX:
- картинка, если у записи есть изображение записи и отправка картинок включена
- текст на выбор: содержимое, отрывок, заголовок или короткое объявление
- кнопка в сообщении, например «Читать» или «Подписаться»
Плагин независимый. Его сделал не MAX, и это не официальный продукт MAX. Используется ваш собственный токен бота.
Что умеет плагин
- Несколько ID чатов. Одна запись может уйти в несколько каналов или групп. Сбой в одном чате не останавливает остальные.
- Очередь на WP-Cron: размер пакета, пауза между отправками, повторы и журнал.
- Ответ HTTP 429 останавливает пакет и не тратит попытку повтора.
- Одну запись можно отправить сразу из редактора или через WP-CLI.
- Токен бота можно хранить в настройках плагина или в wp-config.php как KRV_MAX_TOKEN. Поле в настройках записывает токен в базу. В wp-config.php хранить его надёжнее.
Новые записи ставятся в очередь в момент публикации. Записи, которые уже были на сайте до установки плагина, не отправляются, пока вы сами не поставите их в очередь.
Плагин разрабатывается открыто: https://github.com/A-Krivoshen/max-autopost.
External services
This plugin connects to one external service: the MAX Bot API.
- Service: MAX messenger Bot API
- Host: https://platform-api2.max.ru
- API reference: https://dev.max.ru/docs-api
- Terms of use: https://legal.max.ru/ps
- Developer rules: https://dev.max.ru/docs/legal/rules
The plugin contacts that host only after you save a bot token and a chat ID, and then send a test or let the queue send a post.
Data sent:
- the bot token, in the Authorization header
- the chat ID
- the post title, text, and permalink
- the button label and URL, when a button is enabled
- the featured image, when images are enabled
The image is uploaded to a media host returned by the API. Those hosts are max.ru and the related media hosts oneme.ru, okcdn.ru, mycdn.me, vkuserphoto.ru, and userapi.com.
The token and the chat ID stay on your site. Nothing is sent to the plugin author.
По-русски
Плагин подключается к одному внешнему сервису: MAX Bot API.
- Сервис: Bot API мессенджера MAX
- Хост: https://platform-api2.max.ru
- Описание API: https://dev.max.ru/docs-api
- Условия использования: https://legal.max.ru/ps
- Правила для разработчиков: https://dev.max.ru/docs/legal/rules
Плагин обращается к этому хосту только после того, как вы сохраните токен бота и ID чата, а затем отправите тест или дадите очереди отправить запись.
Какие данные уходят:
- токен бота, в заголовке Authorization
- ID чата
- заголовок записи, текст и постоянная ссылка
- подпись и адрес кнопки, если кнопка включена
- изображение записи, если картинки включены
Картинка загружается на медиахост, который возвращает API. Это max.ru и связанные хосты oneme.ru, okcdn.ru, mycdn.me, vkuserphoto.ru и userapi.com.
Токен и ID чата остаются на вашем сайте. Автору плагина ничего не отправляется.
Installation
- Upload the plugin and activate Krivoshein Autopost for MAX. You can also install it from the Plugins screen once it is in the directory.
- Open Krivoshein Autopost for MAX, then Settings. Save the bot token and the chat ID.
- Send a test message.
- Publish a post, or run the queue from the Queue tab.
If this site already runs the GitHub release (the folder is named max-autopost), deactivate that copy and remove its folder before you activate this one. Do not use Plugins, then Delete, if you want to keep the saved token: Delete runs uninstall and clears the plugin settings. Remove the old folder with FTP or the hosting file manager, then activate this build. The settings remain, because both builds use the same option names.
Do not keep both copies active. They are the same plugin with two different folders.
По-русски
- Загрузите плагин и включите Krivoshein Autopost for MAX. Когда он есть в каталоге, его можно установить на экране «Плагины».
- Откройте Krivoshein Autopost for MAX, затем «Настройки». Сохраните токен бота и ID чата.
- Отправьте тестовое сообщение.
- Опубликуйте запись или запустите очередь на вкладке «Очередь».
Если на сайте уже стоит сборка с GitHub (папка называется max-autopost), отключите её и удалите папку до включения этой копии. Не нажимайте «Плагины», затем «Удалить», если нужно сохранить токен: удаление запускает uninstall и стирает настройки плагина. Уберите старую папку по FTP или через файловый менеджер хостинга, затем включите эту сборку. Настройки останутся: обе сборки используют одни и те же имена опций.
Не держите обе копии включёнными. Это один и тот же плагин в двух разных папках.
FAQ
-
Is this an official MAX plugin? / Это официальный плагин MAX?
-
No. MAX is a separate messenger. This plugin calls the public MAX Bot API with a token you create for your own bot.
Нет. MAX — отдельный мессенджер. Плагин обращается к открытому MAX Bot API с токеном, который вы создаёте для своего бота.
-
Where is the token stored? / Где хранится токен?
-
In your WordPress database (the options table), unless you define KRV_MAX_TOKEN in wp-config.php. The plugin author never receives the token.
В базе WordPress (таблица настроек), если вы не задали KRV_MAX_TOKEN в wp-config.php. Автор плагина токен не получает.
-
What is sent to MAX? / Что отправляется в MAX?
-
Only when you send a test, or when the queue sends a post: the bot token, the chat ID, the title, the text, the link, the button label and URL, and the featured image when images are enabled.
Только когда вы отправляете тест или когда очередь отправляет запись: токен бота, ID чата, заголовок, текст, ссылка, подпись и адрес кнопки, а также изображение записи, если картинки включены.
-
Why is a certificate file included? / Зачем в комплекте файл сертификата?
-
The MAX API certificate is issued by the Russian Trusted CA. Many shared hosts do not trust that CA. The plugin appends this public certificate to the normal trust store, and only for requests to MAX and its media hosts. Other HTTPS requests on the site are unchanged.
Сертификат API MAX выпущен удостоверяющим центром Russian Trusted CA. Многие виртуальные хостинги этому центру не доверяют. Плагин добавляет этот открытый сертификат к обычному хранилищу доверия и только для запросов к MAX и его медиахостам. Остальные HTTPS-запросы сайта не меняются.
-
Why does image upload use cURL? / Почему загрузка картинки идёт через cURL?
-
MAX upload is two steps. The second step is a multipart file upload to a one-time HTTPS address. The WordPress HTTP API does not send that file in the shape the API expects. cURL is limited to HTTPS, and the host must be MAX or a known MAX media host.
Загрузка в MAX идёт в два шага. Второй шаг — отправка файла multipart на одноразовый адрес HTTPS. HTTP API WordPress не передаёт файл в том виде, которого ждёт API. cURL ограничен HTTPS, а хост должен быть MAX или известным медиахостом MAX.
-
Will activation publish my old posts? / Активация опубликует старые записи?
-
No. Existing posts stay where they are until you queue them. Queue actions run in batches.
Нет. Уже существующие записи остаются на месте, пока вы сами не поставите их в очередь. Очередь работает пакетами.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Krivoshein Autopost for MAX” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Krivoshein Autopost for MAX” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.12.0
- An update no longer disables the worker and no longer resets the queue stamp.
- Send a single post by ID from the admin screen or with WP-CLI.
- A run can send a batch, with a pause between posts. HTTP 429 stops the batch.
- Requeue shows a preview and asks for a separate confirmation.
- Обновление больше не отключает воркер и не сбрасывает метку очереди.
- Одну запись можно отправить по ID из админки или через WP-CLI.
- За один запуск уходит пакет записей, между ними есть пауза. HTTP 429 останавливает пакет.
- Повторная постановка в очередь показывает предпросмотр и просит отдельное подтверждение.
1.11.9
- The image payload is the upload token or URL. This avoids HTTP 400 proto.payload.
- Bold titles use the b tag, which MAX accepts.
- В данные картинки уходит токен загрузки или URL. Так не возникает HTTP 400 proto.payload.
- Жирные заголовки используют тег b: его принимает MAX.
1.11.7
- A channel that rejects a silent message is retried once with the default notification.
- Если канал отклоняет тихое сообщение, плагин один раз повторяет отправку с обычным уведомлением.
1.11.0
- The API host is platform-api2.max.ru.
- Хост API: platform-api2.max.ru.
