Skip to content

hotfix/cp-10640-add-scheduled-push-option-in-wordpress-plugin#13

Open
harkeshkumar196 wants to merge 2 commits intomasterfrom
hotfix/cp-10640-add-scheduled-push-option-in-wordpress-plugin
Open

hotfix/cp-10640-add-scheduled-push-option-in-wordpress-plugin#13
harkeshkumar196 wants to merge 2 commits intomasterfrom
hotfix/cp-10640-add-scheduled-push-option-in-wordpress-plugin

Conversation

@harkeshkumar196
Copy link
Contributor

@harkeshkumar196 harkeshkumar196 commented Feb 16, 2026

Summary by cubic

Adds a “When to send” option in the WordPress CleverPush metabox so editors can schedule push notifications with preset delays or a custom date/time. Addresses Linear CP-10640 by setting scheduledAt on publish or resend based on the selected delay or custom timestamp, with minor UI copy and input handling fixes.

  • New Features
    • Added select: Immediately, 15/30/60/120/240 minutes, or Custom date & time; UI shows the picker only for Custom, clears values when switching, and displays a sent message with a “Send again” checkbox when applicable.
    • Server computes scheduledAt from delay or custom value, stores delay in post meta, reuses the same send flow for publish and “Send again,” and still supports the existing scheduled_at input.

Written for commit 8e31c05. Summary will update on new commits.

@harkeshkumar196 harkeshkumar196 self-assigned this Feb 16, 2026
@cursor
Copy link

cursor bot commented Feb 16, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 12.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@harkeshkumar196 harkeshkumar196 marked this pull request as draft February 16, 2026 23:45
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@harkeshkumar196 harkeshkumar196 marked this pull request as ready for review February 18, 2026 07:00
@harkeshkumar196 harkeshkumar196 force-pushed the hotfix/cp-10640-add-scheduled-push-option-in-wordpress-plugin branch from de228f1 to 9551b87 Compare February 18, 2026 07:02
@harkeshkumar196 harkeshkumar196 force-pushed the hotfix/cp-10640-add-scheduled-push-option-in-wordpress-plugin branch from 9551b87 to bc4f610 Compare February 18, 2026 07:05
- 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 <cursoragent@cursor.com>
@harkeshkumar196 harkeshkumar196 force-pushed the hotfix/cp-10640-add-scheduled-push-option-in-wordpress-plugin branch from bc4f610 to ea7211c Compare February 18, 2026 07:07
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="cleverpush.php">

<violation number="1" location="cleverpush.php:1211">
P2: The delay values (15, 30, 60, 120, 240) are duplicated in `publish_post`, `save_post`, and the HTML template. This makes the code harder to maintain and prone to inconsistencies if options change.

Consider defining these as a class constant (e.g., `DELAY_OPTIONS`) and referencing it in all three locations.</violation>

<violation number="2" location="cleverpush.php:1219">
P2: This fallback logic overrides the "Immediately" selection if a scheduled date remains in the hidden input (e.g., due to a JavaScript error or a previous draft).

If the user selects "Immediately" (`cleverpush_notification_delay` is empty), the code shouldn't fall back to `cleverpush_scheduled_at` unless `cleverpush_notification_delay` was missing from the request entirely (legacy compatibility).

If `$_POST['cleverpush_notification_delay']` is present and empty, it should be treated as an explicit "send now" instruction.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments