WP Odds Tracker
A WordPress plugin that displays live football odds and scores with custom crawler logic
by Your Name · github.com/seavmey-yem/wp-odds-tracker · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/seavmey-yem/wp-odds-tracker/archive/refs/heads/main.zipA WordPress plugin that displays live football odds and scores with custom crawler logic.
Features
- Live Football Odds Display: Shows match information including teams, scores, odds, and status
- Filtering & Sorting: Filter by league, date, or team name; sort by match time
- Auto-refresh: Automatically updates data every 30 seconds via AJAX
- Admin Settings: Configure data source, refresh interval, and more
- REST API: Access match data via REST endpoints
- Widget: Display upcoming matches in a sidebar widget
- Responsive Design: Works on all device sizes
- Dark Mode Support: Automatically adapts to system preferences
Installation
- Download the plugin as a ZIP file
- In WordPress admin, go to Plugins > Add New
- Click Upload Plugin and select the ZIP file
- Install and activate the plugin
- Configure settings in WP Odds Tracker admin menu
Usage
Shortcode
Display a football scoreboard with the shortcode:
[wpot_scoreboard]
Shortcode Parameters
date: Filter by date (today, tomorrow, or specific date in YYYY-MM-DD format)
league: Filter by league name
search: Search for specific team names
sort: Sort by time (asc or desc)
Examples
// Display today's matches
[wpot_scoreboard]
// Display tomorrow's Premier League matches
[wpot_scoreboard date="tomorrow" league="Premier League"]
// Display matches for a specific date, sorted by time
[wpot_scoreboard date="2023-12-25" sort="desc"]
REST API
Access match data via REST API endpoints:GET /wp-json/wpot/v1/matches
Parameters
date: Filter by date (today, tomorrow, or specific date)
league: Filter by league name
search: Search for team names
sort: Sort by time (asc or desc)
Examples
# Get today's matches
curl https://example.com/wp-json/wpot/v1/matches?date=today
# Get Premier League matches
curl https://example.com/wp-json/wpot/v1/matches?league=Premier%20League
# Search for matches involving a specific team
curl https://example.com/wp-json/wpot/v1/matches?search=Manchester
Data Source URL: The URL to crawl for data (default: oddsportal.com)
Auto-refresh Interval: How often to refresh data (default: 30 seconds)
Max Number of Matches: Maximum matches to display (default: 50)
League Whitelist: Comma-separated list of leagues to include
Enable REST API: Toggle REST API endpoints on/off
Data Management
Test Crawler: Manually test the data crawling functionality
Clear Cache: Clear the cached match data
Plugin Status: View last update time, cached matches count, and errors
Technical Details
//Data Flow
The crawler fetches data from the configured source
Data is parsed and normalized into a consistent format
Data is cached using WordPress transients
The shortcode retrieves cached data and displays it
The REST API provides access to the data for external applications
//Security
All user inputs are sanitized and escaped
Nonces are used for AJAX requests
Capability checks ensure only authorized users can access admin functions
Performance
Data is cached to minimize external requests
AJAX updates avoid full page reloads
Efficient database queries using WordPress options API
Requirements
WordPress 5.0 or higher
PHP 7.0 or higher
License
This plugin is licensed under the GPL v2 or later.
Support
For support, please visit the plugin's support forum on WordPress.org.
## Installation Instructions
1. Create a new folder in your WordPress plugins directory called `wp-odds-tracker`
2. Create all the files as described above in their respective directories
3. Zip the entire `wp-odds-tracker` folder
4. In your WordPress admin, go to Plugins > Add New > Upload Plugin
5. Upload the zip file and activate the plugin
6. Use the shortcode `[wpot_scoreboard]` on any page or post to display the football odds tracker
The plugin will now display a fully functional football odds tracker with filtering, sorting, and auto-refresh capabilities. The interface will match the screenshots you provided, with a clean, modern design that works on both desktop and mobile devices.