=== RacerPacer ===
Contributors: racerpacer
Tags: running, club, events, schedule, gpx
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 0.8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Runs for a running club and events for a race organiser: weekly runs with a schedule, race weekends with a race finder.

== Description ==

The RacerPacer plugin does two jobs, and you choose which under Settings: **club runs**, **events**, or both.

**Club runs** add a Runs menu to WordPress. A run is written like a post, with a Run details box underneath for the things runners ask about.

* **When.** One date, or every week on a day and time. A weekly run can have a first date, a last date and dates it is not on, which drop off the schedule.
* **Where.** A meeting point, linked to a map.
* **How far and how fast.** A distance and a pace range, shown per km and per mile. With Route Maps active, upload a GPX file and the run gets its distance, climb, an elevation profile and a map, and people can download the route. The download holds the line and its heights only: times, heart rate and the runner's name are taken out when the file is uploaded.
* **The schedule.** Four blocks, each with its settings in the editor's sidebar: **Run schedule** lists what is coming up, as cards or as a table; **Next run** shows the next one; **Club card** shows the club's logo, tagline, social links and link buttons; **Location map** shows where a run meets or an event starts. Each takes the editor's own colour, spacing, border, shadow and text size controls.
* **This week.** Runs, This week is one screen for the weekly job. Say a run is off or has changed on one date, and it stays on the schedule marked that way. The same screen writes a message to paste into a group chat and draws a square picture to post, both from the schedule.
* **A calendar people subscribe to.** The **Calendar button** block adds every run to a visitor's own calendar, and it keeps itself up to date, runs called off included.
* **The route library.** The **Route library** block lists every route the club's runs carry, with distance, climb, a profile, a map and the GPX. It needs Route Maps.
* **Shortcodes too.** For the classic editor or a page builder: `[rpkit_schedule]`, `[rpkit_next_run]`, `[rpkit_club]`, `[rpkit_map]`, `[rpkit_routes]` and `[rpkit_calendar]`.
* **The look.** Seven colour sets, your own accent colour, five font pairings, checked for contrast. Or tick one box and everything takes your theme's colours instead.

**Events** add an Events menu. One event is one race weekend.

* **Races.** Each event holds one or more races, each with its distance, climb, technical grade, elevation profile, route file and kit list.
* **The race finder.** A block that filters every event by name, country, distance, climb and terrain. `/races/` shows it without any setting up.
* **Volunteers.** List the roles an event needs and how many people each takes. The **Volunteers** block shows the places left and takes a name, an email and a role. Names are never shown on the site. You read the list on the event's edit screen, and each sign-up is emailed to you.
* **The runner info pack.** A printable page per event, built from the races, the kit lists and the course, plus the sections you add (parking, registration, cut-offs) and an emergency number. It draws the course (the race lines from their GPX files, or the checkpoints joined in order) with a scale bar, each race's elevation profile, the checkpoint cut-offs, and QR codes for the event page and each GPX. Visitors print it or save it as a PDF. The **Runner info pack** block links to it.
* **Afterwards.** Results links, photos, films, a quote and a few numbers turn a finished event into a record of the weekend.
* **Twelve blocks**, under Events in the block inserter: event grid, race finder, event header, race details, register band, volunteers, runner info pack, bookmark button, next-up readout and three for the aftermath.
* **Bookmarks, if you want them.** Off by default. Switch the Save button on under Runs, Settings and visitors can save an event. It is kept in their own browser and nowhere else.

**Build your own card.** The plugin's blocks draw finished cards. To lay one out yourself, insert the **Upcoming runs**, **Upcoming events** or **Past events** version of the Query Loop block, put Paragraph, Heading, Button or Image blocks inside it, and connect each to a field under Attributes in the block's settings: the date, meeting point, distance and climb, pace, register link and so on. Two patterns, "Run cards to build on" and "Event cards to build on", start you off. Every field is optional: a block connected to an empty field is left off the page.

It is for one club or one organiser. There are no member accounts, no entries and no moderation, and it leaves posts, pages, comments and every other plugin alone, so you can add a shop, memberships or a newsletter with the tools you prefer.

**Maps and routes** are drawn by Route Maps, a second plugin in the same kit. With it active, a run or an event gets a location map, an event's map shows its checkpoints and its course, a run can have a GPX route, and the editors get Find on map and a map to set each pin on. Without it this plugin still works: a run or an event shows its address and a Get directions link, and a run shows the distance you type.

It works with any theme. The RacerPacer theme, the block theme in the same kit, carries the look across the whole site.

== Installation ==

1. Upload the `racerpacer-runs` folder to `/wp-content/plugins/` and activate it. A "Runs" page holding the schedule is created for you.
2. For maps and GPX routes, upload and activate `racerpacer-maps` too.
3. Go to Runs → Settings. Tick club runs, events or both, then fill in the name, links and look. With only events ticked, Settings moves under the Events menu.
4. Go to Runs → Add run, or Events → Add New Event. Or press **Load demo runs** or **Load demo events** on the settings screen to see made-up ones first, and remove them when you are done.

