=== External Links Advertisement Note ===
Contributors: schlegld
Tags: external links, affiliate, sponsored, disclosure, advertising
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Mark external, sponsored, or selected links with configurable disclosure notes while keeping destination URLs unchanged.

== Description ==

External Links Advertisement Note adds a configurable note to links on the front end of your WordPress site.

Version 2.0 introduces a modern detection engine and a redesigned settings interface while preserving settings from the 1.x series.

Choose between three detection modes:

* **All external links** – marks HTTP and HTTPS links that lead away from the current site.
* **Sponsored links only** – marks links whose `rel` attribute contains `sponsored`.
* **Only selected domains** – marks links to domains you explicitly list.

You can configure:

* Marker text such as `*`, `↗`, `Ad`, `Sponsored`, or `Advertisement`.
* An accessibility label for symbolic markers.
* Marker position before or after the link.
* Marker size, color, border, and underline behavior.
* Included and excluded domains.
* Whether image links are marked.
* Whether subdomains are treated as internal.
* Whether links inserted after page load are detected with MutationObserver.
* Simple CSS selectors that should never be marked.

The plugin does not rewrite destination URLs and does not automatically add `nofollow`, `sponsored`, `target="_blank"`, or other link attributes.

English documentation: https://davidschlegl.com/plugins/external-links-advertisement-note/

German documentation: https://davidschlegl.com/de/plugins/external-links-advertisement-note/

= Important =

Not every external link is advertising. This plugin displays labels according to your configuration. It does not provide legal advice and does not determine whether a disclosure is legally required.

== Installation ==

1. Install the plugin from the WordPress Plugin Directory or upload the plugin ZIP.
2. Activate **External Links Advertisement Note**.
3. Open **Settings > External Links Note**.
4. Choose a detection mode and marker style.
5. Save the settings.

Existing 1.x settings are migrated automatically when the plugin is updated.

== Frequently Asked Questions ==

= Does every external link count as advertising? =

No. The plugin can mark every external link if you choose that mode, but whether a link is advertising or requires disclosure depends on your use case and applicable rules.

= Can I mark only affiliate or sponsored links? =

Yes. Use **Sponsored links only** with `rel="sponsored"`, or use **Only selected domains** to maintain your own domain list.

= Does the plugin change link destinations? =

No. It adds a visual marker next to matching links and leaves the destination URL unchanged.

= Does it add nofollow or sponsored attributes? =

No. Version 2.0 deliberately does not change link semantics automatically.

= Does it work with links loaded after the page is visible? =

Yes. Dynamic link detection can be enabled. The plugin then uses MutationObserver to process links inserted after the initial page load.

= Are settings from version 1.x retained? =

Yes. The legacy `bfelan` settings are migrated into the new 2.0 settings format on update.

== Screenshots ==

1. Modern settings dashboard with link detection modes.
2. Marker configuration with live preview.
3. Appearance options for size, color, border, and underline behavior.
4. Domain rules and compatibility options.

== Changelog ==

= 2.0.0 =
* Rebuilt the front-end link detector in dependency-free vanilla JavaScript.
* Added external, sponsored, and selected-domain detection modes.
* Added robust URL parsing for HTTP and HTTPS links.
* Added include and exclude domain rules with wildcard subdomain support.
* Added optional support for image links and dynamically inserted links.
* Added an accessibility label for symbolic markers.
* Added marker position and color controls.
* Redesigned the settings interface.
* Removed the jQuery dependency.
* Removed legacy social and donation links from the Plugins screen.
* Changed the text domain to the WordPress.org plugin slug.
* Added automatic migration of 1.x settings.
* Updated plugin metadata and documentation for current WordPress releases.

= 1.0.2 =
* Added text size option.

= 1.0.1 =
* Minor maintenance changes.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.0 =
Major modernization release. Existing 1.x settings are migrated automatically. Requires WordPress 6.5 and PHP 7.4 or newer.
