WP Manifestindependent plugin directory
manifest / integrations / rescuetime-block

RescueTime

Display your RescueTime productivity data in the WordPress admin dashboard with interactive charts.

by Seth Miller · github.com/flexseth/rescuetime-block · 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/flexseth/rescuetime-block/archive/refs/heads/main.zip

Readme

RescueTime for WordPress

Display your RescueTime productivity data in the WordPress admin dashboard with interactive charts.

Features

  • Dashboard widget — Bar chart (time by hour), donut chart (productivity pulse), and top category breakdown
  • Settings page — Securely store and test your RescueTime API key
  • REST API proxy — All API calls are server-side, keeping your key hidden from the browser
  • Caching — 15-minute transient caching to reduce API calls
  • Graceful error handling — Clear messages when the key is missing, invalid, or the API is unreachable

Requirements

  • WordPress 6.4+
  • PHP 7.4+
  • A RescueTime account and API key

Installation

  1. Clone or download this repository into wp-content/plugins/rescuetime
  2. Run npm install && npm run build
  3. Activate the plugin in WordPress
  4. Go to Settings → RescueTime and enter your API key

Generate an API key at rescuetime.com/anapi/manage.

Architecture

Code Structure

  • Procedural PHP — All PHP code uses functions with rescuetime_ prefix (no classes)
  • Server-side proxy — API key never exposed to the browser; all RescueTime API calls happen server-side
  • Transient caching — 15-minute cache on all API responses to minimize external requests
  • WordPress APIs — Uses Options API for settings, Transients API for caching, REST API for endpoints

Key Files

  • rescuetime.php — Plugin header and initialization
  • includes/rescuetime-bootstrap.php — Core setup and hooks
  • includes/rescuetime-admin.php — Settings page UI
  • includes/rescuetime-options.php — Settings save/test/remove handlers
  • includes/rescuetime-rest.php — REST API endpoint registration
  • includes/rescuetime-api.php — RescueTime API client functions
  • includes/rescuetime-widget.php — Dashboard widget registration and rendering
  • src/admin/ — JavaScript and CSS source files
  • assets/ — Compiled production assets

Security

  • API key stored via WordPress Options API
  • Nonces on all admin actions
  • Capability checks (manage_options) on settings and widget
  • Server-side validation and sanitization
  • Masked API key display (shows last 4 characters only)

Development

npm install
npm run start   # Watch mode
npm run build   # Production build

Testing Checklist

  1. Plugin activates without errors
  2. Settings page: save, test, and remove API key functionality
  3. Dashboard widget: charts render with valid key
  4. Dashboard widget: fallback states work (no key, API errors, network failures)
  5. REST endpoints return correct data with authentication
  6. REST endpoints return 401 without valid key
  7. Uninstall removes all options and transients

License

GPLv2 or later — see https://www.gnu.org/licenses/gpl-2.0.html

Read the full README on GitHub →