From ea7211c65778fb237de137c1777e6beae68120db Mon Sep 17 00:00:00 2001 From: harkeshkumar196 Date: Wed, 18 Feb 2026 12:37:35 +0530 Subject: [PATCH 1/2] Add notification delay/scheduling feature - Add 'Notification delay (optional)' dropdown with immediate, 15/30/60/120/240 min options - Add 'Custom scheduled date & time' option for absolute scheduling - Calculate scheduledAt based on delay: time() + (delay_minutes * 60) - Store delay preference in cleverpush_notification_delay post meta - Update metabox UI to show delay options when 'Send push notification' is checked - Improve notification sent status messaging Co-authored-by: Cursor --- cleverpush.php | 153 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 107 insertions(+), 46 deletions(-) diff --git a/cleverpush.php b/cleverpush.php index f7ee2da..3d4d4a2 100644 --- a/cleverpush.php +++ b/cleverpush.php @@ -677,17 +677,8 @@ public function create_metabox() public function metabox($post) { - $notification_sent = get_post_meta(get_the_ID(), 'cleverpush_notification_sent', true); - - if ($notification_sent) { - $notification_sent_at = get_post_meta(get_the_ID(), 'cleverpush_notification_sent_at', true); - if (!empty($notification_sent_at) && (time() - $notification_sent_at) < 60) { - ?> - ✅ - ID, 'cleverpush_notification_sent', true); + $notification_already_sent = ! empty($notification_sent); $selected_channel_id = get_option('cleverpush_channel_id'); $api_key_private = get_option('cleverpush_apikey_private'); @@ -695,13 +686,19 @@ public function metabox($post) if (!empty($api_key_private) && !empty($selected_channel_id)) { ?> + +

+
@@ -723,13 +720,25 @@ public function metabox($post) style="width: 100%"> -
-
+
+ +
+ +
-
+ +
+
+
+