=== ASB Connect for LINE ===
Contributors: asobit
Tags: line, notification, messaging api, broadcast, automation
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.16.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically sends the post title, a short excerpt and the link to your LINE Official Account when a post is published.

== Description ==

ASB Connect for LINE links WordPress to the LINE Messaging API. When a standard post is published, it broadcasts the post's title, a short excerpt and its link to the friends of your LINE Official Account.

= Features =

* Automatic notification when a standard post is published, including scheduled posts and posts published through the REST API
* A predictable message: the post title, an excerpt of up to 100 characters, then the link
* A "Send a message to LINE" box on every post, in the Block Editor and the Classic Editor, with a site-wide default for new posts
* A test message to your own LINE account
* Send history with the result of every notification, and an optional diagnostic log
* Password-protected posts are announced with their title and link only

= Pro edition =

A separately sold Pro plugin adds a message layout of your own, featured images, pages and custom post types, a category and tag filter, automatic retry with an error email, history search and CSV export, and LINE Login with member management and targeted messages. Nothing in this plugin is switched off or waiting for it.

== Installation ==

1. Install and activate the plugin.
2. Open **ASB Connect** in the WordPress administration menu.
3. Paste a long-lived Channel Access Token from the LINE Developers Console and save.
4. Send a test message to your own LINE user ID.
5. Publish a post with **Send a message to LINE** ticked.

== Frequently Asked Questions ==

= Where do I get a Channel Access Token? =

Create a LINE Official Account and a Messaging API channel in the LINE Developers Console, then issue a long-lived Channel Access Token from the Messaging API tab. The settings screen has a step-by-step guide.

= What does a notification look like? =

Three lines: the post title, an excerpt of up to 100 characters, and the link to the post. The excerpt is the one written for the post, or else the start of its text. A post with no text is sent with its title and link.

= Which posts are sent? =

Standard WordPress posts, when they are published, including scheduled posts. Each post has a **Send a message to LINE** box; the default for new posts is set on the Message Settings tab. A post is announced once. If it is unpublished and published again, it is announced again.

= Does it work with the Block Editor? =

Yes. The plugin supports both the Block Editor and the Classic Editor.

= What data does the plugin store? =

Its settings, including the Channel Access Token, in the WordPress options table, and the send result of each post as post meta. It does not collect any data about your visitors or your LINE friends. Deleting the plugin removes all of it.

== External services ==

The plugin connects to third-party services only after the corresponding feature is configured and used.

= LINE Messaging API =

The plugin uses the LINE Messaging API to deliver notifications. When a post is published with "Send a message to LINE" ticked, it sends the message text (the post title, a short excerpt and the post URL) to LINE together with the Channel Access Token you saved, and LINE broadcasts it to the friends of your LINE Official Account. When you press "Send Test Message", it sends a short test text to the LINE user ID you typed. Nothing is sent before a Channel Access Token has been saved.

Service endpoint: https://api.line.me/
Terms: https://terms2.line.me/LINE_Developers_Agreement
Privacy policy: https://www.lycorp.co.jp/en/company/privacypolicy/

= Trademarks =

LINE is a trademark of LY Corporation. This plugin is an independent product of Asobit LLC and is not affiliated with, endorsed, or sponsored by LY Corporation.

== Screenshots ==

1. Basic Settings: the Channel Access Token, a test message and the diagnostic log.
2. The "Send a message to LINE" box in the Block Editor, with the result of the last send.
3. Send history with the result of every notification.
4. Message Settings: the notification format and the default for new posts.

== Changelog ==

= 2.16.1 =
* Fixed: post titles arrived in LINE with HTML character references, for example `Q&#038;A` instead of `Q&A`, or `&#8217;` in place of an apostrophe.
* Fixed: a post copied with a duplicator plugin from one that had already been sent was never sent, and showed the original's result. The send state now belongs to the post it was written for.
* Posts brought in by an importer (WordPress Importer, WP-CLI) are no longer announced one by one.
* A send that LINE had accepted, but whose answer never reached the site, is no longer delivered a second time: every attempt for a post carries the same request key, and LINE drops the repeat.
* Sites published as static files: only the posts that went live in that build are sent; the others keep waiting for their own build. If ASB Site Link is switched off while posts are waiting, they keep waiting and the send history says why.
* The notice about a failed send is shown only to users who can manage the plugin.
* The diagnostic log file gets a random name of its own.

= 2.16.0 =
* Renamed from ASB LINE Notification to ASB Connect for LINE. The menu entry is now "ASB Connect".

= 2.15.1 =
* Fixed: a notification could be lost without a trace when its scheduled WP-Cron event disappeared before it ran. A scheduled send now shows as "Waiting to send" in the send history and on the post, and one whose event has gone is scheduled again (looked for on admin screens and on WP-Cron runs; after five attempts the history says so instead).
* In the block editor, "Send a message to LINE" now travels with the publish itself, so a post copied from one that was not sent is scheduled by the publish like any other post, and clearing the box just before publishing can no longer let the earlier setting go out.
* A send that runs and finds nothing to send (the post was unpublished, or the box was cleared) says so in the send history, and a missing channel access token is shown there as a failure.

= 2.15.0 =
* The settings screens show only what this plugin does: the Message Settings tab describes the notification as text, and the send history pages through every entry.
* A "Pro version" tab describes the separately sold Pro plugin.
* The "View on WordPress.org" link appears once the plugin is listed there.
* The LINE terms link in this readme points at the current LINE Developers Agreement.

= 2.14.0 =
* A site whose public pages are static files built from a private WordPress no longer announces a post before it is online. While ASB Static Publisher says to wait, the broadcast is held and the send history shows why; it goes out when the build is live, with links pointing at the public site. Sites without ASB Static Publisher are unaffected.

= 2.12.1 =
* Fixed: a post published through the REST API with "Send a message to LINE" set in the same request was not notified when the site default is "do not send". The decision is now taken again once the REST request has finished writing.
* Tested up to WordPress 7.1.

= 2.10.1 =
* Fixed: a password-protected post is announced with its title and link only; its text is no longer sent.

= 2.10.0 =
* Notifications carry a short excerpt between the title and the link. A post with no text simply omits that line.

= 2.9.0 =
* Every globally registered name now uses the `asblnot` prefix. Existing settings, post meta and queued sends are migrated automatically.

= 2.0.0 =
* Reorganized the plugin into classes and added send logging.

= 1.0.0 =
* Initial release.
