Repository navigation
hotfix/cp-12676-cleverpush-wordpress-plugin-not-saving-scheduled-push - #15
paavan-cleverpush wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Turn on auto-fix | Re-trigger cubic
…ting options - Change return value from null to false when channel ID, notification ID, or API key is missing in the CleverPush API. - Add error handling for WP remote requests to return false on failure. - Introduce actions for cleaning up draft notifications on post status changes and before post deletion. - Update targeting options in the notification settings UI to retain user selections for topics, tags, and segments.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5e280f9. Configure here.
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
- Introduce a new method to check if notification targeting options (topics, segments, tags) are submitted. - Refactor the targeting retrieval process to streamline the handling of submitted data. - Ensure that targeting options are updated correctly based on user input in the notification settings.

Note
Medium Risk
Changes the publish/cron notification path and adds create/delete API calls for draft notifications; mistakes could cause missed or duplicate pushes, but scope is limited to CleverPush metabox meta and remote notification lifecycle.
Overview
Fixes scheduled CleverPush notifications so choices and timing survive saves and still send when WordPress publishes the post—including cron-driven scheduled publishes where the metabox is not posted.
Persistence and publish path: Schedule meta is written only when the metabox is submitted; the datetime picker stays in sync with the hidden ISO field (including on save/submit) and clears when push is disabled. On publish,
publish_postfalls back to saved send flag, title, text, schedule, and targeting from post meta when the metabox is absent, and allows sending under cron when the saved send flag is set.Remote draft notifications: Unpublished posts can create/update a CleverPush draft notification (hash-deduped) via
sync_draft_notification; drafts are removed on status change, post delete, or after a successful send using newCleverPush_Api::delete_notification, with a retry queue if DELETE fails.Admin UI: The options AJAX call passes
post_idand restores saved topics, tags, and segments in the metabox. Plugin version bumps to 1.9.9 with readme changelog.Reviewed by Cursor Bugbot for commit abbb3ca. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Fixes scheduled CleverPush notifications so they persist after saving and fire when WordPress publishes, including cron-triggered scheduled posts.
publish_postunder cron.delete_notificationAPI support.Written for commit abbb3ca. Summary will update on new commits.