Directory / plugin
Swiss Floorball API
v2.2.0 · by flaviowaser
Unofficial plugin: show Swiss floorball games, rankings, topscorers, rosters and player stats from the public Swiss Unihockey API via shortcodes.
About this plugin
Independent project: This plugin is developed and maintained by Flavio Waser as a personal open-source project. It is not affiliated with, endorsed by or sponsored by Swiss Unihockey (swissunihockey.ch). It only reads data from their public API.
Features
- Plug & Play: Configure your Club ID once and get instant access to your club’s data.
- Calendars: Display upcoming games for teams or entire clubs. Includes ICS subscription links so visitors can add games to their personal calendars.
- Rankings: Always up-to-date league tables for any group or league.
- Statistics: Show topscorer lists and detailed game events.
- Player Profiles: Showcase individual player stats and national team members.
- Responsive: Built-in responsive tables that look great on mobile devices, with dark mode support.
- Cached: API responses are cached for one hour, so your pages stay fast and the API is not hammered.
- ID finder: Admin helper pages let you browse leagues, clubs, games and seasons and copy the IDs you need for shortcodes.
Shortcodes
Use these shortcodes in any Page or Post to display data. Attributes that are left out fall back to the values from the settings page where applicable.
Club & Team Data
[swfl-club-teams]– List all teams in your club.[swfl-club-games]– Club games, shown week by week with previous/next week buttons. Attributes:season,limit,offset,show_upcoming,show_pagination.[swfl-team-games]– Games of one team, paged around the next game. Attributes:team_id,season,page_size(default 4),limit,offset,show_upcoming,show_pagination.[swfl-club-team-games]– All teams of a club with a team selector and their games. Attributes:season,page_size(default 4).[swfl-next-game]– The next upcoming game of the club, or of one team. Attributes:team_id,season,limit(default 1, max 10).[swfl-last-result]– The most recent result of the club, or of one team. Attributes:team_id,season,limit(default 1, max 10).[swfl-teams]– List teams.[swfl-clubs]– List all clubs.[swfl-calendars]– Show upcoming games + ICS link. Attributes:team_id,club_id,season,league,game_class,group.
Example:
[swfl-calendars team_id="427892"]
[swfl-club-team-games season="2025" page_size="6"]
The games, ranking and Mobiliar topscorer shortcodes mirror the official Swiss Unihockey web components (uniho-*). Attribute names with hyphens (game-class, club-id, page-size) work as well as the underscore forms. Week and page navigation need JavaScript; without it the initial view is still shown.
League & Rankings
[swfl-league-games]– Games of a league and group, navigable round by round; playoff series are grouped. Attributes:game_class,league,season,group.[swfl-rankings]– Show the ranking table. Attributes:season,league,game_class,group(name, e.g.Gruppe 1).[swfl-mobiliar-topscorer]– The Mobiliar topscorers as cards: of the whole league, or of one club whenclub_idis set. Attributes:club_id,season.[swfl-topscorers]– Show the topscorer list. Attributes:season,league,game_class,group,limit,offset,show_pagination.[swfl-groups]– List available groups. Attributes:season,league,game_class.[swfl-cups]– List available cups.
Example:
[swfl-rankings season="2025" league="3" game_class="21" group="Gruppe 1"]
Players & Games
[swfl-player]– Show player profile. Attributes:player_id.[swfl-game-events]– Show events (goals, penalties) of a game. Attributes:game_id.[swfl-national-players]– List national team players.
Customization
The plugin uses standard CSS classes prefixed with .sfa-, scoped to .swiss-floorball-plugin. You can override them in your theme’s style.css or the Customizer to match your site’s branding.
Icons
The plugin ships inline SVG icons from Material Symbols (Outlined, filled, Apache License 2.0, see THIRD-PARTY.md). No fonts or external requests are used.
- Setting: Show or hide all icons under Settings > Swiss Floorball API > Show icons (option
swfl_show_icons, on by default). - Styling: Use the CSS variables
--swfl-icon-sizeand--swfl-icon-coloron.swiss-floorball-plugin. - Filter:
swfl_icon_svglets you replace an icon. The result is sanitized withwp_kses()(onlysvg,pathandspanwith a fixed set of attributes are kept).
Example:
add_filter( 'swfl_icon_svg', function ( $svg, $name, $args ) {
if ( 'refresh' === $name ) {
return '<svg viewBox="0 0 24 24" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M12 4V1L8 5l4 4V6a6 6 0 1 1-6 6H4a8 8 0 1 0 8-8z"/></svg>';
}
return $svg;
}, 10, 3 );
Developer Hooks
swfl_icon_svg(Filter) – Replace the SVG markup of an icon.swfl_request_timeout(Filter) – Override the API request timeout (seconds). Takes precedence over the setting.swfl_rest_rate_limit(Filter) – Override the REST requests per minute and visitor (0 = off). Takes precedence over the setting.swfl_upstream_budget(Filter) – Override the site-wide uncached upstream requests per minute (0 = off). Takes precedence over the setting.swfl_upstream_visitor_budget(Filter) – Override the share of the upstream budget per visitor and minute (0 = off). Takes precedence over the setting.swfl_trusted_proxies(Filter) – Change the list of trusted proxy addresses and CIDR ranges.swfl_client_ip(Filter) – Replace the address that identifies a visitor for the rate limit.swfl_error_cache_ttl(Filter) – Seconds a failed or empty API answer is remembered (default 300, transient failures at most 60, 0 = off).swfl_stale_ttl(Filter) – Seconds an answer is kept as an expired copy after its cache lifetime (default 3600, 0 = none).swfl_upstream_budget_exceeded(Action) – Fires at most once per minute while the site-wide upstream budget is used up.
External Services
This plugin connects to the Swiss Unihockey API: by default the free wc.swissunihockey.ch, optionally the Partner API on office.swissunihockey.ch, depending on the API source setting.
It is used to retrieve floorball data such as club games, team rosters, league rankings, player statistics, and calendar feeds.
What data is sent and when:
- Your configured Club ID and Season are sent to the API every time a shortcode is rendered or an admin page is loaded.
- No personal data of website visitors is transmitted. All requests are read-only.
- With the Partner API selected, your API key and secret are sent to
office.swissunihockey.chto request a short-lived auth token.
Service provider: Swiss Unihockey (Floorball Schweiz)
Terms of Service | Privacy Policy
Data stored on your site: To protect the public REST routes, the plugin counts the requests of each visitor per minute by IP address (IPv6 by its /64 prefix); the counter keeps only a hash and expires with the minute. When a visitor exceeds a limit, the address or IPv6 prefix is kept for one hour in the Blocked visitors list on the settings page, visible to administrators only, and then deleted. The plugin adds a suggested text to Settings Privacy Policy guide that you can copy into your privacy policy.
Images from Cloudinary: Team logos and player portraits come from the API as image URLs on res.cloudinary.com (Swiss Unihockey’s image host). The visitor’s browser loads these images directly from Cloudinary when a page with such a shortcode is shown, so the visitor’s IP address and browser data are transmitted to Cloudinary. The plugin does not store or process this data.
Service provider: Cloudinary Ltd. | Terms of Service | Privacy Policy
Links to other services: Venue cells link to OpenStreetMap (built from the venue coordinates) and game links point to myapp.swissunihockey.ch. No data is sent to these sites unless a visitor clicks the link.
Disclaimer: This is an independent plugin. It is not affiliated with, endorsed by or sponsored by Swiss Unihockey (Floorball Schweiz). “Swiss Unihockey” is the name of its respective owner and is used only to describe the data source. “Swiss floorball” in the plugin name describes the sport in Switzerland and does not refer to any organisation.