Description
This plugin adds a fantasy sports pool to your blog. Visitors of your website can predict outcomes of matches and earn extra points with bonus questions. Every player can view scores and charts of the other pool contenders.
The plugin installs some custom tables in the database and includes match information for the UEFA 2024 Championship, but it can be easily updated with match info for other championships or sports. Note: deactivating the plugin may delete all plugin data from your database. To avoid this, make sure the “keep data on uninstall” option is enabled in the settings (it’s on by default since version 2.3.1).
I originally coded this pool in PHP as a standalone website for the UEFA 2000 championship and rewrote it several times for every European Championship and World Cup since. I kept adding features every year. In 2012, I turned it into a WordPress plugin and uploaded it to the plugin directory. I hope you enjoy it.
A special thank you to everyone who donated, helped translate, reported bugs, or contributed in any other way to improving the plugin!
Features
- Users can predict match outcomes.
- Automatic calculation of the pool ranking, or define a custom ranking for a group of matches.
- You can add bonus questions for extra fun (single answer and multiple choice).
- Add your own teams and match data for other competitions.
- Import or export game schedules.
- Automatically calculate championship standings.
- Flexible scoring options.
- Built-in pages and shortcodes to display the pool on your blog.
- Optional user leagues.
- Score charts showing player progress and comparisons (requires separate Highcharts API download).
- Widgets and shortcodes to display match and pool info.
- Extra info pages for venues and teams.
- Add custom functionality with filters and actions.
- WP-CLI support for ranking calculations (faster than admin-side calculations).
- WP-CLI support for importing match results from a CSV file.
Documentation
The plugin includes a detailed help file in the admin panel. For a step-by-step tutorial, check out the guide by Janek from WP Simple Hacks. He even made a video explaining how to set up the plugin.
Other Notes
- Requires WordPress 4.8+, PHP 7.4+, and jQuery 1.4.3+.
- For charts, download the Highcharts API (see the installation instructions or the help page in the admin).
If you find bugs, please report them in the support forum. If you like the plugin, a rating on WordPress.org would be much appreciated!
Localizations
If you’d like to help translate the plugin into another language or keep existing translations up to date, head over to the plugin’s page on translate.wordpress.org.
Be sure to read the After your contribution guide to understand how translations get reviewed and approved.
A big shout-out to all the translation contributors and editors who’ve helped out so far — thank you!
For using custom translations, check the FAQ section. The plugin also includes a .pot
file as a starting point for building your own translation files.
Shortcodes
The plugin provides the following shortcodes. For detailed usage instructions, see the Help page in the WordPress admin.
fp-predictions
fp-predictionform
fp-matches
fp-match-scores
fp-question-scores
fp-next-matches
fp-last-matches
fp-user-score
fp-user-ranking
fp-ranking
fp-countdown
fp-group
fp-link
fp-register
fp-totopoints
fp-fullpoints
fp-goalpoints
fp-diffpoints
fp-jokermultiplier
fp-plugin-option
fp-league-info
fp-chart-settings
/fp-stats-settings
fp-user-list
fp-money-in-the-pot
fp-last-calc-date
fp-next-match-form
Incompatible Plugins & Themes
The following plugins have been reported as incompatible with Football Pool. If you’re the author and have a fix — or if you know a workaround — please get in touch.
If you encounter issues with another plugin not listed here, let me know so I can investigate.
Most caching solutions should be tested carefully.
- DB Cache Reloaded Fix (v2.3)
- Cimy User Extra Fields (v2.6.1) when using the email confirmation feature
- Easy Timer (in Football Pool versions 2.3.8 and below)
- Theme Gadgetry (ThemeFuse framework)
- memcached
Some themes may also interfere with the plugin’s display. See this forum post for a potential fix.
Screenshots
Predict matches via a form in your WordPress site Score charts comparing multiple players Match predictions and scores per user Group rankings overview Overall user ranking Football Pool comes with several useful widgets Admin screen: plugin options Admin screen: edit match outcomes Admin screen: insert shortcode using the classic editor
Installation
To use a custom translation, see the FAQ for more info.
- Upload
football-pool.zip
via the plugin panel, or unzip and upload thefootball-pool
folder to your/wp-content/plugins/
directory. - Activate the plugin in the Plugins panel.
- Configure the plugin via the admin menu.
- Optional: Add pool pages to your menu or link to them manually.
- Optional: Add Football Pool widgets to your sidebar.
- Optional: Add bonus questions.
- Optional: Upgrade existing site users to pool players.
- To use the chart feature, download the Highcharts API and place the
highcharts.js
file in/wp-content/plugins/highcharts-js/highcharts.js
. Use the classic JS file with styling. If using the theme-less version, include the Highcharts CSS in your theme.
Once everything’s set up, just keep an eye on user signups and update match scores and bonus question answers.
FAQ
-
Wow, there are a lot of options. Do I need to change them?
-
You can, but it’s not required. The plugin works just fine with the default settings. Feel free to explore and tweak the options before kicking off your pool.
-
The ranking calculation shows an estimated time left of several hours. Why?
-
The time estimate is based on how long a single calculation step takes, multiplied by the total number of remaining steps. If the early steps are slower (especially if step sizes are set large in
wp-config.php
), the initial estimate might seem way too long.Or… you might just have a huge database with tons of users, matches, and rankings. In that case, the estimate could be accurate. For reference: with 2,000 users, 50 matches, a few bonus questions, and 3 custom rankings, a full calculation took around 45 minutes on my laptop (using default step sizes). Running the same job via WP-CLI took under 10 minutes.
-
Do you have a theme I can use with the plugin?
-
Nope. I’m a developer, not a designer — so I haven’t created a theme.
-
I installed the plugin, but there are no matches. What happened?
-
Since version 2.0.0, matches aren’t added automatically. But there’s a sample schedule (CSV file) bundled with the plugin. Just go to the Matches admin page and use the “Import matches” option to load it.
-
Do I need the “Predictions” page?
-
Technically, yes. The plugin uses this page to display user predictions. So don’t delete it. However, if you don’t want it in your site’s menu, simply remove it via Appearance » Menus.
Some themes automatically add all top-level pages to the menu. Check your theme’s documentation to see how to exclude pages or build a custom menu.
-
I want to use the plugin for a national competition. Is that possible?
-
Absolutely. You’ve got two options:
- Upload a match schedule CSV in the admin. You’ll find an example in
/data/schedules
in the plugin folder. - Use the admin screens to manually add all the teams, groups, match types, and matches.
Also, consider using a theme that fits your competition, or tweak one yourself.
- Upload a match schedule CSV in the admin. You’ll find an example in
-
The charts are gone! What happened?
-
Due to WordPress plugin license rules, the required charting library had to be removed. If you want charts back, check the Help page in the admin for how to manually install the required library.
Also, make sure you haven’t enabled the “simple calculation method” in the plugin settings. That mode skips historical data — it’s faster, but charts won’t work.
-
I don’t see my blog users as players of the pool.
-
Go to WordPress Admin » Football Pool » Users and check if those users are assigned to a league (if you’re using leagues). New users are added automatically, but existing ones must be added manually.
To make someone a player: assign them to a league and save. If you delete a league, you’ll need to reassign those users. Not using leagues? Just make sure users haven’t been removed from the pool via the Users screen.
-
Is there a translation available?
-
Yes! Check this page for available language packs.
To create your own translation:
- Visit translate.wordpress.org
- Or use a tool like Poedit
- Upload your translation to the site, and contact a PTE to approve it
- Or apply to become a PTE yourself
Check the First Steps guide for more info.
To use a custom translation, place your translation files in
wp-content/uploads/football-pool/languages
and use this extension plugin to load them.The default content for the rules page is stored in
rules-page-content-*locale*.txt
(e.g.,rules-page-content-nl_NL.txt
) — this isn’t managed by the Polyglot system. If you translate it and send it to me, I’ll add it to the plugin (with credit, of course). -
I installed the plugin, but it doesn’t look like your screenshots.
-
That’s expected. The plugin includes basic layout styles, but it won’t change your site’s entire look. You’ll need to customize the styles yourself to make everything fit your design.
Use your theme’s CSS or a custom CSS plugin to override styles. Don’t edit the plugin’s CSS files directly — your changes will be lost when you update the plugin.
Reviews
Contributors & Developers
“Football Pool” is open source software. The following people have contributed to this plugin.
Contributors“Football Pool” has been translated into 13 locales. Thank you to the translators for their contributions.
Translate “Football Pool” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
2.12.4
- Bug fix: Moved translation strings inside classes to prevent early loading of textdomain.
2.12.3
- Bug fix: Fix for CSRF vulnerability.
2.12.2
- Bug fix: some parts of the code did not cast the league to int when passing it to the get_pool_ranking_limited() function. Thanks to Colin for reporting.
2.12.1
- Bug fix: Accidentally removed tags around title for the widgets. This has been restored. Thanks to @spaniole for reporting this.
2.12.0
- New: Goal difference bonus now has a setting that defines on which scores the bonus applies (existing installs will keep using the old rules until you change the setting).
- New: Match predictions view on the statistics page now has some extra CSS classes on the table row to show how the score was build up (e.g. toto score plus goal bonus).
- New: Added a print stylesheet for the audit log to remove some clutter from the print of the page.
- New: Extra option to enable or disable showing the admin answer for closed bonus questions on the prediction form.
- New: Added option to send an email notification when a new shoutbox message was saved. Uses the default wp_mail() function.
- Update: Changed the maximum amount of characters for the shoutbox messages to 65,535 (but default setting is still a max of 150 chars).
- Update: When a shoutbox message save fails, it will show a message for the user and keep their text in the input field to try again.
- Update: Also added the
today
CSS class to the matches view. - Tweak: Some clean-up in the widget classes.
- Tweak: Fixed some deprecation warnings (explode(): Passing null to parameter #2).
- Tweak: Added some wp_doing_cron() checks.
- Tweak: Some code reformatting.
- Bug fix: In rare occasions the first chart for the statistics page was defined as a line chart, where it should have been a column chart. Thanks to @pekos for reporting the bug.
- Bug fix: Removed a XSS vulnerability in the bonus questions admin.
- Bug fix: Removed a XSS vulnerability from the teams page and matches page.
2.11.10
- Bug fix: Removed a XSS vulnerability in the bonus questions admin.
2.11.9
- Update: Added the Copa América 2024 championship schedule.
- Bug fix: Removed a bug in the CSV importer.
2.11.8
- Bug fix: Removed some PHP8 language constructs that caused a critical error on PHP7 installs. Thanks to @batigol09 and @ryan944 for reporting.
2.11.7
- Update: Also the Football Pool admin roles (football pool admin, match editor and question editor) get the WP toolbar when logged in. The users can set their personal preference (show or hide) in their profile.
- Update: Added some extra classes to the match cards on the prediction form:
no-prediction
for matches with no prediction,today
for matches that are on the current day. - Bug fix: Fixed an “Undefined index” notice in the CLI command for creating test users when there are no matches.
2.11.6
- Update: Fixed the venues for the final rounds in the UEFA EURO 2024 championship schedule.
2.11.5
- Update: Added the UEFA EURO 2024 championship schedule.
- Bug fix: Shortcode [fp-countdown] now exits gracefully when it is set to countdown to a match, but no first or next match is found. Thanks Frans Jansen for reporting this error.
2.11.4
- New: [fp-next-match-form] shortcode to show a form of only the next match(es).
- Tweak: Small change in the test data CLI method.
- Tweak: Bumped the jQuery version for the TinyMCE dialog to 3.7.1.
- Bug fix: Removed a XSS vulnerability from some shortcodes (low priority).
2.11.3
- Updated: Removed admin icon from plugin assets and added SVG base64 URI in menu definition.
- Tweak: Removed deprecated warning for dynamic property in Football_Pool_Pool class.
- Tweak: Some refactoring of code.
- Tweak: Stop loading of plugin when doing cron actions (only needed if I ever decide to add cron actions).
- Bug fix: In some edge cases the setting “Fix incomplete predictions” could cause points to be awarded when both scores for a match are missing. Thanks fimo66 and Markus Höcker for reporting the bug.
2.11.2
- Tweak: Some refactoring of code.
- Updated: Changed the required PHP version to 7.4.
- Bug fix: League dropdown in the user admin caused a fatal error in certain cases. Thanks Ron Robinson for reporting the issue.
2.11.1
- Bug fix: fp-matches caused a fatal error for empty parameters. Thanks @wongjowo for reporting the issue.
2.11.0
- New: Audit log in the admin for the administrator to view all saves that users did in their predictions.
- New: Added cache group to WP object cache calls to be able to exclude it from persistent caching plugins.
- New: Option to consider a null value for an incomplete prediction (e.g. only home score entered) as valid and default the missing value to 0.
- New: Shortcode [fp-last-matches] that displays the last started matches before a certain date. Similar parameters as [fp-next-matches].
- New: Added parameters to the [fp-user-list] to limit the output with the ‘num’ parameter and to display only the latest registrations (based on and ordered by the WP_User’s user_registered field) with the ‘latest’ parameter.
- New: Added ‘is_favorite’ parameter to teams. This parameter is used to add an extra CSS class to matches.
- Updated: AJAX saves on the frontend are now disabled by default and I made it a setting in the options screen (but it can also still be changed via the FOOTBALLPOOL_FRONTEND_AJAX constant in the wp-config).
- Updated: Changed the required PHP version to 7.3.
- Updated: Removed deprecated code for loading custom MO files. This should be done via the ‘override_load_textdomain’ filter. See FAQ for more info.
- Updated: Removed league ID from the sorting of the ranking.
- Tweak: Added different admin screen option ‘items per page’ settings for bonus questions and user answers.
- Tweak: Removed the old wp_enqueue_media check for WP versions lower than 3.5 (this is no longer needed).
- Tweak: Fixed some deprecated warnings (tested in PHP 8.1).
- Tweak: Toast on the prediction form now has a default z-index of 10.
- Tweak: Minor changes to the bonus question CSS.
- Bug fix: The countdown shortcode for the first match removed one element of the matches array and this caused trouble for other elements in the plugin that use the same array reference. Thanks @angelo079 for reporting and @shuhads for helping to sort this out.
- Bug fix: Removed duplicate calculation buttons when removing multiple match types at once.
- Bug fix: Fixed the Bonus question pie chart. Thanks @fimo66 for reporting the issue.
2.10.3
- Updated: Changed the match schedule because some matches had the wrong UTC time (last games of the group phase and in the final rounds).
2.10.2
- Updated: Changed the match schedule because the first couple of lines had the wrong year.
2.10.1
- Updated: Changed the match schedule because FIFA changed the Qatar vs. Ecuador match date.
- New: Added a setting to also show the actual result on the prediction form.
- New: Added a setting to be able to disable the ‘unsaved changes check’ on the prediction form.
- New: Shortcode [fp-user-score] now also supports the “use_querystring” parameter.
- New: Added a setting to disable the automatic selection of the logged on user for the compare function in the charts.
2.10.0
- New: Multiple joker support (for the entire pool or per match type). I also renamed the Joker to ‘multiplier’.
- New: Multiplier, bonus question answers and match predictions are now automatically saved via AJAX calls on the front-end (on change). AJAX saves can be disabled via the
FOOTBALLPOOL_FRONTEND_AJAX
constant in the wp-config if you do not like the new asynchronous method. - New: The default delimiter for CSV files (match import) is changed to a comma. If you want to keep using the old delimiter (semicolon), you can override this setting in the wp-config (see help page for details).
- New: If you want to use an alternative date format in a matches CSV file, you can now define constant
FOOTBALLPOOL_CSV_DATE_FORMAT
in your wp-config file. The constant uses the date format convention of PHP’s DateTime object and applies to both import and export files. - New: CLI command ‘football-pool test-data’ that creates test users in your database with random predictions (for testing purposes).
- New: Added support for the WP Personal Data Exporter tool. Users can request to export their personal data which now will also include their Football Pool data (league name, match predictions and bonus question answers).
- New: Added support for the WP Personal Data Eraser tool. When the option is set to true (defaults to false) the plugin will also erase predictions and question answers for a user when using WP’s Personal Data Eraser tool.
- Tweak: Renamed the [fp-scores] shortcode to [fp-match-scores]. Old name is deprecated and will remain available for a couple of versions before I will remove it.
- New: [fp-match-scores] shortcode can now also show the row total via the ‘show_total’ parameter.
- New: [fp-match-scores] shortcode can now also output the user’s prediction per match (instead of or next to the points).
- New: [fp-question-scores] to show a matrix of users and the scores they got on questions (uses same principles as the [fp-match-scores] shortcode for matches).
- New: [fp-last-calc-date] to show the date and time of the last ranking calculation.
- New: Two new admin roles (match editor and question editor).
- New: Bonus question output now also has a filter that can be used in an extension. Also, the code for user view and prediction page is combined into one output function (to get the same HTML structure for the question blocks).
- New: Bonus question statistics view now also has a template that can be overwritten with a filter.
- New: Added ‘joker_used’ indicator to the score history tables.
- New: Added constant
FOOTBALLPOOL_TOP_PLAYERS
that you can set in the wp-config if you want to show a different number of players in the default statistics page (default is 5). - Tweak: Bumped the jQuery version for the TinyMCE dialog to 3.6.0.
- Tweak: Some small additions to the help page.
- Tweak: Updated the icon font that comes with the plugin (also some class names have changed).
- Tweak: Optimized the ranking query for big data sets when selecting ranking for a small league (sub set of users).
- Tweak: Changed all colors in the admin to match the new admin WP 5.7 color palette.
- Tweak: Added floating ‘back to top’ button to all admin pages and a scroll progressbar.
- Tweak: Minor changes to the match table CSS.
- Tweak: Clean up of bonus question CSS.
- Tweak: Added maxWidth and maxHeight to the ColorBox modal that is used for displaying team photos on the front-end.
- Tweak: Question’s answer-before-date is now also localized on the front-end.
- Tweak: Score calculation now throws a fatal error when the default ranking is missing in the database.
- Tweak: Increased the max int sizes for the counter columns in the scorehistory tables.
- Bug fix: Fixed a compatibility problem with the Max Mega Menu plugin (thanks Holger for reporting this).
- Bug fix: User profile page showed the wrong active league for the user.
- Bug fix: Match types could be deleted when there were still matches linked to it. This resulted in orphaned matches in the database. Thanks Andreas Neubrech for reporting this.
- Bug fix: When a logged in user, but not a player in the pool, visited the stats page, then an empty page was shown, instead of the top X players.
- Bug fix: When a logged in user, but not a player in the pool, visited the user page, an incorrect page was shown.
- Bug fix: When score date is automatically filled by the plugin, then the question was not included in the calcution when immediately starting the calculation. Thanks fimo66 for reporting this.
- Bug fix: Fixed some translations. Thanks digiblogger for reporting this.
- Clean-up: I removed all old translation files from the package. Contents of the translation files were imported to the WordPress translation website and can be maintained from there. The POT-file is still available as start point for custom translations, or you can download a PO language file from the translation website.
- Clean-up: I removed the logout widget from the plugin since WordPress comes with its own widget.
2.9.7
- Updated: Prepared the widgets for the new Widget blocks admin that will be introduced in WP 5.8.
- Tweak: Changed the moment when the admin menu gets initiated.
- Bug fix: When a joker is used and activated, the joker icon should be disabled on the form. This did not work when using the date descending sort for matches or when the ‘only open matches’ plugin was activated (thanks Roy te Lindert for reporting).
- Bug fix: In some cases the v2.9.0 db update script was not executed (thanks @potjekak for reporting).
2.9.6
- Bug fix: Flex layout for bonus questions was broken on the user page with a combination of certain settings and linked questions (thanks Frans Jansen for reporting).
- Bug fix: Score date input for bonus questions showed the current date when you saved the form with an empty score date (thanks fimo66 for reporting).
- Tweak: Changed the group standing rules to make it easier to override the sorting manually, because the rules of the UEFA for the UEFA 2020 championship did not match the general rules in the code (thanks af3 for reporting).
2.9.5
- Updated: EURO 2020 schedule.
2.9.4
- Bug fix: Football Pool widgets couldn’t be saved anymore (thanks to dar26ber and Ernst for reporting).
2.9.3
- Tweak: Database optimization for scorehistory table. Retrieving data from the table is now much faster, which should improve the performance of the ranking page, widget and shortcode.
- Tweak: Renamed some indices in the database for more consistency.
- Bug fix: Shoutbox widget not showing an input for new messages for logged in users.
- Bug fix: Plugin labelled some dates in format “Y-m-d H:i:s” as invalid for the import. Check was updated to also support this format (thanks to Kristin for supplying the data that helped me detect this problem).
- Bug fix: Setting the matches sort method to an option with match type first in the plugin options caused a database query to fail. Result was an empty prediction form (thanks to Kristin and sopanstha for identifying and helping to solve this problem).
- Bug fix: Teams class did not declare the comments property.
2.9.2
- Bug fix: Fixed error in the calculation step ‘compute_ranking’. Larger data sets gave a problem in the AJAX JSON handling.
- Bug fix: TinyMCE dialog for adding shortcodes showed only one user-defined ranking in the ranking selector.
- Bug fix: Fixed display of form with shortcode [fp-predictionform] with the use of the match type parameter.
- Tweak: Refactored some code.
2.9.1
- Changed PHP version requirement to PHP 5.6 or higher.
- Tweak: Added “open” or “closed” CSS class to bonus questions to indicate their status.
- Bug fix: The check for joker saves was not working correctly when using invisible match types or the [fp-predictionform] shortcode with only a subset of matches.
- Bug fix: League detection bug in Football_Pool_Pool class constructor.
2.9.0
- New: Added sorting method options for bonus questions.
- Tweak: Updated styling for bonus questions and we now show the admin answer next to the user answer.
- Tweak: Updated the standard styling for the prediction table (classic layout only) a bit to make sure all elements are visible. Still needs to be changed to match your theme’s layout.
- Bug fix: Option “user_page_show_predictions_only” did not work for bonus questions (‘Undefined index: answer’).
- Bug fix: Option “user_page_show_correct_question_answer” did not work for linked bonus questions.
- Bug fix: ‘Undefined index: league_id’ warning on the ranking page when switching between leagues enabled and leagues disabled without doing a recalculation.
- Bug fix: Fixed the “An active PHP session was detected” warning in the Site Health scan (thanks fimo66 for reporting).
- Bug fix: User predictions table showed a zero in the score column for users that did not have a prediction when option “Always show predictions” is enabled (should be left blank).
- Bug fix: CLI command ‘import’ failed with an error in test mode when a match id was not found.
earlier versions
- Full changelog can be found here.