=== Add Smart Wayback Machine links to URLs ===
Contributors: snedker
Tags: wayback, archive, links, preservation, web-archive
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Automatically adds Wayback Machine links to external links in older posts, helping preserve access to content that may have disappeared.

== Description ==

Add Smart Wayback Machine links to URLs automatically adds Wayback Machine links to external links in older posts, helping preserve access to content that may have disappeared from the web.

**Features:**

* Automatically adds Wayback Machine links to posts older than a configurable age (default: 3 years)
* Customizable icon/text for Wayback links (supports emojis and Unicode characters)
* Configurable hover title text
* Select which post types to apply the filter to
* Live preview in admin settings
* Responsive design and accessibility features
* Compatible with WordPress 5.0+ and PHP 7.4+

**How It Works:**

1. Checks if a post is older than your configured age threshold
2. Scans the post content for external links (http/https URLs)
3. For each external link, adds a small Wayback Machine link next to it
4. Uses the post's publication date to create timestamped Wayback URLs
5. Skips links that are already Wayback Machine URLs

This plugin is based on the Drupal "Wayback Filter" module and maintains the same core functionality while adapting to WordPress conventions.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/add-smart-wayback-machine-links-to-urls` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Use the Settings->Wayback Filter screen to configure the plugin

== Frequently Asked Questions ==

= Why don't I see Wayback links on my posts? =

* Check that your posts are older than the configured age threshold
* Ensure the post type is selected in the plugin settings
* Make sure you're viewing single post pages (not archive pages)
* Verify the posts contain external links (http/https URLs)

= Can I customize the appearance of Wayback links? =

Yes! Add CSS targeting the `.wayback-link` class to your theme's stylesheet or use the WordPress Customizer.

= Do Wayback links work with all external link plugins? =

Most external link plugins should work fine. If external link icons appear on Wayback links, you can hide them with CSS:

```css
.wayback-link svg,
.wayback-link .external-link-icon {
    display: none;
}
```

= How accurate are the Wayback Machine timestamps? =

The plugin uses the post's publication date to create Wayback URLs. The Wayback Machine will show the archived version closest to that date, if available.

= How do I test the plugin? =

1. Set the age threshold to 0 years temporarily in Settings > Add Smart Wayback Machine links to URLs
2. Create or view a post with external links
3. You should see Wayback links appear next to external links
4. Reset the age threshold to your preferred value

== Screenshots ==

1. Plugin settings page showing configuration options
2. Example of Wayback links added to external links in a post
3. Live preview of link appearance in admin settings

== Changelog ==

= 1.0.0 =
* Initial release
* Automatic Wayback Machine link addition to external links
* Configurable age threshold for posts
* Customizable icon/text for links
* Support for multiple post types
* Admin settings with live preview

== Configuration ==

After activation, go to **Settings → Add Smart Wayback Machine links to URLs** in your WordPress admin to configure:

**Icon or Text for Wayback Link**
* Default: 🏛️ (classical building emoji)
* Other suggestions: 💾 (floppy disk), ⟲ (circle arrow), or text like "[Archive]"
* Supports any emoji, Unicode character, or plain text

**Link Title**
* Default: "Click to see an archived version of the destination page."
* This appears when users hover over the Wayback link on desktop

**Age Threshold**
* Default: 3 years
* Posts older than this will get Wayback links
* Set to 0 to add Wayback links to all posts (useful for testing)

**Content Types**
* Select which post types should have Wayback links added
* Default: Posts only
* You can also enable for Pages, Custom Post Types, etc.

== Styling ==

The Wayback links use the CSS class `.wayback-link` and can be customized in your theme's CSS:

```css
/* Make Wayback links smaller and red */
.wayback-link {
    font-size: 0.8rem;
    color: red;
}
```
