Skip to content

Conversation

@pfefferle
Copy link
Member

@pfefferle pfefferle commented Dec 4, 2025

Proposed changes:

  • Add new site health check to detect when DISABLE_WP_CRON constant is enabled
  • Warn administrators that this may cause delays in ActivityPub publishing and reactions
  • Provide guidance on proper system cron setup as an alternative
  • Include link to WordPress documentation for setting up system cron

This PR is the result of a support case on Mastodon.

Other information:

  • Have you written new tests for your changes, if applicable?

N/A - Site health check addition, would require testing environment with DISABLE_WP_CRON enabled

Testing instructions:

To test the warning state:

  1. Add define( 'DISABLE_WP_CRON', true ); to your wp-config.php
  2. Go to Tools > Site Health in WordPress admin
  3. Click on the Info tab, then ActivityPub section
  4. Verify you see an orange "recommended" warning about WP-Cron being disabled
  5. Check that the warning message explains:
    • That DISABLE_WP_CRON is enabled
    • Potential impacts on ActivityPub (delays in publishing/reactions)
    • That system cron is acceptable if configured properly
    • Link to WordPress documentation on system cron setup

To test the good state:

  1. Remove DISABLE_WP_CRON from wp-config.php (or set to false)
  2. Go to Tools > Site Health
  3. Verify you see a green "good" status for WP-Cron configuration

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Add site health check to warn when DISABLE_WP_CRON may impact ActivityPub functionality

Add a new health check to warn site administrators when the DISABLE_WP_CRON constant is enabled. While it's acceptable to use a system cron to call wp-cron.php, having WP-Cron completely disabled can cause delays in:
- Publishing posts to the fediverse
- Processing reactions (likes, boosts, replies)
- Other scheduled ActivityPub tasks

The health check:
- Shows as "good" when WP-Cron is enabled (default)
- Shows as "recommended" warning when DISABLE_WP_CRON is true
- Provides clear explanation of potential impacts
- Includes link to WordPress documentation on setting up system cron
- Suggests running system cron every 1-5 minutes for optimal performance
Copilot AI review requested due to automatic review settings December 4, 2025 08:00
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new site health check to detect when WordPress's built-in cron system is disabled via the DISABLE_WP_CRON constant, which can impact ActivityPub's ability to publish posts and process reactions in a timely manner.

Key changes:

  • New site health test that warns administrators when DISABLE_WP_CRON is enabled
  • Provides guidance on proper system cron configuration as an alternative
  • Includes documentation link for setting up system cron

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
includes/wp-admin/class-health-check.php Adds test_wp_cron() method and registers it as a site health check to detect and warn about disabled WP-Cron
.github/changelog/2583-from-description Changelog entry documenting the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pfefferle pfefferle self-assigned this Dec 4, 2025
@pfefferle pfefferle requested a review from obenland December 4, 2025 08:03
@pfefferle pfefferle requested a review from obenland December 4, 2025 15:27
@pfefferle pfefferle merged commit c56e9cd into trunk Dec 5, 2025
10 checks passed
@pfefferle pfefferle deleted the enhancement/wp-cron-health-check branch December 5, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants