=== SibLinks ===
Contributors: upmetech
Tags: internal links, seo, link suggestions, broken links, orphan pages
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 0.18.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Internal link suggestions for every page and post: the sentence to link and the page to link to, plus a free check of broken internal links.

== Description ==

SibLinks reads a page and suggests where it should link to other pages of the same site: the exact sentence, the words to link, and the page to link to, with a short reason. You add the link with one click in the block editor, the classic editor or Elementor, or mark it on the published page with any page builder.

The plugin interface is in English and can be translated on translate.wordpress.org. Link suggestions are built for Hebrew content: on sites in other languages they are fewer and less precise.

**What you get**

* Suggestions for one page, or for many pages at once from the links dashboard.
* "Pages that could link here": for a page you want to strengthen, the existing pages that should link to it, and the sentence in each.
* A links dashboard: pages no other page links to, pages that were never checked, and links added recently.
* Link health (free, runs on your site and needs no account): broken internal links, links through a redirect, links to unpublished pages, and pages without outgoing internal links.
* Search Console data without connecting a Google account: upload the Performance export, and pages that Google already shows in positions 4 to 20 are suggested first as link targets.

**Requires a SibLinks account**

Link suggestions are computed by the SibLinks service (see "External services" below). You need a SibLinks account, a Site ID and a Secret from the customer area at https://app.siblinks.co.il. Each check of a page uses one check from your account balance. New accounts get free trial checks. Link health and the Search Console data work without an account.

== Installation ==

1. Install the plugin from Plugins > Add New, or upload the `siblinks` folder to `/wp-content/plugins/`, and activate it.
2. Sign up at https://app.siblinks.co.il and add your site. You get a Site ID and a Secret.
3. In WordPress go to SibLinks > Settings, paste the Site ID and the Secret, and click "Test connection". The server address is already filled in.
4. Open a page and click "Suggest links" (in the Pages or Posts list, in the editor, or in the admin bar on the published page). The links dashboard is at SibLinks > Links dashboard.

Optional: the connection values can be set in wp-config.php instead of the database:
`define( 'SIBLINKS_API_BASE', 'https://api.siblinks.co.il' ); define( 'SIBLINKS_SITE_ID', '...' ); define( 'SIBLINKS_SECRET', '...' );`

== Frequently Asked Questions ==

= Does the plugin add links by itself? =

No. Every link is added only when you click "Add link", and you can undo it before saving.

= Which content is sent? =

Only the page you chose to check, rendered as a logged-out visitor would see it. Published pages, drafts, pending and scheduled pages can be checked. Private and password-protected pages are not sent unless the site owner enables it in the settings. Nothing is sent until a user starts a check. See "External services".

= Who can run a check? =

By default authors and above, on the pages they may edit. The setting "Who can run a check" changes it, and developers can use the filter `siblinks_user_can_run_check`. Checking many pages at once needs at least author permissions, and searching for "pages that could link here" needs editor permissions.

= Does it work with page builders? =

Yes. In the block editor, the classic editor and Elementor (Text Editor widget) the link is added in place. With other builders the suggestion is marked on the published page and the link is copied, so you can paste it in the builder.

== Screenshots ==

1. Link suggestions in the block editor sidebar: the sentence, the words to link and the target page.
2. The links dashboard: pages with suggestions, pages no page links to, and pages never checked.
3. Link health: broken internal links, links through a redirect and links to unpublished pages.
4. "Pages that could link here" for a page you want to strengthen.
5. Settings: Site ID, Secret and who can run a check.

== External services ==

