| @@ -113,10 +113,10 @@ | ||
| 113 | 113 | wp_clear_scheduled_hook( $hook_name ); |
| 114 | 114 | $this->log( "Cleared existing WordPress cron event for '{$hook_name}' to prevent conflicts", self::LOG_FILE_NAME ); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - // Only save if this is a new callback. | |
| 118 | - if ( ! isset( $this->callbacks[ $hook_name ] ) || $this->callbacks[ $hook_name ]['interval'] !== $interval_seconds ) { | |
| 117 | + // Only save if this is a new callback or something changed. | |
| 118 | + if ( ! isset( $this->callbacks[ $hook_name ] ) || $this->callbacks[ $hook_name ]['interval'] !== $interval_seconds || $this->callbacks[ $hook_name ]['start_time'] !== $start_time ) { | |
| 119 | 119 | $this->callbacks[ $hook_name ] = array( |
| 120 | 120 | 'interval' => $interval_seconds, |
| 121 | 121 | 'start_time' => $start_time, |
| 122 | 122 | 'args' => $args, |
| @@ -196,9 +196,14 @@ | ||
| 196 | 196 | return; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | // Skip if page post ID exists, or during AJAX/cron execution to prevent concurrent runs. |
| 200 | - if ( ! empty( defender_get_data_from_request( null, 'p' ) ) || defined( 'DOING_AJAX' ) || defined( 'DOING_CRON' ) ) { | |
| 200 | + $post_data = defender_get_data_from_request( null, 'p' ); | |
| 201 | + if ( | |
| 202 | + ( is_array( $post_data ) && array() !== $post_data ) | |
| 203 | + || defined( 'DOING_AJAX' ) | |
| 204 | + || defined( 'DOING_CRON' ) | |
| 205 | + ) { | |
| 201 | 206 | return; |
| 202 | 207 | } |
| 203 | 208 | |
| 204 | 209 | if ( did_action( 'after_setup_theme' ) > 0 ) { |