Description
Sportstats Head-to-Head Football Comparison lets your visitors pick any two teams from a supported league and instantly see a side-by-side head-to-head comparison built from historical match data: win/draw/loss form, goals scored and conceded, shots and shots on target, corners, cards, and a range of over/under trend breakdowns.
Features
- Side-by-side team comparison via a shortcode or a Gutenberg block
- Historical match data automatically fetched and kept up to date from football-data.co.uk
- 11 countries and their top leagues supported out of the box
- Form guide (last 5 results), league position, and performance against top-8/bottom-12 opposition
- Light, mobile-friendly widget with no page-builder lock-in
- Optional team and league crest images (see the FAQ below for where to get them)
PRO adds custom brand colors, choosing which stats appear and where, and per-block-instance configuration when using the Gutenberg block – so different pages on the same site can show different stat selections.
Data source
Match data is fetched from football-data.co.uk. This plugin only reads and displays publicly available historical results and statistics – it does not offer betting services of any kind.
Source code
The frontend widget (assets/dist/js/*.js, assets/dist/css/*.css) is a compiled/minified Vue 2 application. Its full, human-readable source (everything except node_modules and the compiled assets/dist/ output) is available as a zip:
https://sportstatswp.com/wp-content/uploads/2026/09/sportstats-head-to-head-football-comparison-FULLSOURCE-1.1.17.zip
To rebuild it yourself: unzip, cd assets, then npm install followed by npm run build (Vue CLI / webpack), which regenerates the contents of assets/dist/.
External services
This plugin connects to football-data.co.uk to fetch the historical football match data (results, goals, shots, corners, cards, etc.) it displays. This is the plugin’s core data source – it’s needed for the plugin’s calculations to work at all, and there is no local alternative.
- What data is sent: no visitor data, personal data or cookies are ever sent – only plain server-to-server HTTP requests (HEAD requests to check if a country’s data file has changed, and GET requests to download the CSV file itself) with no parameters beyond the file’s own URL.
- When: automatically, twice a week (Tuesdays and Thursdays) via WordPress’s scheduled events, and additionally whenever an administrator clicks “Fetch now” / “Fetch all countries now” on the Sportstats Football admin page.
- Service: football-data.co.uk. They don’t publish a single dedicated Terms of Service or Privacy Policy page; the closest equivalent is their disclaimer page: https://www.football-data.co.uk/disclaimer.php (their contact page, https://www.football-data.co.uk/contact.php, has no separate privacy policy linked either).
Disclaimer
Data and accuracy. Match statistics are derived from third-party historical data (football-data.co.uk) and are provided as is, with no warranty of accuracy, completeness or timeliness. Everything this plugin shows – form guides, percentages, over/under trends and every other figure – is for general informational purposes only. It is not betting, gambling, investment or financial advice, and past results do not predict future outcomes. If your site touches on betting or gambling in any way, it is your responsibility to comply with the laws and licensing requirements of every jurisdiction in which your site is accessed.
No affiliation. This plugin is an independent work. It is not affiliated with, endorsed by, sponsored by or connected to any football league, competition, club, governing body, or football-data.co.uk. Team, league and competition names are used for identification only and remain the property of their respective owners. The plugin ships no club or league crest images; any logos you upload are used under your own responsibility and remain the property of their respective owners.
No warranty. This plugin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Screenshots





Blocks
This plugin provides 1 block.
- Sportstats Football Stats Compare two football teams' head-to-head stats.
Installation
- Upload the plugin files to the
/wp-content/plugins/sportstats-head-to-head-football-comparisondirectory, or install the plugin through the WordPress plugins screen directly. - Activate the plugin through the ‘Plugins’ screen in WordPress.
- Go to Sportstats Football in your admin menu and click “Fetch all countries now” to pull in the first batch of match data.
- Add the
[h2hfootballdata]shortcode to any page or post, or insert the “Sportstats Football Stats” block in the block editor.
FAQ
-
How often is match data updated?
-
Automatically, twice a week (Tuesdays and Thursdays), matching when football-data.co.uk publishes fresh results. You can also trigger a manual fetch at any time from the Sportstats Football admin page.
-
Does this plugin work with the block editor?
-
Yes – both the
[h2hfootballdata]shortcode and a dedicated Gutenberg block are supported.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Sportstats Head-to-Head Football Comparison” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Sportstats Head-to-Head Football Comparison” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.1.17
- The “Data & fetching” board now tells the truth about coverage. A fetch that reached football-data.co.uk but stored nothing – because the source was briefly unreachable, or every season file failed, or a country has no data yet – no longer shows as “Fresh” on the strength of the timestamp alone. Each country now tracks its last attempt separately from its last successful update, the board’s freshness is based on the successful update, and a country whose most recent attempt failed shows a short note (“source unreachable on the last attempt”, “2 files failed on the last attempt”, “no match data stored”). Existing history entries keep working unchanged.
1.1.16
- Accessibility: the four team selectors now carry an accessible name (aria-label) so screen readers announce which dropdown is which, and the “couldn’t load” message is now announced as an alert. No visible change.
1.1.15
- Housekeeping: the internal version constant and the source-package link in this readme had been left at 1.1.13 when the plugin header moved to 1.1.14. All version markers are now in step, and the release build refuses to package if they ever drift again. No functional change.
1.1.14
- Fixed the data crawler stopping completely whenever football-data.co.uk’s “www.” host was down or returning 503s while the apex domain (football-data.co.uk) was up and serving the exact same files. Every fetch (the per-country index pages and the season CSVs) now tries the apex host first and falls back to “www.” automatically – sticking with whichever host answers for the rest of that crawl – and sends a browser-like User-Agent. Data fetching had stopped for everyone during that outage even though the files were reachable the whole time.
- Added a Disclaimer section to this readme: match data is third-party and provided as is (no warranty of accuracy or timeliness), nothing shown is betting, gambling or financial advice, the plugin is an independent work not affiliated with any league, club, competition, governing body or football-data.co.uk, team and league names remain the property of their respective owners, the plugin ships no crest images, and the GPL “no warranty” applies. Also added the same trademark/affiliation note to the admin “About this data & disclaimer” panel.
1.1.13
- Fixed the fixture selector (country/league/home team/away team) sitting flush against its card’s edge instead of matching the padding every other section has (a leftover
padding: 0rule from before the redesign was cancelling the card’s own padding out).
1.1.12
- Redesigned the public widget to match the admin’s “Stats Desk” family (self-hosted Bricolage Grotesque + IBM Plex Mono, the same pitch-teal identity) – team header, win/draw/loss chart, the diverging comparison bars for every metric, the shots/shots-on-target/corners/cards breakdowns and the summary icons all keep exactly the sections and figures they show today, restyled rather than rebuilt. The widget’s existing light/dark (
prefers-color-scheme) support carries over with the new palette. - The two brand colours (Appearance settings, or a PRO block instance’s own colours) still only recolour the comparison bars themselves, same as before – every card, border and heading stays the fixed Sportstats look regardless, so a site with the PRO add-on active still reads as one continuous widget rather than two different-looking things stitched together.
- The CTA block a PRO plugin can add (
h2hfs_pro_cta_html) is now actually styled, rather than unstyled raw HTML.
1.1.11
- Fixed: the plugin’s database table is now created with
$wpdb->get_charset_collate(), so it always matches the site’s configured database charset/collation instead of falling back to the MySQL server default. - Fixed: the widget’s inline colour CSS (custom properties for the primary/secondary brand colour) is now validated as a CSS-safe hex colour right before it’s printed, rather than trusting the value it was given – closes a theoretical injection path for a colour value coming from a PRO block instance’s own attribute or a PRO plugin’s colour filter.
- Both fixes were raised in the wordpress.org plugin review; no functional/visual change for existing installs using the built-in colour picker.
1.1.10
- Fixed the admin screens being hard to read in dark mode – the plugin’s settings pages now paint their own background, so text that sits outside a card (the intro line, the “about this data” section, links) is legible on a dark theme instead of near-white on near-white.
1.1.9
- Redesigned the plugin’s admin screens. The five settings pages now share one consistent look with tabbed navigation, and each screen was reworked around what it’s actually for: “Data & fetching” shows every league as a card with a fresh / aging / stale status and a next-scheduled-fetch summary instead of a flat list; “Select metrics” gains a live map of where each section lands on the widget; “Appearance” swaps the six RGB sliders for two colour pickers with a live preview of the widget in your chosen colours.
- Added a light / dark theme for the admin screens – a “Follow system / Light / Dark” setting on the Appearance page, plus a quick toggle in the top-right corner of every page (remembered per browser). Self-hosted fonts, no third-party requests.
- No change to any saved setting, and nothing to redo after updating.
1.1.8
- The season picker now offers every season in which BOTH selected teams played at least one match in the league, not only the seasons in which the two teams faced each other. Previously the current season stayed hidden from a match-up until that specific fixture had actually been played, even though every stat shown is each team’s own form for the season and doesn’t require the two to have met. Seasons the teams did meet in are still included exactly as before.
- Internal: the plugin now bumps its stats cache once on the first page load after an update, so cached results from the previous version are refreshed straight away rather than after their normal expiry.
1.1.7
- Renamed the internal PHP namespace from
H2H\FootballStatstoSswpfc\FootballStats– “H2H” was only 3 characters, shorter than the 4+ character prefix required by the directory guidelines, and inconsistent with thesswpfc_prefix already used for every option/hook. Also prefixed two loop variables in uninstall.php for the same reason. Purely internal; no functional changes, no admin-facing changes.
1.1.6
- Dropped “WP” from the display name and the admin menu/block titles (“SportstatsWP Head-to-Head Football Comparison” -> “Sportstats Head-to-Head Football Comparison”, “SportstatsWP Football” -> “Sportstats Football”, “SportstatsWP Football Stats” block -> “Sportstats Football Stats”) – “WP” is a restricted term in plugin names per the directory guidelines. The plugin slug already had no “WP” in it; the author name “SportstatsWP” is unaffected. No functional changes.
1.1.5
- Removed the duplicate “Tested up to” line from the main plugin file’s header – it’s now declared only in this readme, per WordPress.org review feedback.
1.1.4
- Slug changed to “sportstats-head-to-head-football-comparison” (dropping “wp”), per the reserved slug WordPress.org confirmed during plugin review. Display name is unchanged. Nothing for existing users to do – this only affects the not-yet-approved directory listing.
1.1.3
- Fixed a database-update bug: three combined formatting quirks in the internal table-creation code meant a future database schema change would never actually reach an already-installed site (only a brand new install picked it up) – no visible change for existing users today, but this ensures future updates that add data actually apply correctly instead of silently failing to. Also added an internal safety check so a schema change now applies on a routine plugin update, not only when the plugin is deactivated and reactivated.
1.1.2
- Renamed the plugin (and its slug) to “SportstatsWP Head-to-Head Football Comparison” for a more distinctive identifier, per WordPress.org plugin review feedback. Existing settings are carried over automatically on activation – nothing to redo.
- Internal option names moved from an ‘h2h_’ prefix to ‘sswpfc_’ (also per review feedback – the old prefix was too short/generic). Migrated automatically; nothing for site owners to do.
- Upgraded the Win/Draw/Loss pie chart from Chart.js 2.9.4 to 4.5.1 (per review feedback – the old version was out of date). No visible change in normal use.
1.1.1
- PRO: fixed the football-data.co.uk attribution showing on every “results only” widget in a Multi-widget sync group instead of once, on the selector.
- All PRO feature logic (custom colors, chart style, metric/section/stat visibility, per-block configuration, CTA rendering) moved out of this plugin entirely, into the separate PRO plugin. No visible behavior change – internal compliance work.
- Admin-page scripts now properly enqueued via wp_enqueue_script()/wp_add_inline_script() instead of inline <script> tags.
- Admin menu moved lower in the menu order, out of the way of core WordPress items.
- Documented the football-data.co.uk connection and this plugin’s own compiled-asset source repository in this readme.
1.1.0
- PRO: one Gutenberg block instance’s team selector can now drive one or more other block instances’ results elsewhere on the same page (see the new “Multi-widget sync” panel in the block settings).
- PRO: the team crest/name/league-position/form row is now its own togglable section (“Team header”), alongside the existing left/center/right/icon-row sections.
- Completed translations for all 12 supported admin languages (several strings introduced since 1.0.0 had been left untranslated).
1.0.0
- Initial release.
