Linux 软件免费装
Banner图

Cronheart

开发者 cronheart
更新时间 2026年6月20日 15:05
PHP版本: 8.2 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

cron monitoring wp-cron healthcheck deadman-switch

下载

0.1.9 0.2.1 0.3.0 0.4.0

详情介绍:

WP-Cron is request-driven. On a low-traffic site no requests arrive, no events fire, and a scheduled backup can be stalled for weeks before anyone notices. Uptime monitors do not catch this — the site responds to HTTPS just fine, it just is not running its jobs. Cronheart turns WP-Cron into a dead-man switch: the plugin pings cronheart.com every five minutes and on every individual event you register. If the pings stop, cronheart alerts you via email, Telegram, Slack, Discord, or a custom webhook. What it does Never breaks WP-Cron The plugin's hard contract: a broken cronheart backend, an unreachable network, a misbehaving PSR-18 HTTP client — none of them may cause WP-Cron to fail. Every network / HTTP error is swallowed into a logged warning. If cronheart goes down for a day, your wp_schedule_event callbacks still run normally; you just stop seeing pings on the dashboard. External services This plugin sends HTTP requests to cronheart.com in two distinct situations: the monitoring pings your scheduled jobs send, and the account-management calls the admin settings page makes. Both are opt-in: without configuration the plugin loads and does nothing — no telemetry, no usage statistics, no anonymous reports. 1. Monitoring pings (front end / WP-Cron). Sent on every scheduled WP-Cron run, but only when you supply a monitor UUID. The exact data sent per ping: 2. Account management (wp-admin only). When — and only when — you save a cronheart.com API token, the Cronheart admin screens (Settings → Cronheart and Settings → Cronheart Events) talk to the cronheart.com management API at https://cronheart.com/api/v1/.... Every such request carries the token as an Authorization: Bearer header and runs only while a logged-in administrator is on one of those screens — and, for the write actions below, only when that administrator clicks the control. Never on the front end, during WP-Cron, or in any other context. No token, no request. The calls are: The lifecycle and create calls are the only requests that change anything on cronheart.com, and each is one deliberate click. The token is optional: without it the plugin makes none of these management calls — you assign monitors by hand (or via the constants / helper) and only the monitoring pings above are ever sent. Cronheart.com Terms of Service · Privacy policy Open source Source code and issue tracker: github.com/alexander-po/cronheart-wp. The plugin wraps the cron-monitor/php-sdk PHP package (also open source, MIT-licensed). Both projects are maintained independently.

安装:

  1. Install the plugin: WP Admin → Plugins → Add New → search for "Cronheart" → Install Now → Activate. Or upload cronheart.zip from a GitHub release.
  2. Sign up at cronheart.com and create a monitor for your site's heartbeat. Copy the monitor UUID from the dashboard.
  3. Configure the UUID. Either add it to wp-config.php with define( 'CRONHEART_HEARTBEAT_UUID', 'xxxxxxxx-…' ); (recommended), or paste it under Settings → Cronheart in the WP admin.
  4. Done. Within five minutes you should see the first heartbeat ping on the cronheart dashboard.
  5. (Optional) To choose a monitor from a dropdown instead of pasting its UUID, create a Personal Access Token at cronheart.com (Settings → API Tokens) and save it under Settings → Cronheart. API access requires a Starter plan or higher; the plugin works fully on the free tier without a token. For production, prefer define( 'CRONHEART_API_TOKEN', 'cmk_…' ); in wp-config.php to keep the account credential out of the database.
For per-event monitoring (a specific scheduled hook, not just the site heartbeat), register the hook from a plugin / theme / mu-plugin: add_action( 'plugins_loaded', function () { cronheart_monitor( 'my_nightly_report', 'xxxxxxxx-…' ); }, 1 ); The hook then emits start / success (or fail on a fatal / thrown exception) pings on every scheduled run.

屏幕截图:

  • The "Your monitors" table on the settings page — each monitor's status and any active snooze, with pause, resume, snooze, and unsnooze actions applied straight to cronheart.com.
  • The Cronheart Events screen — the site's recurring WP-Cron events, each with a dropdown to assign a monitor or an "Auto-create & assign" button.

升级注意事项:

