PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 113
Lasso Lite – Affiliate Link Manager & Product Displays v113
158 157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 All 57 releases
← All changes | classes/processes/class-process.php +1 -30 158113 View file →
@@ -37,9 +37,8 @@
37 37 const EXCEEDED_TIME_LIMIT = 10; // ? Exceeded time limit in seconds
38 38 const AGE_OUT = 6; // ? Age out time after n hours
39 39 const RESTART_ATTEMPTED_LIMIT = 3;
40 40 const OPTION_RESTART_ATTEMPTED = 'lasso_lite_process_restart_attempted'; // ? Age out time after n hours
41 - const COMPLETE_ACTION_KEY = 'lasso_lite_process_complete';
42 41
43 42 /**
44 43 * Action name
45 44 *
@@ -312,9 +311,9 @@
312 311 $key
313 312 );
314 313 // @codingStandardsIgnoreEnd
315 314
316 - $queue = $lasso_db->get_var( $sql ); // ? SQL errors surfaced via log_error() -> trigger_error()
315 + $queue = $lasso_db->get_var( $sql ); // ? We want to track SQL errors in Sentry
317 316 $count = 0;
318 317 $unserialized_queue = maybe_unserialize( $queue );
319 318 if ( is_array( $unserialized_queue ) ) {
320 319 $count = count( $unserialized_queue );
@@ -366,9 +365,8 @@
366 365 public function complete() {
367 366 parent::complete();
368 367 $this->set_completed();
369 368 $this->task_end_log();
370 - do_action( self::COMPLETE_ACTION_KEY, $this->action );
371 369 }
372 370
373 371 /**
374 372 * Check whether CPU exceeded or not
@@ -514,31 +512,8 @@
514 512 $lasso_db->remove_all_lasso_processes();
515 513 }
516 514
517 515 /**
518 - * Log once when a configured background process class is missing.
519 - *
520 - * @param mixed $process_class Process class name from filter/map.
521 - */
522 - private static function log_missing_process_class_once( $process_class ) {
523 - $class_label = is_string( $process_class ) ? $process_class : wp_json_encode( $process_class );
524 - static $logged_this_request = array();
525 - if ( isset( $logged_this_request[ $class_label ] ) ) {
526 - return;
527 - }
528 - $logged_this_request[ $class_label ] = true;
529 -
530 - $log_key = 'lasso_lite_missing_proc_' . md5( $class_label );
531 - if ( get_option( $log_key ) ) {
532 - return;
533 - }
534 - update_option( $log_key, 1, false );
535 -
536 - // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
537 - error_log( 'Lasso Lite: skipping missing background process class ' . $class_label );
538 - }
539 -
540 - /**
541 516 * Get Background Process is running
542 517 */
543 518 public function get_list_background_processing() {
544 519 $result = array(
@@ -550,12 +525,8 @@
550 525 $process_classes = Lasso_Verbiage::PROCESS_DESCRIPTION;
551 526 $process_classes = apply_filters( 'lasso_lite_all_processes', $process_classes );
552 527
553 528 foreach ( $process_classes as $process_class => $process_name ) {
554 - if ( ! is_string( $process_class ) || ! class_exists( $process_class ) ) {
555 - self::log_missing_process_class_once( $process_class );
556 - continue;
557 - }
558 529 /** @var Process $process_class_obj */ // phpcs:ignore
559 530 $process_class_obj = new $process_class();
560 531 $process_next_schedule = $process_class_obj->next_schedule();
561 532