Coming from RaceDay Model and RaceDay Features? Activate this plugin, then deactivate those two. Your events, their pages and their blocks stay exactly as they are.

== Frequently Asked Questions ==

= Can I cancel one week of a weekly run? =

Two ways. To tell people, go to Runs, This week and set that date to Off, with a few words on why: the run stays on the schedule, marked off, and the calendar shows it cancelled. To take a date off the schedule altogether (a week you already know has no run), add it to "Dates it is not on" in the Run details box.

= Can I switch routes off? =

Yes, under Runs → Settings. No GPX can be uploaded and no route map is drawn. Location maps have their own switch on the same screen. Deactivating Route Maps switches both off at once.

= Where did the maps go after updating to 0.6.0? =

They moved to the Route Maps plugin, which is in the same kit. Activate it and every map, route and pin is back as it was. Nothing stored was changed.

= What does the plugin keep about a volunteer? =

Their name, email address and role, and a phone number and a note if they gave one. It is kept on the event, shown only to people who can edit that event, and used for nothing else. WordPress's own Export and Erase Personal Data tools include it, and deleting the plugin removes it.

= Does it sell places or take entries? =

No. Link a run's text or an event's register button to your shop, a form or an entry platform. The one form it has is the volunteer sign-up on an event.

= What happens to my runs if I delete the plugin? =

Deleting it from the Plugins screen removes the runs, their routes, the plugin's settings and every volunteer's details. Events are kept. Deactivating it removes nothing.

== External services ==