This plugin connects to the SibLinks service (https://api.siblinks.co.il), which computes the link suggestions. It is operated by SibLinks (https://www.siblinks.co.il). Nothing is sent before the site owner enters a Site ID and a Secret in SibLinks > Settings.

What is sent, and when:

* When a user checks a page (one page, or many pages from the dashboard): the content of the page as a logged-out visitor would see it (this includes drafts, pending and scheduled pages when the user checks them), and a short summary of each candidate target page on the same site (address, title, main heading, section headings, description, focus keyword, first paragraphs).
* When an editor searches for "pages that could link here": the summary of that page and of other pages, then the content (as visitors see it) of up to 20 published pages the service picked.
* While a check runs: requests for its status. While SibLinks screens are open, and every few minutes in the background when checks are waiting: a request for the account balance.
* When the site owner clicks "Test connection": a request to check that the service answers.
* Every request carries the site's Site ID and a signature made with its Secret. The Secret itself is never sent.
* Every request also carries the site's domain name (for example example.com), so the service can make sure the Site ID is used only on this site.

The service processes the content to compute suggestions and does not store it. The service may use third-party processing providers, as described in its privacy policy.

* Terms of use: https://www.siblinks.co.il/terms/
* Privacy policy: https://www.siblinks.co.il/privacy-policy/

The plugin does not connect to Google. The Search Console file you upload is read on your site and not kept; only the numbers per page (clicks, impressions, CTR, average position) are kept in your site's database, and they are never sent to the SibLinks service or anywhere else.

Link health requests only your own site's pages (to see which links are broken or redirect), from your server, and sends nothing to the SibLinks service.

== Privacy ==

Page summaries are built on your site and kept in its own post meta (`_siblinks_profile_v1`). Link check results are kept in post meta (`_siblinks_link_check_v1`). Uninstalling the plugin removes its tables, options and post meta.

== Security ==

* Requests are signed (HMAC-SHA256 with a timestamp and a one-time value); answers are signed and checked, and an unsigned answer is refused.
* The server address must use HTTPS.
* Every action checks the user's permissions and a security token.

== Changelog ==

= 0.18.2 =
* New design for the Settings screen, with the connection status at the top and three steps to connect a new site.
* Links to help, contact and the customer area on the Plugins screen, and "Connect" while the plugin is not connected.

= 0.18.1 =
* Translations now come from WordPress.org language packs. The plugin no longer ships its own translation files.

= 0.18.0 =
* The site's domain name is sent with every request, and the SibLinks service ties the Site ID to it. A copy of the site (for example a staging copy) cannot use the same Site ID; each copy needs its own. Needs the SibLinks server 0.11.0 or later; with an older server the plugin works as before.

= 0.17.1 =
* Faster Link health screen: the report is kept for 10 minutes and rebuilt when a page is scanned or changes.
* Search Console import uses much less memory (files are read one at a time, line by line) and far fewer database queries on large sites.

= 0.17.0 =
* The interface is now translatable: English source strings, with the Hebrew translation included. Panels and screens follow the direction of the user's language.
* Fixed: the "Test connection" result stayed red after a failed test followed by a successful one.
* Fixed: "Hide the suggestions" on the published page was always in Hebrew.
* The Secret is now cleaned only of spaces and characters it cannot hold.
* Removed the redirect from the old "Internal Links Suggester" screen addresses.

= 0.16.1 =
* New SibLinks icon in the admin menu and in the block editor sidebar.

= 0.16.0 =
* The plugin is now called SibLinks (it was "Internal Links Suggester"). New plugin folder and slug (`siblinks`), and new names for its settings, tables, hooks and constants (`siblinks_`, `SIBLINKS_`). It does not read the data of the old plugin: remove the old one, install this one and enter the Site ID and Secret again.
* The server address is filled in by default (https://api.siblinks.co.il).
* Requires the SibLinks server 0.10.0 or later.

= 0.15.0 =
* Requires WordPress 6.2 or later. Every database query passes table and column names through $wpdb->prepare(); every AJAX request checks its security token first; request values are sanitized.

= 0.14.0 =
* Search Console data: upload the Performance export (zip or CSV) on the links dashboard. Pages in positions 4 to 20 are listed and suggested first as targets.

= 0.13.0 =
* New design for the links dashboard, a page's suggestions screen and Link health.

= 0.12.0 =
* "Pages that could link here".

= 0.11.0 =
* Link health: broken links, links through a redirect, links to unpublished pages, pages without outgoing links.
