Metrics and Statistics
SportsPress distinguishes between two types of player data: Metrics and Statistics. They look similar on the frontend but are stored and calculated differently.
Metrics
Metrics are static values entered manually on each player's edit screen. They do not change when events are entered. Typical examples are Height and Weight.
Metrics are defined as sp_metric custom post type records. To view or add metric types, navigate to SportsPress > Configure and look for the Player Metrics section.
Adding a New Metric Type
Go to SportsPress > Configure.
Click Add New in the Player Metrics section.
Enter a name (the title) and click Publish.
The metric now appears as an input field in the Metrics meta box on every player edit screen.
Metric types display in the order set by the Order field on each metric's edit screen. Lower numbers appear first. Metrics with no order value (0) appear before those with higher values.
Entering a Metric Value on a Player
On the player edit screen, scroll to the Metrics sidebar meta box. Each configured metric type shows a labelled text input. Enter the value and save the player.
Metric values are stored in the sp_metrics array in post_meta on the player post. The key in that array is the metric's post_name (slug).
Statistics
Statistics are calculated from performance data recorded on events (the Box Score). They are not entered directly per-player; instead they aggregate automatically across all events the player appeared in.
Statistics types are defined as sp_statistic custom post type records. Navigate to SportsPress > Configure > Player Statistics to view them.
How Statistics Are Calculated
When an event is saved with player performance data, the plugin reads the sp_players post meta on each event and sums performance values per player per season per league. The totals are resolved through equations configured on each statistic type.
The Statistics meta box on the player edit screen shows placeholder values (grey text) for auto-calculated results. You can enter a manual override into any cell; when a manual value is present it replaces the calculated value.
Statistics Table Structure
The Statistics meta box shows one table per league the player belongs to. Within each table:
One row per season
A Total row (always present; editable when the Total display option is enabled in Player Settings)
Optionally a Career Total section across all leagues
Each column corresponds to a sp_performance or sp_statistic variable visible in the configuration. The columns shown depend on the Columns setting in Player Settings:
Auto — shows all performance and statistic variables that have their Visible option enabled in Configure
Manual — shows only the items checked in the Columns meta box on the individual player's edit screen
Column Modes
Player Settings > Statistics > Mode controls how column headers render:
Values — column headers show the performance/statistic name as text
Icons — column headers show the icon (featured image) of the performance/statistic if one is set; falls back to text if no icon exists
Categories (Sections)
Player Settings > Statistics > Categories splits the statistics table into separate offense and defense sections. Options are:
Combined — one table showing all statistics together
Offense → Defense — two tables; offense appears first
Defense → Offense — two tables; defense appears first
A performance variable is assigned to a section by editing that variable in Configure and setting the Section field.
