| @@ -1,17 +1,14 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Based on https://github.com/woocommerce/woocommerce/blob/master/includes/abstracts/class-wc-background-process.php | |
| 4 | - * & https://github.com/woocommerce/woocommerce/blob/master/includes/class-wc-background-updater.php | |
| 5 | - * | |
| 6 | - * @package Elementor\Core\Base | |
| 7 | - */ | |
| 8 | - | |
| 9 | 2 | namespace Elementor\Core\Base; |
| 10 | 3 | |
| 11 | 4 | use Elementor\Plugin; |
| 12 | 5 | use Elementor\Core\Base\BackgroundProcess\WP_Background_Process; |
| 13 | 6 | |
| 7 | +/** | |
| 8 | + * Based on https://github.com/woocommerce/woocommerce/blob/master/includes/abstracts/class-wc-background-process.php | |
| 9 | + * & https://github.com/woocommerce/woocommerce/blob/master/includes/class-wc-background-updater.php | |
| 10 | + */ | |
| 14 | 11 | |
| 15 | 12 | defined( 'ABSPATH' ) || exit; |
| 16 | 13 | |
| 17 | 14 | /** |
| @@ -28,9 +25,9 @@ | ||
| 28 | 25 | public function dispatch() { |
| 29 | 26 | $dispatched = parent::dispatch(); |
| 30 | 27 | |
| 31 | 28 | if ( is_wp_error( $dispatched ) ) { |
| 32 | - wp_die( esc_html( $dispatched ) ); | |
| 29 | + wp_die( $dispatched ); | |
| 33 | 30 | } |
| 34 | 31 | } |
| 35 | 32 | |
| 36 | 33 | public function query_col( $sql ) { |
| @@ -211,9 +208,8 @@ | ||
| 211 | 208 | } |
| 212 | 209 | |
| 213 | 210 | /** |
| 214 | 211 | * Use the protected `is_process_running` method as a public method. |
| 215 | - * | |
| 216 | 212 | * @return bool |
| 217 | 213 | */ |
| 218 | 214 | public function is_process_locked() { |
| 219 | 215 | return $this->is_process_running(); |
| @@ -287,9 +283,9 @@ | ||
| 287 | 283 | } elseif ( 1 === $item['iterate_num'] ) { |
| 288 | 284 | $logger->info( sprintf( '%s callback needs to run more %d times', $callback, $item['total'] - $item['iterate_num'] ) ); |
| 289 | 285 | } |
| 290 | 286 | |
| 291 | - ++$item['iterate_num']; | |
| 287 | + $item['iterate_num']++; | |
| 292 | 288 | } else { |
| 293 | 289 | $logger->info( sprintf( '%s Finished', $callback ) ); |
| 294 | 290 | } |
| 295 | 291 | } else { |
| @@ -308,16 +304,13 @@ | ||
| 308 | 304 | public function schedule_cron_healthcheck( $schedules ) { |
| 309 | 305 | $interval = apply_filters( $this->identifier . '_cron_interval', 5 ); |
| 310 | 306 | |
| 311 | 307 | // Adds every 5 minutes to the existing schedules. |
| 312 | - $schedules[ $this->identifier . '_cron_interval' ] = [ | |
| 308 | + $schedules[ $this->identifier . '_cron_interval' ] = array( | |
| 313 | 309 | 'interval' => MINUTE_IN_SECONDS * $interval, |
| 314 | - 'display' => sprintf( | |
| 315 | - /* translators: %d: Interval in minutes. */ | |
| 316 | - esc_html__( 'Every %d minutes', 'elementor' ), | |
| 317 | - $interval | |
| 318 | - ), | |
| 319 | - ]; | |
| 310 | + /* translators: %d: interval */ | |
| 311 | + 'display' => sprintf( __( 'Every %d minutes', 'elementor' ), $interval ), | |
| 312 | + ); | |
| 320 | 313 | |
| 321 | 314 | return $schedules; |
| 322 | 315 | } |
| 323 | 316 | |