0.4.0 Adds a Cronheart Events screen to assign or auto-create monitors for your recurring WP-Cron events from wp-admin — no code needed. Same admin-AJAX safety as 0.3.0; the constants and helper still work and take precedence. No token required; the runtime ping path is unchanged. Safe to upgrade. 0.3.0 Adds an account/plan card and a "Your monitors" table to pause, resume, snooze, or unsnooze monitors from wp-admin — the plugin's first admin-AJAX endpoint, nonce- and capability-gated. No token required; the runtime ping path is unchanged. Safe to upgrade. 0.2.1 Documentation + screenshot refresh for the 0.2.0 monitor picker. No code change. Safe to upgrade. 0.2.0 Adds an optional monitor picker: save a cronheart.com API token and choose your heartbeat monitor from a dropdown instead of pasting a UUID. No token required — manual UUID entry works exactly as before. The runtime ping path is unchanged. Safe to upgrade. 0.1.9 Plugin Directory review round 2 metadata fix (Contributors set to the slug owner). No code changes. Safe to upgrade. 0.1.8 "Tested up to" bump to 7.0. No code changes. Safe to upgrade. 0.1.7 Restored Terms / Privacy links with the correct URLs (cronheart.com/terms and /privacy). No code changes. 0.1.6 Plugin Directory review round 1 metadata fixes. No code changes. Safe to upgrade. 0.1.5 "Tested up to" bump to 6.9. No code changes. Safe to upgrade. 0.1.4 Pre-submission cleanup only — no behaviour changes. Safe to upgrade. 0.1.3 WordPress.org Plugin Check fixes only — no behaviour changes. Safe to upgrade. 0.1.2 WordPress.org metadata polish only. Safe to upgrade. 0.1.1 Adds opt-in endpoint override. Existing installs are unaffected — the default endpoint remains https://cronheart.com.

常见问题:

Does this work when WP-Cron is disabled (system-cron mode)?

Yes. If you set define( 'DISABLE_WP_CRON', true ); and trigger wp-cron.php from a real system cron, the plugin's heartbeat_tick action still fires on each run — the trigger mechanism is different, the action chain is the same.

What if my host blocks outgoing HTTPS?

The plugin will retry once (built-in retry budget) and then log a warning to debug.log. Your scheduled callbacks still run normally — the plugin never raises an exception that could break the cron runner. To diagnose, check wp-content/debug.log for entries beginning with "cron-monitor".

Do I need a paid cronheart.com account?

No. Cronheart's free tier covers 20 monitors per account — enough for a typical site's heartbeat plus several per-event monitors. Paid tiers (Starter / Growth / Scale) raise the cap and unlock additional notification channels.

Do I need an API token?

No — it is entirely optional. Paste a monitor UUID under Settings → Cronheart (or define it in wp-config.php) and the plugin works on any plan, including the free tier. A token only adds convenience: the settings page can then list your monitors and let you pick one from a dropdown instead of copying a UUID by hand. The token is an account-level credential, so for production prefer defining CRONHEART_API_TOKEN in wp-config.php over storing it in the database. The picker (API access) requires a Starter plan or higher; if your plan does not include it the page shows a notice and falls back to manual UUID entry.

Where do I find my monitor UUID?

Sign in at cronheart.com, open the monitor you created, and copy the UUID from the address bar or the "Ping URL" block on the monitor page.

What happens to my scheduled jobs if cronheart.com is unreachable?

Nothing. The plugin catches every network / HTTP error from the SDK and logs a warning — your wp_schedule_event callbacks continue to run. You will stop seeing pings on the cronheart dashboard, and after the configured grace period cronheart sends you the down-alert. When cronheart comes back the next successful ping resolves the incident automatically.

Does the plugin track or report anything about my site?

No. The plugin sends a ping to cronheart only when you have configured a monitor UUID. The ping payload is the UUID, an optional short body excerpt (capped at 10 KB), and the SDK's User-Agent header. There is no anonymous-statistics beacon, no plugin-usage telemetry, no calls to any third-party analytics service.

Can I point the plugin at a non-production cronheart deployment (staging / private / self-hosted)?

Yes. Define CRONHEART_ENDPOINT in wp-config.php with the URL of your alternate deployment. For plain http:// endpoints (local development, private VPNs without TLS) also set CRONHEART_ALLOW_INSECURE_ENDPOINT to true. With both unset, the plugin pings the production cronheart.com over HTTPS.

Where can I report bugs or request features?

Open an issue on GitHub.

更新日志:

0.4.0 0.3.0 0.2.1 0.2.0 0.1.9 0.1.8 0.1.7 0.1.6 0.1.5 0.1.4 0.1.3 0.1.2 0.1.1 0.1.0