New versions come from builtby.racerpacer.com (https://builtby.racerpacer.com), since the plugin isn't on WordPress.org.

* What is sent and when: when WordPress checks for updates (about twice a day, and when you press Check again under Dashboard, Updates), your server asks `builtby.racerpacer.com` for the latest version. The request carries the plugin's version number and your server's IP address, and nothing else: not your site's address, settings or content. builtby counts the checks for each version and doesn't keep the IP address. When you update, the new zip downloads from the same place.
* Switching it off: add `define( 'RACERPACER_NO_UPDATE_CHECK', true );` to wp-config.php. You can still update by uploading a new zip.
* builtby privacy policy: https://builtby.racerpacer.com/privacy/

Map tiles and the Find on map place search are requests made by the Route Maps plugin when it is active, and are described in its own readme. This plugin makes neither.

The **Get directions** button is a link to Google Maps (https://www.google.com/maps) carrying the pin's latitude and longitude. Nothing is sent to Google unless a visitor follows it. The `racerpacer_runs_directions_url` filter points it elsewhere.

* Google Maps terms: https://www.google.com/help/terms_maps/
* Google privacy policy: https://policies.google.com/privacy

The **Load demo events** button downloads sample photos from Unsplash (https://unsplash.com).

* What is sent and when: only when an administrator presses that button (or runs `wp rpkit demo events`), your server requests about 20 photos from `images.unsplash.com`. That request carries your server's IP address. Nothing is sent at any other time, and visitors' browsers are never involved.
* Unsplash terms: https://unsplash.com/terms
* Unsplash privacy policy: https://unsplash.com/privacy

== Resources ==

* QR Code Generator for JavaScript 1.4.4 (assets/js/vendor/qrcode.js), Copyright (c) 2009 Kazuhiko Arase. License: MIT. Licence text: assets/js/vendor/LICENSE-qrcode-generator.txt
* Lucide icons (assets/icons/ui/). License: ISC. Licence text: assets/icons/ui/LICENSE-lucide.txt
* Simple Icons (assets/icons/brand/). License: CC0 1.0. Licence text: assets/icons/brand/LICENSE-simple-icons.md
* Epunda Sans and Epunda Slab, Copyright The Epunda Project Authors (Typofactur). License: SIL Open Font License 1.1. Licence texts: assets/fonts/
* Space Grotesk, Copyright Florian Karsten, and IBM Plex Sans and IBM Plex Mono, Copyright IBM Corp. License: SIL Open Font License 1.1. Licence text: assets/fonts/LICENSE-space-grotesk-ibm-plex.txt

== Changelog ==

= 0.8.0 =
* The runner info pack draws the course: each race's GPX line (with Route Maps), or the start, checkpoints and finish joined in order, with a scale bar and north. It is drawn on the page, with no map tiles, so it prints cleanly and asks no other server for anything.
* Each race in the pack gets its elevation profile from its GPX, and a QR code for the GPX; the pack's header has a QR code for the event page. The QR codes are drawn in the browser by a bundled script. Filters racerpacer_runs_pack_sketch and racerpacer_runs_pack_qr switch either off.
* Checkpoints have a Cut-off. It shows in the pack's course table and in the checkpoint list under the event's map.
* The Kinder demo event's 12K has a made-up GPX route and checkpoint cut-offs, so the demo pack shows all of this. Sites that already loaded the demo get them once on update; nothing else is touched.

= 0.7.2 =
* Offers new versions under Dashboard, Updates, from builtby.racerpacer.com. See External services for what the check sends and how to switch it off.

= 0.7.1 =
* A run marked off on a date shows its details in the muted colour instead of fading them, which took them below the contrast line.
* The race finder's hint, an event card's place line and a readout's labels no longer use transparency on text, for the same reason.
* Small labels in the event blocks are at least 12px.
* The race finder loads its first card's photo straight away; every card photo asks for a size that fits its column.
* In a block theme, the event stylesheet loads only on pages that show an event block (filter racerpacer_runs_events_css_when_used).
* The Aftermath strip can be reached and scrolled with a keyboard.

= 0.7.0 =
* New: Runs, This week. Mark a run off or changed on one date, copy a message for a group chat, and download a square picture of the week.
* New: a calendar feed of the runs and events, and a Calendar button block (`[rpkit_calendar]`).
* New: Route library block (`[rpkit_routes]`).
* New: Volunteers block for events, with roles, places left, a sign-up form and the list on the event's edit screen.
* New: a printable runner info pack for each event, and a block that links to it.
* An event's race numbers now show miles and feet under the metric figures.
* Four more demo events have full race sheets, and the Kinder demo event has volunteer roles and an info pack.

= 0.6.0 =
* Maps are now a plugin of their own, Route Maps, in the same kit. It draws the location maps and the route maps, reads GPX files, and brings Find on map and the pin picker to the run and event editors. It also has a Map block for any page, with your own places and lines on it.
* Activate Route Maps after updating and everything is as it was: your pins, routes, checkpoints and Location map blocks are untouched.
* Without Route Maps this plugin shows an address and a Get directions link in place of each map, and a run shows the distance typed for it. GPX routes are switched off until it is active.
* The map style moved to Settings, Maps. A style address set here before is carried over.
* Three filters moved with the maps and changed name: `racerpacer_runs_map_style_url` is now `racerpacer_maps_style_url`, `racerpacer_runs_map_credit` is `racerpacer_maps_credit`, and `racerpacer_runs_geocode_enabled` is `racerpacer_maps_geocode_enabled`. `racerpacer_runs_clean_gpx` is `racerpacer_maps_clean_gpx`.

= 0.5.0 =
* New: a location map for a run's meeting point or an event's start, with a Get directions button. It is on a run's own page once the run has a pin, on event pages, and available anywhere as the Location map block or the `[rpkit_map]` shortcode. The block has switches for the directions button, the address, and whether the map waits for a press before loading.
* New: the location map can sit behind a View location button and open in a popup with the address and the Get directions button (block setting "Show the map", or `display="popup"` on the shortcode).
* New: an event's map draws each race's GPX course under its start, checkpoint and finish marks.
* New: every block has border, corner radius and shadow controls in the editor. The run schedule, next run, club card and location map also have text size and line height, and the whole block scales with the size chosen.
* Fixed: with events switched on, a run schedule, next run or club card block was wrapped twice, which stretched it to the full width of the page and drew its padding and colours twice.
* Setting the pin: in the Run details box (or an event's Latitude and Longitude), press Find on map to look the place up by name, or Set the pin on a map and click or drag to the exact spot.
* A run's meeting point link goes to its pin when it has one.
* Events: a Course locations box for a finish that is not the start, and a list of checkpoints. The event's map shows them all as lettered and numbered marks, and lists them underneath with a Directions link each.
* Settings, Location maps switches the maps off, leaving the address and the directions button.

= 0.4.0 =
* One name for everything the plugin stores: `rpkit`. Shortcodes are now `[rpkit_schedule]`, `[rpkit_next_run]` and `[rpkit_club]`, blocks are `rpkit/…`, CSS classes and variables start `rpkit-` and `--rpkit-`, and the command line tool is `wp rpkit`. The old names were short enough to clash with another plugin.
* Updating moves an existing site across by itself: settings, runs, events, their fields, and every block, shortcode and class already written into your pages, templates and custom CSS. Nothing is deleted. A shortcode or class typed into a theme file is the one thing it can't reach, so change those by hand.
* The Save button on events is now a setting, and off until you switch it on (Settings, Save button).
* The race finder's filters can be switched off one by one on the block, and a filter that could not narrow your events is left out by itself. Its search box now matches race names as well as event names.
* A GPX file is cleaned when it is uploaded: times, heart rate and the name of whoever recorded it are taken out, and people download the line and its heights only.

= 0.3.0 =
* Events are now part of this plugin: the event post type, its fields, the race finder and the other event blocks, which were the separate RaceDay Model and RaceDay Features plugins. Choose club runs, events or both under Settings.
* The event blocks carry their own look, so they work in any theme, in every colour set.
* A new colour set, Blue hour, and a new font pairing, Grotesk.
* An event's page draws its header and races in a theme that has no template for one.
* Build your own card: run and event fields can be connected to WordPress's own blocks inside a Query Loop, with three date-ordered Query Loop versions and two starter patterns.

= 0.1.2 =
* "Download GPX" and the outline and soft link buttons get their outline back; 0.1.1 removed it by mistake.

= 0.1.1 =
* Run cards keep their layout inside other themes. Fonts are fetched early. Runs and the home page get a meta description unless an SEO plugin is active.

= 0.1.0 =
* First version: runs, weekly and one-off schedules, GPX routes, the schedule, next run and club card blocks.
