=== AnWP Football Leagues ===
Contributors:      anwppro
Donate link:       https://anwppro.userecho.com/communities/1-football-leagues
Tags:              football, soccer, sport
Requires at least: 5.9
Requires PHP:      7.4
Tested up to:      7.0
Stable tag:        0.18.1
License:           GPLv3
License URI:       https://www.gnu.org/licenses/gpl-3.0.html

A complete solution for any football site. Knockout and round-robin competitions, player profiles and statistics, squads, standings and stadiums.

== Description ==
A complete solution for any &#9917; football site. Has a variety of unique features, powerful and flexible. Made with football in mind.

&#9193; For other team sports (&#127945; rugby, &#127936; basketball, &#127952; volleyball, &#127951; cricket, &#9918; baseball, &#127954; ice hockey, handball) use my another plugin - [Sports Leagues](https://wordpress.org/plugins/sports-leagues/)

= BASIC FEATURES =
&#9989; intuitive admin UI
&#9989; knockout, round-robin or even mixed and multistaged Competition supported
&#9989; separate Club squad for every season (with player position, number, status)
&#9989; Match lineups, substitutes, stats, events (goals, cards, substitute, penalty shootout), video, staff, referees
&#9989; automatic Standing calculation (or manual)
&#9989; automatic Player statistic calculation based on Match events (playing time, goals, cards, etc.)
&#9989; initial data import for Clubs and Players with Excel-like spreadsheet
&#9989; custom colors in Standing table (for Clubs or places)
&#9989; flipped countdown timer for upcoming Matches
&#9989; initial points (+ or -) for Clubs in Standing table
&#9989; statistics at Player profile page
&#9989; stadiums with photo, gallery, additional information, map, matches
&#9989; widgets: Clubs, Matches, Cards, Next match, Player, Players (scorers or assistants), Standing table, Birthdays
&#9989; 16 different shortcodes with UI helper in Classic Editor
&#9989; template system (ability to override output layouts in your theme)
&#9989; RTL support
&#9989; works with most themes out of the box
&#9989; fully translatable from the Admin part
&#9989; tons of hooks for developers
&#9989; staff, referees, coaches, stadiums and much more ...

= LINKS AND DOCUMENTATION =

