[WordPress] 外掛分享: Swiss Floorball API

首頁 › 外掛目錄 › Swiss Floorball API
WordPress 外掛 Swiss Floorball API 的封面圖片
全新外掛
安裝啟用
—
尚無評分
8 天前
最後更新
—
問題解決
WordPress 5.0+ PHP 8.2+ v2.2.0 上架:2026-10-17

內容簡介

Swiss Floorball API 外掛提供一個簡易的方式來從 Swiss Unihockey 的公開 API 獲取和顯示地板曲棍球俱樂部的數據。使用者只需設定俱樂部 ID,即可快速存取賽程、排名、統計數據等資訊,提升網站的互動性與資訊性。

【主要功能】
• 一次設定俱樂部 ID,快速存取數據
• 顯示即將到來的比賽與日曆訂閱連結
• 提供即時更新的聯賽排名
• 顯示得分手名單與比賽事件詳情
• 展示個別球員統計與國家隊成員
• 內建響應式表格,支援黑暗模式

外掛標籤

開發者團隊

⬇ 下載最新版 (v2.2.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Swiss Floorball API」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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 when club_id is 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-size and --swfl-icon-color on .swiss-floorball-plugin.
Filter: swfl_icon_svg lets you replace an icon. The result is sanitized with wp_kses() (only svg, path and span with a fixed set of attributes are kept).

Example:
add_filter( 'swfl_icon_svg', function ( $svg, $name, $args ) {
if ( 'refresh' === $name ) {
return '';
}
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.ch to 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.

文章
Filter
Mastodon