=== Snapshot Results ===
Contributors: snapshotscoring
Tags: shooting sports, match results, cowboy action, scoring, competitions
Requires at least: 6.0
Tested up to: 6.5
Stable tag: 2.8.9
Requires PHP: 8.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display match results from Snapshot Scoring on your club's WordPress site.

== Description ==

Snapshot Results connects your WordPress site to the Snapshot Scoring Application,
allowing you to display match results, club information, and announcements directly
on your website.

**Features:**

* OAuth 2.0 secure connection with PKCE support
* Multi-club support - connect multiple shooting clubs
* Automatic results sync from Snapshot Scoring
* Custom post types for clubs, matches, and announcements
* Shortcodes for embedding results anywhere
* Theme-compatible templates with CSS custom properties
* Rate-limited API endpoints for security

**Perfect for:**

* Cowboy Action Shooting clubs
* USPSA/IPSC shooting clubs
* IDPA clubs
* Any club using Snapshot Scoring

== Installation ==

1. Upload the `snapshot-results` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Settings > Snapshot to configure the connection
4. Click "Connect with Snapshot" and sign in with your Snapshot Scoring account
5. Choose which of your clubs to connect to this site

== Frequently Asked Questions ==

= How do I connect my club? =

1. In WordPress, go to Settings > Snapshot and click "Connect with Snapshot"
2. Sign in with your Snapshot Scoring account (club owner or manager)
3. Approve the connection and pick the club(s) to publish on this site

= Can I connect multiple clubs? =

Yes! The plugin supports multiple club connections. Each club can have independent
sync settings for matches and results.

= How often do results sync? =

Results sync when:
* Matches are finalized in Snapshot Scoring (if auto-push is enabled)
* You manually trigger a sync from the WordPress admin
* The Snapshot backend pushes updates

= Can I customize the results display? =

Yes! The plugin includes templates that can be overridden in your theme. Copy the
templates from `wp-content/plugins/snapshot-results/templates/` to your theme's
`snapshot-results/` folder to customize them.

= Does the plugin send any data to SnapshotScoring? =

If a bug in this plugin causes an error, an anonymous error report is shared with
SnapshotScoring to help fix bugs (no personal data). Reports contain only technical
details: the error message and code location, the plugin version, your WordPress
and PHP versions, and your site's hostname. No visitor data, user accounts, or
page content is ever included, and errors from WordPress core, your theme, or
other plugins are never reported.

= How do I turn error reporting off? =

Go to Settings > Snapshot > Advanced Settings and uncheck "Share anonymous error
reports with SnapshotScoring to help fix bugs (no personal data)". It is enabled
by default.

== Screenshots ==

1. Admin settings page
2. Club connection management
3. Match results display
4. Single match detail view

== Changelog ==

= 2.8.4 =
* Added: Anonymous error reporting to SnapshotScoring to help fix bugs (no personal data)
* Added: Opt-out toggle in Settings > Snapshot > Advanced Settings (enabled by default)
* Changed: A crashing shortcode or banner now renders as empty output instead of breaking the page

= 2.8.3 =
* Security: Plugin updates now default to the production server (api.snapshotscoring.com)
* Security: Update packages are verified against a sha256 checksum before installation
* Security: Update server setting restricted to official Snapshot backends over https
* Security: OAuth access and refresh tokens are now encrypted at rest
* Changed: OAuth token validation cache reduced from 5 minutes to 60 seconds
* Removed: Non-functional organizations/sync REST endpoint

= 2.8.2 =
* Added: Sport-aware match meta fields now exposed via WordPress REST API
* Added: Fields include org_code, scoring_type, ruleset info, and column definitions

= 2.8.1 =
* Fixed: Manual sync now uses correct club-based endpoint

= 2.8.0 =
* Added: In-admin plugin updates - check for and apply updates directly from Settings > Snapshot
* Added: Current vs available version display in Advanced Settings
* Added: "Check for Updates" and "Apply Update" buttons

= 2.7.2 =
* Fixed: Plugin update checker URL configuration

= 2.7.0 =
* Added: Rate limiting for REST API endpoints
* Added: X-RateLimit response headers
* Security: IP-based request tracking for abuse prevention

= 2.6.1 =
* Fixed: Improved null safety in API response handling
* Fixed: Token validation caching improvements

= 2.6.0 =
* Added: Organization hierarchy sync (organizations, leagues, rulesets)
* Added: Sport-aware column rendering
* Added: Results table column visibility settings
* Added: Announcement banner system
* Changed: Migrated to shared HTTP client

= 2.5.0 =
* Added: Multi-club OAuth support with PKCE
* Added: Connections table for tracking synced clubs
* Added: Auto-push settings per club
* Changed: Deprecated legacy API key authentication

= 2.4.0 =
* Added: Custom post types for clubs, matches, and announcements
* Added: Template system with theme override support
* Added: Shortcodes for club and match fields

= 2.3.0 =
* Added: OAuth 2.0 client registration flow
* Added: PKCE support for secure authorization
* Security: Timing-safe comparison for pairing codes

= 2.2.0 =
* Added: Database migration system

= 2.1.0 =
* Added: REST API endpoints for data ingestion

= 2.0.0 =
* Complete rewrite with OAuth support
* Multi-club management capabilities
* Breaking: New database schema (automatic migration)

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 2.7.0 =
This version adds rate limiting to prevent API abuse. No action required.

= 2.0.0 =
Major update with new OAuth authentication. Your existing connections will be
migrated automatically, but you may need to re-authorize if issues occur.
