You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -539,4 +544,44 @@ function ( $plugin_file ) use ( $all_plugins ) {
539
544
540
545
return$result;
541
546
}
547
+
548
+
/**
549
+
* WP-Cron configuration test.
550
+
*
551
+
* @return array The test result.
552
+
*/
553
+
publicstaticfunctiontest_wp_cron() {
554
+
$result = array(
555
+
'label' => \__( 'WP-Cron is properly configured', 'activitypub' ),
556
+
'status' => 'good',
557
+
'badge' => array(
558
+
'label' => \__( 'ActivityPub', 'activitypub' ),
559
+
'color' => 'green',
560
+
),
561
+
'description' => \sprintf(
562
+
'<p>%s</p>',
563
+
\__( 'Your WP-Cron configuration allows for timely publishing and processing of ActivityPub activities.', 'activitypub' )
564
+
),
565
+
'actions' => '',
566
+
'test' => 'test_wp_cron',
567
+
);
568
+
569
+
if ( defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ) {
570
+
$result['status'] = 'recommended';
571
+
$result['label'] = \__( 'WP-Cron is disabled', 'activitypub' );
572
+
$result['badge']['color'] = 'orange';
573
+
$result['description'] = \sprintf(
574
+
'<p>%s</p><p>%s</p>',
575
+
\__( 'The constant <code>DISABLE_WP_CRON</code> is set to <code>true</code> in your configuration. This disables WordPress’s built-in cron system, which ActivityPub relies on for timely publishing of posts and processing of reactions (likes, boosts, replies).', 'activitypub' ),
576
+
\__( 'While it is fine to have a system cron job that calls <code>wp-cron.php</code> at regular intervals, completely disabling WP-Cron may cause delays in ActivityPub functionality. If you notice delays in post publishing or reactions appearing, consider either removing this constant or ensuring you have a system cron job running frequently (every 1-5 minutes).', 'activitypub' )
0 commit comments