=== Burgee – Race Scoring for Sailing Clubs ===
Contributors: vortexnetworking, freemius
Tags: sailing, racing, phrf, regatta, scoring
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Race scoring for sailing clubs: manage seasons, series, and boats, score PHRF handicap racing, and publish schedules, results, and standings.

== Description ==

Burgee is a complete race-management toolkit for sailing clubs that run PHRF
handicap racing.

* Organize racing as Season → Series → Race.
* Maintain a managed list of divisions (e.g. Spinnaker, Jib & Main) and assign
  each boat a division and PHRF rating per season — boats can change divisions
  between seasons without losing their identity or history.
* Enter finish times and let the plugin calculate elapsed and corrected times
  using either Time-on-Distance or Time-on-Time, and assign points using the
  World Sailing Low-Point system. Choose the RRS A5.2 or A5.3 penalty rule per
  series, independent of the correction method. Results remain fully editable
  after submission.
* Series standings with configurable throwouts ("drop the worst N scores once M
  races have been sailed") and RRS Appendix A8 tiebreaks.
* All scoring — both correction methods, A5.2/A5.3, and throwouts — is free.
* Responsive, mobile-friendly public output via shortcodes.

== Shortcodes ==

* `[wpsf_schedule]` — season race schedule.
* `[wpsf_scratch_sheet]` — the season's registered boats by division.
* `[wpsf_series_title]` — a standings breadcrumb heading.
* `[wpsf_race_results]` — results of a single race.
* `[wpsf_race_details]` — course/conditions detail for a single race.
* `[wpsf_standings]` — full series standings grid.

Legacy shortcode tags from version 1.x ([SeasonSchedule], [ScratchSheet],
[ShowSeriesTitle], [RaceResults], [RaceDetails], [show_series_standings]) remain
registered for backward compatibility.

== Changelog ==

= 2.7.0 =
* New: choose how a DNC is scored. The default is unchanged and follows the racing
  rules — one more than the boats entered in the division. Clubs whose Sailing
  Instructions say otherwise can now pick "starters + N" (the common "starters plus
  2" clause, which ties the score to that race's turnout so a boat joining later
  does not change results you have already published) or a fixed value. Set it per
  Racing Series, or per race for a stand-alone race.
* New: boats can be added to a scratch sheet mid-season. A boat that joins after
  racing has begun is recorded DNC for the races it missed, and the series is
  rescored so every boat's scores stay consistent. Adding a boat before any racing
  starts behaves as before.
* Fix: a boat left marked "Finished" with no finish time entered was scored zero
  points — better than winning the race. It is now scored as a non-finisher. The
  same fix covers a division with no start time set.
* Fix: on a race that already has results, a boat with no result entered now
  defaults to DNC instead of "Finished". Entering results for a new race is
  unchanged.
* Change: removing a boat from a scratch sheet now also removes its results for
  that Racing Series and rescores. Those results were already unreachable once the
  boat was removed; the confirmation prompt now says what will happen.

= 2.6.4 =
* Housekeeping: plugin-header cleanup for the WordPress.org directory (removed a
  duplicate URI from the header). No functional changes.

= 2.6.3 =
* Fix: the result-email setup now only appears with a Pro license. The boat email
  address and "email race results to this boat" option, the additional-recipients
  list, and the unsubscribe manager were showing in the free edition even though
  sending results is a Pro feature. They are now hidden without a license, and any
  saved addresses are preserved (never blanked) when settings or a boat are saved.

= 2.6.2 =
* Fix: a stand-alone race no longer shows divisions that have no boats entered.
  Per-division start times and course distances are now scoped to the divisions
  actually racing, on both the admin entry screen and the public race view.
* New: result and cancellation emails can now be sent for stand-alone races, drawing
  recipients from the race's own entries (plus your Settings recipients), the same way
  series races do. (Pro.)

= 2.6.1 =
* Fix: the admin menu icon is now centered in the WordPress sidebar.
* Internationalization and coding-standard cleanups for WordPress.org. No changes
  to your data, settings, or scoring.

= 2.6.0 =
* New: Stand-alone scored races. Score a one-off race that belongs to no series or
  regatta — pick its boats from your registry, set each one's division/PHRF/sail
  number, enter finish times, and publish a results page. It is scored
  independently and never appears in any standings. All scoring — including
  Time-on-Time and RRS A5.3 — is free.

= 2.5.0 =
* New: Pro licensing via Freemius. Result-email notifications are the only Pro
  feature; all scoring and standings — both correction methods, A5.2/A5.3, and
  throwouts — stay free. Your settings are never deleted — Pro features reactivate
  instantly on existing data when a license is active.

= 2.4.0 =
* Throwouts: a Racing Series can now define a tiered throwout schedule — e.g.
  drop 1 after 8 races, 2 after 10 — instead of a single threshold. Existing
  single-step settings keep working unchanged.
* Scoring: added an optional Time-on-Time method per Racing Series
  (Corrected = Elapsed x A / (B + PHRF), defaults A=650 / B=550, editable).
  Time-on-Distance remains the default and is unaffected.
* Scoring: added an optional RRS A5.3 toggle per Racing Series. When on, a boat
  that came to the starting area but did not finish is scored against the number
  of boats that came (entries minus DNC) rather than the full entry list. Off by
  default (standard A5.2).
* Schema changes now also apply automatically after an in-place update, not only
  on reactivation.

= 2.3.0 =
* Terminology: "Race Cup" is now called "Regatta" throughout the admin and public
  output, matching common sailing-club usage. The standings shortcode accepts
  regatta="ID" (and ?wpsf_regatta=); the previous cup="ID" / ?wpsf_cup= keep
  working, so existing pages and links are unaffected.
* Scoring: added the standard RRS scoring abbreviations OCS, RET, NSC, RAF, and DNE
  alongside the existing DNF/DNS/DNC/DSQ. All are scored under RRS 2025-2028 rule
  A5.2 (entries + 1).
* Scoring: a DNE (disqualification, not excludable) is now never dropped by a
  series throwout, as the rules require. Ordinary DSQ scores remain excludable.
* Docs: refreshed the in-code scoring rule citations to the RRS 2025-2028 edition
  (Low Point A4, non-finishers A5.2, race-tie averaging A7, series tiebreaks A8).
* Mobile: on the single-race results view, boat names are now bold and every other
  boat is lightly shaded, so boats are easier to tell apart when stacked. On the
  series and regatta standings, the score columns now scroll horizontally within a
  panel (Place and Boat stay frozen) instead of being crammed together.
* Schedule: a cancelled race now shows its notes (the reason for cancellation) in a
  tooltip on hover or focus.

= 2.2.0 =
* New: Result and cancellation emails now include an unsubscribe link (and
  List-Unsubscribe headers for mail-client one-click unsubscribe). Clicking the
  in-email link opens a confirmation page with a button, so link prefetchers and
  scanners can't unsubscribe anyone by accident. Each email is sent to its
  recipient individually so the link removes only that address. Unsubscribed
  addresses are skipped on future sends and can be reviewed and re-subscribed
  from the Settings screen. Result emails are no longer copied to the site admin
  unless the admin address is itself a subscribed recipient.

= 2.1.0 =
* New: "Clear Results" on the Enter Results screen — a confirmed do-over that
  deletes all results and per-division parameters for a race and resets its
  conditions, notes, and status back to Scheduled. The race itself (name, date,
  series/cup) is kept.

= 2.0.1 =
* Fix: Cancelled races entered from "Enter Results" were saved as Completed
  because the race-level Status field collided with the per-boat status fields,
  so cancelled races were scored (everyone at 0 points), polluted series and
  season standings, and were not shown as cancelled on the schedule. The
  race-level field is now distinct, so cancelled races save correctly, are not
  scored, and show as cancelled.
* Cancelled races: when the email option is checked, a cancellation notice
  (including the race notes) is now sent instead of a results table.

= 2.0.0 =
* Complete rewrite: prepared statements throughout, nonce + capability checks on
  all admin actions, escaped output, prefixed tables, full CRUD for seasons,
  divisions, boats, registrations, series, and races, editable results, per-series
  throwouts, and responsive frontend output.
