=== Pebbls Travel Tracker Map Embed ===
Contributors: s_t_harvey
Tags: embed, map, journey, GPS, adventure
Requires at least: 6.3
Requires PHP: 7.4
Tested up to: 7.1
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed a live Pebbls journey map in any post or page: paste the journey's link, no API key needed.

== Description ==
Show your travels on your own website with a live map from [Pebbls](https://app.pebbls.com/), the free travel tracker and journal for slow journeys: by bike, on foot, under sail, by paddle, train or van.

Paste a link to any public Pebbls journey and it appears as an interactive map with your route, photos and stories. It updates by itself as you travel.

https://www.youtube.com/watch?v=qQYocGCW38E

### Features

- **Paste a link, get a map**: paste a journey link into the editor (block editor, classic editor or page builders) and it becomes the map. Map, journal and flyby links all work.
- **Pick from your journeys**: type a Pebbls username in the block settings and choose from the list.
- **Always your latest journey**: one switch keeps the block showing your newest public journey.
- **Journey stats**: distance, days and countries under the map.
- **Fast pages**: "Load map on click" shows a photo from the journey and loads the live map only when a visitor clicks it.
- **In your site's language**: the map, stats and links in English, French, German, Spanish or Italian.
- **Shortcode**: `[pebbls url="https://app.pebbls.com/adventure-map/username/journey"]`, or `[pebbls user="username" latest="yes"]`. Options: `height`, `stats="yes"`, `click="yes"`, `rounded="no"`, `border="yes"`.
- **No API key** and no account needed on your site. Blocks made with older versions keep working and upgrade themselves when you open them.

### External Services

This plugin connects to the Pebbls API (apix.pebbls.com) to check the journey you paste and, for "Always show latest journey", to look up the explorer's latest public journey (cached for 10 minutes). The map itself is loaded from pebbls.com in an iframe. No data about your site's visitors is sent by the plugin.

**Service Terms and Privacy Policies:**
- [Terms of Service](https://app.pebbls.com/terms)
- [Privacy Policy](https://app.pebbls.com/privacy)

By using this plugin, users agree to these terms as outlined by Pebbls.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/pebbls-journey-map-embed` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Use the Pebbls Journey Map Embed block in your Gutenberg editor to add your journey map.

== Frequently Asked Questions ==

= Do I need an API key? =
No. Since version 2.0 you just paste the link to a public journey. Blocks made with version 1.x keep working without changes.

= Which journeys can I embed? =
Any public journey on Pebbls. Unlisted and password-protected journeys can't be embedded.

= Which link should I paste? =
Any link to the journey: its map (app.pebbls.com/adventure-map/…), its journal or its flyby page all work.

= Will my existing maps keep working? =
Yes. Blocks from 1.x keep showing their map, including "Use latest journey" blocks, and "Show stats" comes back as the new stats line. Open a post in the editor to upgrade a block to the new settings.

= Does the plugin track my visitors? =
No. The plugin sends no data about your visitors. The map comes from pebbls.com; links to Pebbls carry utm tags so Pebbls can see that a visit came from an embed.

= Can I customize the map height? =
Yes, you can customize the map height directly from the block settings in the editor.

== Screenshots ==

1. Paste a journey link in the block settings and the live map appears.
2. "Load map on click": a photo from the journey with distance, days and countries.
3. The live map with the route, photos and stories.
4. Any public journey: pick one from an explorer's journeys.

== Changelog ==
= 2.0.0 =
- Complete redesign: no API key required.
- Users simply paste their public Pebbls journey URL to embed.
- Added "Always show latest journey" option per user.
- Removed map style picker and distance/stats panel.
- Cleaner, simpler block editor UI.
- Accepts any link to a journey (map, journal or flyby page, any language).
- Blocks from 1.x keep working, including "Use latest journey" blocks.
- "Always show latest journey" is cached for 10 minutes and keeps showing the last journey if Pebbls can't be reached.
- Journey picker: choose from an explorer's public journeys.
- [pebbls] shortcode for the classic editor and page builders; pasting a journey link also embeds the map.
- Journey stats line (distance, days, countries); 1.x "Show stats" blocks get it back.
- "Load map on click" for faster pages (on for new blocks).
- Map, stats and texts in French, German, Spanish and Italian when the site uses those languages.
- Blocks from 1.x upgrade themselves when opened in the editor.
- Block API version 3; tested with WordPress 7.1.

= 1.1.0 =
- Added map style selection with thumbnails and mapTypeId support.

= 1.0.8 =
- Fixed error message on plugin activation.

= 1.0.7 =
- Added 'Use Latest Journey' option.  -- Thanks @Usadler for the suggestion.

= 1.0.5 =
- Updated journey distance display.

= 1.0.4 =
- Fixed bug causing map not to display correctly.

= 1.0.3 =
- Fixed bug caused by error in variable names.

= 1.0.2 =
- Updated the plugin to serve SVG files locally instead of from external URLs.
- Added proper documentation for the use of the Pebbls Core API.
- Improved security and compatibility by prefixing all custom functions and classes.

= 1.0.1 =
- Changed the way the API key is utilized to improve security and flexibility.

= 1.0.0 =
- Initial release of the Pebbls Journey Map Embed plugin.

== Upgrade Notice ==
= 1.0.5 =
- Essential update to fix bug in previous release.

= 1.0.4 =
- Essential update to fix bug in previous release.

= 1.0.3 =
- Essential update to fix bug in previous release.

= 1.0.2 =
- Important update to serve SVG files locally and enhance security.

= 1.0.1 =
- Changed API key handling; update recommended.

= 1.0.0 =
Initial release.

== License & Warranty ==
This plugin is released under the GPLv2 license. It is provided "as is" with no warranty of any kind.

**Service Terms and Privacy Policies:**
- [Terms of Service](https://app.pebbls.com/terms)
- [Privacy Policy](https://app.pebbls.com/privacy)
