From b25da2173c85f386773274ce9b2be7cbb317d52e Mon Sep 17 00:00:00 2001
From: Alex Kirk
Date: Fri, 21 Feb 2025 15:48:37 +0100
Subject: [PATCH] Update tests
---
includes/class-admin.php | 35 ++++++++++++++++++++++++++++-------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/includes/class-admin.php b/includes/class-admin.php
index bed29643..afbb7f6f 100644
--- a/includes/class-admin.php
+++ b/includes/class-admin.php
@@ -3656,9 +3656,13 @@ public function site_status_tests( $tests ) {
'test' => array( $this, 'friend_roles_test' ),
);
$tests['direct']['friends-cron'] = array(
- 'label' => __( 'Friend cron job is enabled', 'friends' ),
+ 'label' => __( 'Friends cron job is enabled', 'friends' ),
'test' => array( $this, 'friends_cron_test' ),
);
+ $tests['direct']['friends-delete-cron'] = array(
+ 'label' => __( 'Friends delete old posts cron job is enabled', 'friends' ),
+ 'test' => array( $this, 'friends_cron_delete_test' ),
+ );
return $tests;
}
@@ -3727,7 +3731,7 @@ public function friend_roles_test() {
public function friends_cron_test() {
$result = array(
- 'label' => __( 'The friend cron job is enabled', 'friends' ),
+ 'label' => __( 'The refresh cron job is enabled', 'friends' ),
'status' => 'good',
'badge' => array(
'label' => __( 'Friends', 'friends' ),
@@ -3739,9 +3743,8 @@ public function friends_cron_test() {
'
',
'test' => 'friends-cron',
);
-
if ( ! wp_next_scheduled( 'cron_friends_refresh_feeds' ) ) {
- $result['label'] = __( 'The friends cron job is not enabled', 'friends' );
+ $result['label'] = __( 'The refresh cron job is not enabled', 'friends' );
$result['badge']['color'] = 'red';
$result['status'] = 'critical';
$result['description'] .= '';
@@ -3755,10 +3758,28 @@ public function friends_cron_test() {
$result['description'] .= '
';
}
+ return $result;
+ }
+
+ public function friends_cron_delete_test() {
+ $result = array(
+ 'label' => __( 'The cron job to delete old posts is enabled', 'friends' ),
+ 'status' => 'good',
+ 'badge' => array(
+ 'label' => __( 'Friends', 'friends' ),
+ 'color' => 'green',
+ ),
+ 'description' =>
+ '' .
+ __( 'The Friends Plugin uses a cron job to delete old posts your friends.', 'friends' ) .
+ '
',
+ 'test' => 'friends-delete-cron',
+ );
+
if ( ! wp_next_scheduled( 'cron_friends_delete_old_posts' ) ) {
- $result['label'] = __( 'The friends delete old posts cron job is not enabled', 'friends' );
- $result['badge']['color'] = 'yellow';
- $result['status'] = 'warning';
+ $result['label'] = __( 'The cron job to delete old posts is not enabled', 'friends' );
+ $result['badge']['color'] = 'orange';
+ $result['status'] = 'recommended';
$result['description'] .= '';
$result['description'] .= wp_kses_post(
sprintf(