Description
KUROFUNE LINK works with KUROFUNE, a separate, paid SEO service. It does three things on the posts of your site:
- Related posts. It adds a short list of related posts from the same site after the body of each post, so that new articles also receive links from older ones. KUROFUNE decides which posts are related, using its analysis of your articles, and delivers only pairs of post IDs. The plugin renders the list from your own WordPress data (titles, permalinks and featured images).
- Keeping KUROFUNE’s parts up to date. Posts written or rewritten with KUROFUNE can contain marked parts: recommendation links (affiliate or product links you registered in KUROFUNE), product sections, product names and banners, call-to-action (CTA) blocks, and author cards. When you change one of them in KUROFUNE, KUROFUNE delivers the new link URL, product name, banner image or block HTML, and the plugin shows it in place of the old one in every post that contains that marked part.
- Article structured data. On the page of each published post, it adds one schema.org
BlogPostingblock as JSON-LD (title, publish and update dates, author, site name and logo, featured image), taken from your own WordPress data. By default (Automatic) it is left out while Yoast SEO, Rank Math, All in One SEO, SEOPress PRO, Slim SEO or a theme known to add its own structured data is active. Under Settings > KUROFUNE LINK you can choose Automatic, Add or Do not add.
- The post content is never modified. All three happen only when a single post is displayed. Deactivating restores the saved content on uncached requests; cached pages may still show replacements. When product snapshots are stored, deactivation and deletion attempt to clear the available page cache. If replacements remain, clear your page cache and CDN cache manually.
- Posts that the body already links to are left out of the related posts. Only published posts without a password are shown.
- The number of related posts (default 6) and the heading can be changed under Settings > KUROFUNE LINK, and the related-post list can be turned off there. That setting does not stop the updates of marked parts; deactivate the plugin to stop them.
- Delivered HTML is checked with WordPress’s own HTML filter (kses) when it is received, and anything that does not pass is not used. Delivered recommendation link URLs must use https.
- No “powered by” credit, no tracking of visitors, no cookies and no front-end JavaScript. The plugin itself never sends requests to KUROFUNE or any other server (see External services).
- For editors, the admin bar, the post editor and the posts list get “AI rewrite in KUROFUNE” (and “Edit in KUROFUNE” for posts KUROFUNE wrote) links that open the post in KUROFUNE.
KUROFUNE deliveries and cancellation
The related posts and KUROFUNE’s parts appear only after KUROFUNE sends the first delivery. The article structured data does not need KUROFUNE: it is added from your own WordPress data as soon as the plugin is active (see Settings > KUROFUNE LINK). An active KUROFUNE plan (including a trial), a WordPress connection, and KUROFUNE LINK being turned on are required for new deliveries.
When the KUROFUNE subscription ends, the site is archived, or its workspace is deleted, KUROFUNE removes the related posts it delivered. Recommendation links, CTA blocks and author cards keep the content KUROFUNE delivered last, but are no longer updated. To show the content saved in each post instead, deactivate the plugin. Restoring the site or subscribing again starts the updates again.
External services
This plugin is an add-on for KUROFUNE, a service provided by 株式会社KUROFUNE AI (KUROFUNE AI, https://www.kurofune-ai.co.jp/). Apart from the article structured data, which is built from your own WordPress data without contacting anyone, it does nothing until KUROFUNE starts sending data to it.
What KUROFUNE sends to your site, and when. The plugin itself never contacts KUROFUNE or any other server. Instead, after you connect your site to KUROFUNE (with the WordPress Application Password of an Editor or Administrator that you register in KUROFUNE) and turn on KUROFUNE LINK there, KUROFUNE calls three REST API endpoints that this plugin adds to your site, periodically and when you change something in KUROFUNE:
POST /wp-json/kurofune-link/v1/sync– KUROFUNE sends: an identifier of your KUROFUNE site, a sequence number, how long that KUROFUNE site reserves this WordPress against another one, pairs of post IDs for related posts and their checksum, the IDs of the posts KUROFUNE wrote, the address of KUROFUNE (used only for the “Edit / AI rewrite in KUROFUNE” links), the current URLs of marked recommendation links, product names, product introduction HTML and banner image URLs, and the HTML of marked CTA blocks and author cards. The plugin stores these values in WordPress options on your site. Its response includes delivery checksums andoshi_content_rejected: the IDs of rejected product rows (up to 100), or["*"]if the whole kind is rejected or more than 100 rows are rejected.GET /wp-json/kurofune-link/v1/status– KUROFUNE reads: the plugin version, your site’s home URL, the display setting, the detected page-cache plugin, since when a cache purge has been waiting, and whether another KUROFUNE site reserves this WordPress; for its own delivery, also the sequence number, a checksum of the stored post IDs, the remaining reservation time and when delivered items were last rejected.GET /wp-json/kurofune-link/v1/usage– KUROFUNE asks which published posts contain one specified recommendation link, product part, CTA block or author card. The response includes up to 200 IDs, titles and URLs of published posts.
All three endpoints require a logged-in user with the edit_others_posts capability (Editor or above). Nothing about your visitors is sent to KUROFUNE.
What your visitors’ browsers load. Delivered recommendation links point to the destinations you registered in KUROFUNE, and delivered product parts, CTA blocks and author cards can contain images. An image is loaded by the visitor’s browser from wherever it is hosted: your own media library, KUROFUNE’s image storage, or the address of an image URL you entered in KUROFUNE. As with any image or link in a post, that host receives the visitor’s IP address and browser information; the plugin adds no tracking to these requests.
Links that open KUROFUNE. When an editor clicks “Edit in KUROFUNE” or “AI rewrite in KUROFUNE”, the browser opens KUROFUNE with this site’s host name, the post ID and the chosen action in the address. Nothing is sent until the link is clicked. The links open the KUROFUNE address named in KUROFUNE’s deliveries, and only if it is one of these two (or an address the site’s administrator adds in wp-config.php, see the FAQ):
- https://app.kurofune-ai.co.jp – KUROFUNE, the service that customers use.
- https://kurofune-web-stg-qk2qckvyua-uc.a.run.app – KUROFUNE’s staging environment, used only by KUROFUNE staff and testers to check KUROFUNE before a release. The links open it only on a WordPress site connected to that staging environment.
KUROFUNE’s terms and privacy policy:
- KUROFUNE terms of service: https://www.kurofune-ai.co.jp/terms/
- KUROFUNE privacy policy: https://www.kurofune-ai.co.jp/privacy/
Source code
Everything in this plugin is shipped as human-readable source: the PHP, the stylesheet and the translation source (languages/*.po). There is no build step other than compiling the .po file into the bundled .mo file with gettext’s msgfmt. Development-only files (unit tests, coding-standards configuration) are left out of the zip.
Installation
- Install and activate the plugin.
- In KUROFUNE, connect the site to WordPress (if not connected yet) and turn on KUROFUNE LINK in the site settings.
- The related posts, and changes you make in KUROFUNE to recommendation links, CTA blocks and author cards, appear after KUROFUNE’s next delivery. Adjust the number of posts and the heading under Settings > KUROFUNE LINK if needed.
FAQ
Nothing is displayed
Before the first delivery, check that the KUROFUNE plan is active, KUROFUNE LINK is turned on for this site in KUROFUNE, and the site is connected with an Editor or Administrator account. Only articles that KUROFUNE has analysed get related posts. If a previous delivery existed, check whether KUROFUNE revoked it (for example, LINK was turned off for this site in KUROFUNE; a revoke removes only the related posts, and recommendation links, CTA blocks and author cards keep their last content) or the plugin was deleted with “Also delete the content received from KUROFUNE and these settings” turned on and then installed again.
My SEO plugin or theme already adds structured data
With the default setting (Automatic) the plugin adds nothing while one of the SEO plugins listed in the Description, or one of these themes (also as the parent of a child theme), is active: SWELL, Cocoon (unless its own JSON-LD setting is off), JIN, JIN:R, THE THOR, SANGO and STORK19. The settings screen says which one it found. After you change the setting, pages cached by a page-cache plugin or a CDN may keep the previous state until you clear those caches. If another plugin or your theme adds structured data for articles and is not recognised, choose Do not add under Settings > KUROFUNE LINK. Developers can change the data with the kurofune_link_article_schema filter (return an empty array to add nothing for a post) and report another source with the kurofune_link_article_schema_other_source filter.
My theme already shows related posts
Turn off one of the two lists (in your theme settings or under Settings > KUROFUNE LINK) so that readers do not see two.
Which PHP does it need?
PHP 7.4 or later on a 64-bit build (the standard for current hosting). On 32-bit PHP, deliveries with large IDs or sequence numbers are refused rather than stored incorrectly.
Can I style the list?
Yes. The markup uses fixed class names starting with kurofune-link (for example .kurofune-link__card), and the plugin’s stylesheet is intentionally minimal.
What happens when I deactivate or delete the plugin?
Deactivating stops the plugin’s display processing, so uncached requests show the saved post content. When product snapshots are stored, deactivation and deletion attempt to clear the available page cache; pages already cached by your host or CDN may still show replacements. If that happens, clear those caches manually. The delivered data and the settings are kept, so activating the plugin again shows the last delivery as before. If KUROFUNE has revoked its delivery in the meantime (for example, you turned LINK off for the site), KUROFUNE normally sends the revoke again while this WordPress stays connected to the site, and the related posts are removed on its next delivery from KUROFUNE (usually in about 30 minutes). KUROFUNE stops sending the revoke 7 days after it first tried. A revoke removes only the related posts: recommendation links, CTA blocks and author cards keep the content KUROFUNE delivered last. Deleting the plugin keeps them as well, so installing it again shows the last delivery as before. To remove them when the plugin is deleted, turn on “Also delete the content received from KUROFUNE and these settings” under Settings > KUROFUNE LINK before deleting (it is off by default).
The links should open another KUROFUNE address
The “Edit / AI rewrite in KUROFUNE” links only open the two addresses listed under External services. To let them open another KUROFUNE address, add it to wp-config.php, for example define( 'KUROFUNE_LINK_EXTRA_APP_URL', 'https://kurofune.example.com' ); (https, no path). Deliveries work without this setting.
Changelog
1.6.0
- When KUROFUNE revokes its delivery (when LINK is turned off, the subscription ends, the site is archived or its workspace is deleted), only the related posts are removed. Recommendation links, product sections, CTA blocks and author cards keep the content KUROFUNE delivered last, and pending page-cache purges are kept. Previously a revoke removed all of them.
- A revoke that arrives while no KUROFUNE site holds this WordPress is remembered, so that an older delivery from the same KUROFUNE site that arrives later is refused.
- Status card: a new picture after a revoke (“Updates from KUROFUNE have stopped”: related posts are not shown, the other parts keep their last content), also shown on the Dashboard and the Plugins screen for 14 days. The reasons and what to do when the update deadline has passed were updated.
- Page-cache purges clear only the page cache: W3 Total Cache and LiteSpeed Cache no longer clear the object cache, OPcache or minified files. On a multisite network the whole page cache is no longer purged; changed posts are purged one by one. A failed purge is retried, and a purge the cache plugin cannot do is no longer retried every 5 minutes.
- A KUROFUNE site’s older deliveries that arrive late stay refused for 8 days, also after another KUROFUNE site took over this WordPress.
- When the database cannot be read, the sync and status endpoints answer 503, so that KUROFUNE tries again later.
- Fixed since 1.1.0: after a delivery from KUROFUNE the page-cache purge was never scheduled, so cached pages kept showing the earlier recommendation links, CTA blocks and author cards until the cache expired.
- Where the whole page cache cannot be purged (a multisite network, Nginx Helper), changes used by more than 200 posts, or more than 2000 changes at once, are purged in later runs, 200 posts at a time.
- Nginx Helper: the whole cache is no longer purged, since other WordPress sites may share its cache folder. WP Fastest Cache with its Cloudflare integration: since its every purge clears the whole Cloudflare zone, it is purged as a whole at most once every 10 minutes. W3 Total Cache: purging a post no longer clears its database cache.
- Network-wide activation, deactivation and deletion no longer purge each site’s posts one by one; deactivating or deleting the plugin on one site purges up to 200 posts that show KUROFUNE items.
1.5.1
- The status endpoint also reports how many related posts a post shows at most, so KUROFUNE can show the related-post links on its content map.
1.5.0
- Add article structured data (schema.org BlogPosting as JSON-LD) to published posts, with a setting (Automatic, Add or Do not add) that by default leaves it out while a recognised SEO plugin or theme adds its own.
1.4.0
- Enforce combined saved-data, URL-length and display-output limits, serialize usage rate-limit updates, and bound repeated unclosed SVG/MathML scans.
- Remove banners for products marked removed when replacements are stopped or the product has no snapshot; active products keep their original banners.
- Update marked product sections, names and banners from versioned product snapshots, without changing saved post content. Preserve heading anchors and update the matching KUROFUNE table of contents. Newer article parts are left untouched until their snapshot arrives.
- Validate product introduction HTML and images on receipt, acknowledge accepted snapshots with a digest, and support unlinking, removing all product parts and stopping replacements. Unreadable components keep their saved content; marked link opening tags inside them receive the new URL and rel only when their generation matches the received snapshot (older generations stay unchanged). Unlinked or removed products lose their link attributes; products without a snapshot use legacy links.
- Find posts using the new product markers and clear their caches when names or other product data change. Deactivation and deletion attempt a full page-cache purge when product snapshots are stored.
1.3.4
- Image CTA blocks with a separate image for phones are accepted. KUROFUNE sends them as
<picture>with one<source>(media query and one https image URL) around the usual image; WordPress’s own HTML filter does not list these two tags, so the plugin allows them only while checking a delivered CTA block. A<source>whose image is not a single https URL is not used.
1.3.3
- The Status section of the settings screen was rebuilt as one card. A coloured banner says whether KUROFUNE is delivering (green), has stopped (yellow) or has not delivered anything yet (blue, with the three steps to start). Below it the card lists how many posts show recommendation links, CTA blocks and author cards, how many posts have related posts, when the last delivery arrived, how long until the update deadline, which KUROFUNE this WordPress is connected to, and a button that opens KUROFUNE. When updates have stopped it also lists the usual reasons and what to do.
- The time of the last delivery is now stored with the delivered data (the same option, removed on uninstall only when the delete setting is on). Until the next delivery arrives after updating, it shows “Unknown”.
- When updates from KUROFUNE have stopped (the update deadline has passed), a warning also appears on the Dashboard and the Plugins screen for administrators for 14 days after the deadline, with a link to the status.
- The advice about a theme or another plugin that already shows related posts moved from Status to the description of the Display setting.
- Deactivating or deleting the plugin no longer deletes the delivered data (recommendation links, CTA blocks, author cards, related posts); activating or reinstalling it shows the last delivery as before. A new setting, “Also delete the content received from KUROFUNE and these settings” (off by default, under Settings > KUROFUNE LINK), removes the delivered data and the settings when the plugin is deleted; each site of a network uses its own setting. Previously a mis-click on Deactivate lost the last delivery for good once updates from KUROFUNE had stopped (project archived or subscription cancelled). If KUROFUNE has revoked its delivery in the meantime, KUROFUNE sends the revoke again and it is removed on the next delivery from KUROFUNE (usually in about 30 minutes). The status card now also says the plugin stays free to use after cancellation.
1.3.2
- Settings screen: the description now also covers what KUROFUNE LINK has done since 1.1: it replaces recommendation links, CTA blocks and author cards with their latest KUROFUNE versions when a post is displayed. It also says which setting stops what: Display turns off only the related posts; deactivating the plugin stops the replacement. The plugin list description was updated the same way.
1.3.1
- “Edit / AI rewrite in KUROFUNE” links can also open KUROFUNE’s staging environment (used only by KUROFUNE staff and testers), so that the same published plugin works with both. The readme lists both addresses under External services.
1.3.0
- Author cards built by KUROFUNE are accepted on WordPress 6.5 – 6.x (the
displaystyle was refused there). - A delivered CTA block must be one complete block, so that it cannot change the rest of the post.
- A delivery that is in progress while the plugin is deactivated or deleted is discarded instead of saved.
- The delivery lock is unique per WordPress install, also when several installs share one MySQL server.
- With WP Super Cache on a multisite network, only the affected posts’ caches are cleared, never the whole cache.
- “Edit / AI rewrite in KUROFUNE” links open only the production KUROFUNE unless
KUROFUNE_LINK_EXTRA_APP_URLis defined. - Bundled translations are loaded by the plugin only on WordPress 6.5 – 6.7 or when network-activated; otherwise WordPress loads them.
- Deactivating and uninstalling also remove the scheduled cache purge.
- Readme: describe the external service, what is received and sent, and images loaded by visitors’ browsers.
1.2.0
- Update existing author cards marked with a persona ID when KUROFUNE sends new card HTML, without changing saved post content.
1.1.0
- Update marked recommendation links and CTA blocks when KUROFUNE sends new values, without changing the saved post content.
- Add a usage endpoint for published posts and deferred cache purging after live item changes.
1.0.3
- Posts KUROFUNE wrote get “Edit in KUROFUNE” and “AI rewrite in KUROFUNE”; other posts get “AI rewrite in KUROFUNE”. The admin bar shows them under one “KUROFUNE” item.
1.0.2
- “Open in KUROFUNE” in the admin bar, the post editor side column and the posts list (for users who can edit the post).
1.0.1
- Show 6 related posts by default, in 3 columns (2 on narrow screens) so the last row is always full.
- Default heading is now “You may also like” (Japanese: こちらもおすすめ).
- Refuse to report success when the assignment could not be saved; never show password-protected posts.
1.0.0
- First release.