[Plugin Demo](https://fl-core.anwp.pro/) | [Plugin Overview](https://anwp.pro/the-most-powerfull-football-soccer-wordpress-plugin/)
[Online Documentation](https://anwppro.userecho.com/communities/1-football-leagues#module_9) | [Start Guide](https://anwppro.userecho.com/knowledge-bases/2/articles/70-start-guide) | [Extended Changelog](https://anwppro.userecho.com/knowledge-bases/11-fl-changelog/categories/28-basic-version/articles) | [Available Shortcodes](https://anwppro.userecho.com/knowledge-bases/2-football-leagues/categories/25-shortcodes/articles)

= PREMIUM VERSION AVAILABLE =
Want more? Football Leagues has also a [Premium Addon](https://anwp.pro/football-leagues-premium/) with many outstanding and unique features.

[Premium Demo](https://fl-premium.anwp.pro/) | [Real Website Example](https://footballan.com/)

= PREMIUM FEATURES =
&#128310; Live Scores and Match Live Commentary with Events
&#128310; Match Timeline
&#128310; LIVE Search
&#128310; Club match formation
&#128310; Layout Builder (with tabs)
&#128310; Match scoreboard with image background
&#128310; Tournament Bracket
&#128310; Commentary Match section with new events
&#128310; Head to Head matches section in Match
&#128310; import data from external APIs (required a valid subscription)
&#128310; Standing – manual data edit
&#128310; Standing – columns order and visibility
&#128310; Standing – Conference support
&#128310; Standing – more ranking rules
&#128310; Matches Horizontal Scoreboard (shortcode)
&#128310; Competition – matchweeks as slides
&#128310; Results Matrix
&#128310; Standing Arrows – Dynamics of Ranking changes
&#128310; Widget – Next match extended (timer or flipped countdown)
&#128310; Widget – Competition Matchweek slides
&#128310; Widget – Calendar
&#128310; Calendar Slider
&#128310; Card Suspension
&#128310; Transfers
&#128310; [Dynamic SEO Options](https://anwp.pro/seo-options-in-layout-builder-title-and-description/)
&#128310; Send Game Report by Email
&#128310; [Automatic User's Timezone](https://anwp.pro/docs/football-leagues/pro-features/user-timezone/)
&#128310; [AI Match Reports](https://anwp.pro/docs/football-leagues/pro-features/ai-writer/)
&#128310; [Club History](https://anwp.pro/docs/football-leagues/pro-features/club-history-historical-logos-names/) – Historical logos and names
&#128310; [Entity Links](https://anwp.pro/docs/football-leagues/pro-features/entity-links/) – Custom links for clubs, players, and more
&#128310; Advanced Statistics
&#128310; Charts: Team Default Statistics & Goals per 15 min. interval
&#128310; Player stats section in Club
&#128310; Player & Referee stats panel
&#128310; 24 different shortcodes
&#128310; premium support

[Find Out more about Premium Version](https://anwp.pro/football-leagues-premium/)
[Plugin Overview](https://anwp.pro/the-most-powerfull-football-soccer-wordpress-plugin/)

= Translations included =
* English - default, always included
* Russian: Русский
* Polish: Polski (thanks to @forzza)
* Danish: Denmark (thanks to @cbdk)
* French: thanks to @belgofoot
* Italian: thanks to Paolo
* Slovenian: thanks to Nejc
* Romanian: thanks to Gabriel
* German: thanks to Jörg and Sven
* Greek: thanks to spirossm
* Spain: thanks to Màxim
* Brazil (Portuguese): thanks to Marcelo
* Dutch: thanks to Patrick

= The plugin requires =
> PHP version 5.6 or greater
> WordPress 4.7 or greater
> [CMB2 plugin](https://wordpress.org/plugins/cmb2/ "CMB2")

== Installation ==

= Minimum Requirements =

* PHP version 7.0 or greater (PHP 8.1 or greater is recommended)
* WordPress 4.7+
* Enabled WordPress Rest API

= Installation =
1. Go to Plugins >> Add new
1. Type "Football Leagues" in Search Plugins box.
1. Click Install Now to install the "Football Leagues by AnWP.pro".
1. If successful, click Activate Plugin to activate it.
1. Install required CMB2 plugin. [CMB2](https://wordpress.org/plugins/cmb2/ "CMB2")
1. Follow "Quick start guide" (Admin >> Football Leagues >> Tutorials) to setup the plugin.

== Frequently Asked Questions ==

= Will Football Leagues plugin work with my theme? =

Yes! The plugin works with most themes out of the box. If you have any CSS styling issues feel free to ask for help.

== Screenshots ==

1. Standing Table
2. Admin >> Competition Edit page
3. Club Page
4. Player Page
5. Knockout competition
6. Finished match
7. Upcoming match
8. Stadium Page
9. Coach (staff)
10. Widget >> Next Match
11. Widget >> Cards
12. Widget >> Standing table
13. Admin >> Assign clubs to the Competition group
14. Admin >> Edit Club (squad)
15. Admin >> Edit Match
16. Admin >> Edit Match (LineUps and Substitutes)
17. Admin >> Edit Match (Events)

== Changelog ==

= 0.18.1 - 2026-06-19 =
* Fix - Editing a club from the posts list (Quick Edit or Bulk Edit) no longer clears its saved details on sites migrated to the new clubs table
* Fix - Club editor - custom fields, social links, and shirt data can now be added to clubs that previously had none (a script error blocked the input fields)
* Fix - Squad player number missing in the match lineup editor when it was set only on the Active Squad roster (not on the season archive)
* Fix - Club Nationality set to "N/C America" or "South America" no longer goes blank on save (the database field was too short for those region codes); affected teams are restored automatically on update
* Fix - Coaches saved under a specific season in the club squad were missing from the match editor "Select Coach" list when the Active Staff list was empty
* Add - New "cache" attribute for the [anwpfl-matches] shortcode caches its output, so match lists shown on every page (footer, sidebar) skip repeated database queries
* Fix - Accessibility improvements for public output - better screen reader and accessibility-tree support

= 0.18.0 - 2026-05-27 =
* Performance - Clubs, competitions, standings, and squads moved from postmeta to dedicated database tables for faster page loads and better long-term maintainability
* Fix - Shortcode spacing, display, and text alignment utilities now reliably override theme styles (notably Kadence's `.entry-content` rules)
* Fix - Club, referee, and entity links built via the simple link building fast path now resolve correctly on WordPress installs in a subdirectory
* Performance - Faster sitemap generation for large sites with many matches and players
* Fix - Shortcode modal in Classic Editor missing styles
* Fix - Substitution batch import column mapping for player in/out fields
* Fix - Club card statistics counting extra yellow cards from second-yellow-to-red events
* New Feature - Active Roster - clubs now have ONE current squad you can edit without picking a season. Historical seasons live in a separate Season Squad Archive (append, replace, or clear past rosters from the same screen). [anwpfl-squad] without `season_id` renders the active roster; with `season_id` renders that season's archive.
* Add - Cleanup tab in Toolbox to remove old club and squad postmeta after migration to the new clubs table
* Update - Club season dropdown filter now derives seasons purely from match data - clubs with squad-only season data (no matches yet) will drop from the filter, add a match or assign the club to the filter manually
* Add - Custom title and value fields in club CSV import (Data Import tool)
* Fix - WordPress 7.0 admin compatibility - button icon alignment and modal dialog stacking (Shortcode Builder, FL Selector)
* Update - Tested with WordPress 7.0.

= 0.17.2 - 2026-02-06 =
* Fix - Import tool now correctly maps pasted team/country/position names to IDs

= 0.17.1 - 2026-01-22 =
* Fix - Some SVG icons not displaying correctly

= 0.17.0 - 2026-01-20 =
* Update - Shortcode Builder with collapsible sections and modern field layout
* Add - Live preview panel in Shortcode Builder with width toggle
* Add - Parse existing shortcode to populate form fields
* Update - Admin menu reorganization
* Update - Improved Data Import tool with batch mode for match events and better UX

= 0.16.19 - 2025-08-30 =
* Add - FL Selector date field on Match search
* Fix - Minor fixes

= 0.16.18 - 2025-08-11 =
* Fix - FL Selector problem with non-Latin characters in Search field
* Update - Accessibility improvements

= 0.16.17 - 2025-07-26 =
* Add - New version of FL Selector

= 0.16.16.1 - 2025-06-03 =
* Fix - Squad table-rows layout in mobile view

= 0.16.16 - 2025-06-03 =
* Add - Option in Squad to show/hide age/birth date/nationality (Customizer > Football Leagues > Squad)
* Update - Plugin caching system with object cache support and automatic detection
* Performance - Minor performance improvements
* Update - Syria flag (rounded flags)
* Update - Game Edit custom numbers auto-fill on adding player to lineups

= 0.16.15 - 2025-05-08 =
* Add - New option Simple Permalink Slug Building (BETA)
* Performance - Minor performance improvements

= 0.16.14 - 2025-03-24 =
* Add - Tool to update player's Current Team based on the last game played
* Add - Option to show player's current team by last game with save/fix in Player Profile
* Add - Customizer option to change default home/away team colors in statistics

= 0.16.13 - 2025-02-26 =
* Add - New Gutenberg block FL Games

= 0.16.12 - 2025-01-27 =
* Update - Game Substitutes improved in mobile view
* Add - Filters on selecting a league in the Competition edit page
* Fix - Incorrect and duplicated Competition title (secondary stage) in the Game header

= 0.16.11 - 2024-12-09 =
* Add - Player All Season with season combine options if many seasons
* Fix - Duplicated stage title
* Fix - Game team stats with 0 is not shown
* Fix - Not finished games affect player statistics
* Fix - Data Import error on Player update with custom fields only
* Update - Game outcome label (highlighted score)
* Add - Red card in game slim layout (right after team name)
* Add - Staff Current Team display options (by value, hide, last game)
* Update - Cards Shortcode added support for several club IDs in club_id argument
* Update - Player Statistics removed zeros for better readability

= 0.16.10 - 2024-10-31 =
* Fix - Inline search on Standing Setup in Select Competition Group
* Add - Admin Club players per page option in Attach Player to Squad

= 0.16.9 - 2024-10-25 =
* Add - Custom squad status
* Fix - Safari 18 conflict with WordPress classic editor layout

= 0.16.8 - 2024-09-18 =
* Fix - Security fix
* Fix - Minor fixes

= 0.16.7 - 2024-08-22 =
* Add - New admin Competition UI
* Add - Possibility to fix incorrect status (official/friendly) of the games
* Update - Admin UI code has been rewritten

= 0.16.6 - 2024-06-12 =
* Add - New Gutenberg Block Cards (based on Cards shortcode)
* Fix - Minor fixes

= 0.16.5 - 2024-04-30 =
* Add - Option to hide migration notice

= 0.16.4 - 2024-04-10 =
* Fix - Game list footer show penalties scores if extra time is not set
* Fix - Updated Twitter icon in Player and Club profile
* Fix - Referee saving on Data Import tool
* Add - Option to show Player's Current Club based on the last game (Customizer >> Football Leagues >> Player & Staff)

= 0.16.3 - 2024-02-20 =
* Fix - Game Edit admin show save button on mobile
* Fix - Game status penalties if extra time is not set
* Fix - Errors in Game Missed Penalties
* Fix - Lineup data migration of non-existent games (removed)
* Fix - Show multiple player nationalities in Squad section and Players shortcode

= 0.16.2 - 2024-02-09 =
* Fix - Problem with rendering default player photo on Birthdays
* Fix - Problem with rendering player's age in the Player Header
* Update - Migration process added possibility to show subtask IDs and skip current subtask ID
* Fix - Colors in the circle flag of Kazakhstan

= 0.16.1 - 2024-02-08 =
* Fix - Migration issues with too long lineups
* Fix - Migration problem with too long events list
* Fix - Incorrect referee's games rendering on the Referee Page
* Fix - Missing temp players in the game lineups
* Fix - Date of death incorrectly calculated in some cases

= 0.16.0 - 2024-02-06 =
* Add - New database structure (migration process required to complete the update)
* Update - Increased minimal version to PHP 7.0
* Performance - Performance improvements
* Add - New circle flags from HatScripts/circle-flags
* Update - Data Import tool
* Update - Moved player metadata from postmeta to new player_data table
* Update - Moved games metadata from postmeta to matches table
* Update - Moved lineups from postmeta to the new lineups table

== Upgrade Notice ==

= 0.16.13 =
Added new Gutenberg block - FL Games + minor fixes.
