WP Manifestindependent plugin directory
manifest / integrations / remote-data-blocks-livetennis

Live Tennis snapshots for Remote Data Blocks

Periodic tennis score snapshots for WordPress Remote Data Blocks

by livetennisapi · github.com/livetennisapi/remote-data-blocks-livetennis

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/livetennisapi/remote-data-blocks-livetennis/archive/refs/heads/main.zip

Tennis score snapshots for Remote Data Blocks

A standalone WordPress plugin maintained by Live Tennis API. It adds a Tennis score snapshot block to Remote Data Blocks. Choose a match in the editor, then bind its player names, tournament, score, server, snapshot time and status to ordinary WordPress text blocks.

This is a periodic snapshot. Updates happen on page or editor requests, at most once every 15 minutes. It is not a point-by-point live scoreboard.

Install

Requires PHP 8.1+, WordPress 6.7+, and Remote Data Blocks 1.8.0+.

  1. Install and activate Remote Data Blocks.

  2. Download remote-data-blocks-livetennis.zip from this repository's releases. Upload it through Plugins → Add New → Upload Plugin, then activate it.

  3. Supply a dedicated free Live Tennis API key on the server. Set the LIVETENNIS_API_KEY environment variable, or add this before the “stop editing” line in wp-config.php:

    define( 'LIVETENNIS_API_KEY', 'your-key-here' );
  4. In the block editor, insert Tennis score snapshot, then Select items and choose a match. Click Choose a pattern and select Tennis score snapshot Data. This default layout includes the Snapshot and Status fields; keep those visible alongside the score when customizing it.

The block registers only when the dependency and key are present. Keys are used only in server-side HTTPS request headers. They are not stored in posts, query configuration, snapshot options or browser requests.

Free-tier behavior

  • Uses only GET /matches?status=live&limit=200, which works on a free key.
  • Selection, rendering, multiple blocks, and all sites in a WordPress multisite network share one snapshot per key.
  • A database reservation is made before each HTTP request. Every attempt, including timeouts and invalid responses, reserves at least 900 seconds: 86,400 ÷ 900 = at most 96 requests/day for this installation.
  • This limit works without persistent object caching and under concurrent PHP requests. It has no setting that can shorten it. A longer Retry-After on HTTP 429 or 503 extends it.
  • Only the first 200 live matches are offered. There is no automatic pagination, match-detail request, rankings request or historical-results request.

Use the key only for this installation. Requests from other sites, applications or manual tools consume the same API allowance and are outside this plugin's budget. Clearing its rdb_lta_* database options or rotating WordPress salts resets the local reservation; do not do that to force a refresh.

Null or malformed scores display as unavailable. Set scores retain the API's player-major ordering, and tie-break points are labelled. A match that leaves the live list displays an explicit unavailable state; this plugin does not infer a winner or fetch paid historical results. API failures replace the visible score with an unavailable state rather than presenting an old score as current.

The displayed time is when WordPress fetched the snapshot, not when a point was played. A full-page/CDN cache can make the page older still; its cache policy is separate from the API request limit.

Development and verification

Install Composer, Node.js 20+ and Docker with Compose, then run:

composer install
npm ci
npm run env:start
npm test
npm run test:multisite
npm run lint
npm run zip
npm run env:stop

The pinned development environment uses WordPress 6.7.4, PHP 8.1 and Remote Data Blocks 1.8.0. Tests run PHPUnit inside real WordPress with a database and intercept the WordPress HTTP API with synthetic fixtures. They need no API key and make no Live Tennis API requests. The distributable ZIP contains only plugin code, documentation and the licence; development dependencies are excluded.

No validation against a live API key is claimed. The response contract is checked against the published OpenAPI specification.

Contributing

Small, tested pull requests are welcome. Describe the behavior and checks you ran. Keep the persistent request budget, server-side credential handling, and explicit unavailable states intact. Never commit API keys or private site configuration. Contributions are licensed GPL-2.0-or-later.