PluginProbe
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance / 4.7.0
WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance v4.7.0
4.7.0 4.6.1 4.6.0 4.5.5 4.5.4 4.5.3 4.5.2 3.2.20 3.2.21 3.2.22 3.2.3 3.2.5 3.2.6 3.2.7 3.2.9 3.3.0 3.3.1 3.3.2 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.7.0 3.7.1 All 111 releases
← All changes | vendor/team-updraft/common-libs/src/updraft-tasks/class-updraft-task.php +53 -1 3.2.7 → 4.7.0 View file →
@@ -73,10 +73,17 @@
73 73 *
74 74 * @var Object
75 75 */
76 76 protected $_loggers;
77 -
77 +
78 78 /**
79 + * Additional dynamic properties, usually copied from the UpdraftPlus_Task object.
80 + *
81 + * @var array<string,mixed>
82 + */
83 + protected $extra_properties = array();
84 +
85 + /**
79 86 * The Task constructor
80 87 *
81 88 * @param UpdraftPlus_Task|object $task UpdraftPlus_Task object.
82 89 */
@@ -688,7 +695,52 @@
688 695 private function get_task_from_db($task_id) {
689 696 global $wpdb;
690 697 $sql = $wpdb->prepare("SELECT * FROM {$wpdb->base_prefix}tm_tasks WHERE id = %d LIMIT 1", $task_id);
691 698 return $wpdb->get_row($sql);
699 + }
700 +
701 + /**
702 + * Writing data to inaccessible/non-existing property
703 + *
704 + * @param string $name
705 + * @param mixed $value
706 + *
707 + * @return void
708 + */
709 + public function __set($name, $value) {
710 + $this->extra_properties[$name] = $value;
711 + }
712 +
713 + /**
714 + * Reading data from inaccessible/non-existing property
715 + *
716 + * @param string $name
717 + *
718 + * @return mixed|null
719 + */
720 + public function __get($name) {
721 + return isset($this->extra_properties[$name]) ? $this->extra_properties[$name] : null;
722 + }
723 +
724 + /**
725 + * Invoked when `isset` or `empty` are called on inaccessible/non-existing property
726 + *
727 + * @param string $name
728 + *
729 + * @return bool
730 + */
731 + public function __isset($name) {
732 + return isset($this->extra_properties[$name]);
733 + }
734 +
735 + /**
736 + * Invoked when `unset` is called on inaccessible/non-existing property
737 + *
738 + * @param string $name
739 + *
740 + * @return void
741 + */
742 + public function __unset($name) {
743 + unset($this->extra_properties[$name]);
692 744 }
693 745 }
694 746 endif;