| @@ -77,10 +77,15 @@ | ||
| 77 | 77 | $this->config->update_schedule(null, $next); |
| 78 | 78 | return; |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - $next_ts = strtotime((string) $config['next_scheduled_at']); | |
| 82 | - if ($next_ts && $next_ts > time()) { | |
| 81 | + // next_scheduled_at is a site-local wall clock (written with wp_date()). | |
| 82 | + // strtotime() would resolve it against PHP's default timezone (UTC | |
| 83 | + // under WordPress) and shift the send by the site's offset — early on | |
| 84 | + // a negative offset, late on a positive one. Interpret it in the site | |
| 85 | + // timezone, the same way next_run_iso() reports it to the UI. | |
| 86 | + $next_ts = (int) get_gmt_from_date((string) $config['next_scheduled_at'], 'U'); | |
| 87 | + if ($next_ts > 0 && $next_ts > time()) { | |
| 83 | 88 | return; |
| 84 | 89 | } |
| 85 | 90 | |
| 86 | 91 | $this->generator->generate_for_due(); |