=== TargetAce Live Leaderboards ===
Contributors: lastcandlestudios
Tags: archery, leaderboard, sports, club, competitions
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.12.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Show your club's TargetAce leaderboards, events, courses, ladders, records and news on your website.

== Description ==

Clubs run on TargetAce Live (clubs.targetace.app). This plugin shows your club's
Target Score competitions and leaderboards on your WordPress site. It is read-only:
it never changes anything in TargetAce.

Showing results on your website is free for every club. A "Scores by TargetAce" line under
them is optional: it is off until you tick it under Settings > TargetAce Live, and results
show either way. The same goes for your club's sponsor line, if your club has a sponsor.

1. In the TargetAce app, open your club, then Club website, and tap "Get a website key"
   (club organisers only).
2. Paste the key into Settings > TargetAce Live.
3. In the block editor, add the **TargetAce results** block and choose what it shows
   in the block settings, with a live preview. Or add a shortcode such as
   `[targetace_leaderboards]` to any page.

The block can show everything the shortcodes can, with the same options in its
sidebar, and its output is exactly the shortcode's. Until the website key is saved, it
shows a note with a link to the settings page.

Shortcodes:

* `[targetace_leaderboards]` - every competition, newest first.
  Options: `status="open|closed|upcoming"`, `limit="10"`, `top="0"` (0 = everyone),
  `divisions="yes"` (a table per bow style).
* `[targetace_leaderboard name="Portsmouth Postal"]` - one competition. Same `top` and
  `divisions` options.
* Competitions that count team scores also show a team table under the archers
  (add `teams="no"` to hide it).
* `[targetace_ladder_table]` - ladder standings (`name="Club Ladder"`, `top="10"`).
* `[targetace_bracket]` - the latest knockout, round by round (`name="Autumn Cup"`).
* `[targetace_league_table]` - the latest round-robin table and results (`name="…"`,
  `results="no"` to hide results).
* `[targetace_news]` - announcements your organisers chose to show on the website
  (`limit="5"`).
* `[targetace_events]` - the club's public events: coming up, live and just finished,
  each with an Enter or Results link to its targetace.app page (`limit="10"`).
  Beginners' courses and come and try sessions are in the list too, labelled as such,
  with their price and a Book button. `kind="competition"` shows competitions only
  (or `kind="course"`, `kind="have_a_go"`).
* `[targetace_courses]` - beginners' courses and come and try sessions that haven't
  started yet, soonest first: dates, venue, price ("£40 a place + £2.31 booking fee")
  and a Book button to the page where people book and pay (`kind="course"` or
  `kind="have_a_go"` for one kind, `limit="10"`).
* `[targetace_club_badge]` - the club badge (`size="120"`).
* `[targetace_club]` - a club card: badge, name, area and how many members it has on
  TargetAce (`size="80"`, `description="no"` to leave out the club's description). When
  the club says in the app that it welcomes new members, the card shows "New members
  welcome", the club's note and a "Visit our club page" button to its targetace.app page
  (`join="no"` to leave that out).
* `[targetace_records]` - confirmed club records, a table for each round
  (`round="Portsmouth"` for one round). They show once an organiser makes records
  public in the app.
* `[targetace_series]` - season series: each archer's best scores across several
  leaderboards, added up (`name="Winter league"` for one series, `top="10"`).
* `[targetace_committee]` - the club's committee: each member's role and name. It shows
  once an organiser makes the committee public in the organiser console.
* `[targetace_pvp_results]` - recent head-to-head matches between members
  (`limit="10"`, `kind="casual"`, `"ladder"` or `"tournament"`).
* `[targetace_pvp_table]` - head-to-head win/loss table for the past year (`top`, `min`).
* `[targetace_pvp_archer name="Jane Smith"]` - one archer's head-to-head record.
  Head-to-head results show only when an organiser switches them on in the app.

Archer names show in full by default; you can switch to "Jane S." or initials only.
Results follow your site's language. English, Dutch, German, French, Italian and Spanish
come with the plugin; pick one in the settings, or add `lang="nl"` to a single shortcode.
Results are cached (5 minutes by default). If TargetAce Live can't be reached, the last
results are shown. With LiteSpeed Cache, pages showing leaderboards are cached no longer
than that; with other page caches, exclude those pages or shorten their cache time.

== Installation ==

1. Install and activate the plugin.
2. In the TargetAce app, open your club, then Club website, and tap "Get a website key"
   (club organisers only). The organiser console at targetace.app/console/ has it too.
3. In WordPress, go to Settings > TargetAce Live and paste the key.
4. Add the TargetAce results block to a page, or a shortcode such as `[targetace_leaderboards]`.

== Frequently Asked Questions ==

= Does it cost anything? =

No. The plugin is free, and so is showing your club's results on your own website.

= What is the "Scores by TargetAce" line? =

An optional small line under each set of results, with a link to targetace.app. It is off
until you tick it in Settings > TargetAce Live. Results show whether or not you tick it.

= What is the "Sponsored by" line? =

If your club's organisers have set a sponsor in TargetAce (a Club Plus feature), you can show
"Sponsored by ..." under results, with the sponsor's logo and a link to its website. It is off
until you tick it in Settings > TargetAce Live.

= Can the results be in another language? =

Yes. They follow your site's language, and English, Dutch, German, French, Italian and
Spanish come with the plugin. Choose one under Settings > TargetAce Live, or add
`lang="de"` to a shortcode to change just that one.

= Do my visitors need the TargetAce app? =

No. Visitors see the results on your pages. Archers use the app to score.

= I installed an earlier version from targetace.app. What do I do? =

Install this one, then deactivate and delete the older copy on the Plugins page. Your
settings, shortcodes and blocks carry over.

= Does it slow my site down? =

Results are fetched by your server and cached (5 minutes by default), so pages do not wait
on TargetAce for every visitor, and they keep showing the last results if it cannot be reached.

== External services ==

This plugin connects to TargetAce Live (https://targetace.app), the service run by Last
Candle Studios that holds your club's TargetAce data. It cannot show results without it.
Nothing is sent until you save a website key in Settings > TargetAce Live.

* What is sent, and when: when a page with a TargetAce shortcode or block is shown (or
  previewed in the editor) and the cached copy has expired (every 5 minutes by default),
  your server sends a request to clubs.targetace.app with your club's website key, your
  site's address (in the User-Agent header) and, as with any web request, your server's
  IP address. Nothing about your visitors is sent.
* What comes back: the club's public results, events, courses and club details (see
  Privacy below).
* Images: the club badge and, if you choose to show it, your club's sponsor's logo are
  loaded by visitors' browsers from clubs.targetace.app, which sees their IP address and
  browser details as with any embedded image.
* Links: event, course and club page links go to targetace.app, where people enter events
  and book and pay for courses. Nothing is paid or booked on your site.
* Terms of service: https://targetace.app/terms/
* Privacy policy: https://targetace.app/privacy/
* Last Candle Studios privacy policy: https://lastcandlestudios.com/privacy-policy/

== Privacy ==

The plugin fetches your club's public results (archers' names as entered in the app,
bow styles, scores and club records), its public events and courses with their prices,
and its club details from clubs.targetace.app. It stores nothing about
your site's visitors and sets no cookies. Where a page shows the club badge, visitors'
browsers load that image from clubs.targetace.app, as with any embedded image.

== Alongside TargetAce Club Management ==

This plugin is separate from TargetAce Club Management (the club server used by the
current TargetAce app) and runs alongside it: no shared code, settings, menus or
shortcodes. Keep Club Management active while your members use its features. It will
be retired once clubs have moved to TargetAce Live.

== Changelog ==

= 1.12.0 =
* The "Scores by TargetAce" line is optional for every club: results show whether or not it is ticked.
* New setting: show your club's sponsor under results. It is off on new sites. Sites that already had the plugin keep showing their sponsor; untick it to hide it.
* The readme says exactly what is sent to TargetAce Live, and links its terms.

= 1.11.0 =
* New `[targetace_series]` shortcode and block option: season series, where each archer's best scores across several leaderboards are added up.
* A club's sponsor, when its organisers set one in TargetAce, shows as "Sponsored by ..." under the results.

Earlier versions: see changelog.txt in the plugin folder.

== Upgrade Notice ==

= 1.12.0 =
The "Scores by TargetAce" line is now optional for every club, and a new setting shows or hides your club's sponsor.

= 1.9.0 =
First release on WordPress.org. If you installed an earlier copy from targetace.app, delete that copy after installing this one.
