get_id(); $update = update_option( self::DISMISSED_OPTION, array_unique( $dismissed ) ); if ( $update ) { $this->record_tracks_event( 'dismiss_task', array( 'task_name' => $this->get_id() ) ); } return $update; } /** * Undo task dismissal. * * @return bool */ public function undo_dismiss() { $dismissed = get_option( self::DISMISSED_OPTION, array() ); $dismissed = array_diff( $dismissed, array( $this->get_id() ) ); $update = update_option( self::DISMISSED_OPTION, $dismissed ); if ( $update ) { $this->record_tracks_event( 'undo_dismiss_task', array( 'task_name' => $this->get_id() ) ); } return $update; } /** * Check if a task is snoozeable. * * @deprecated 7.2.0 * * @return bool */ public function is_snoozeable() { wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.2.0' ); return false; } /** * Get the snoozed until datetime. * * @deprecated 7.2.0 * * @return string */ public function get_snoozed_until() { wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.2.0' ); $snoozed_tasks = get_option( self::SNOOZED_OPTION, array() ); if ( isset( $snoozed_tasks[ $this->get_id() ] ) ) { return $snoozed_tasks[ $this->get_id() ]; } return null; } /** * Bool for task snoozed. * * @deprecated 7.2.0 * * @return bool */ public function is_snoozed() { wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.2.0' ); if ( ! $this->is_snoozeable() ) { return false; } $snoozed = get_option( self::SNOOZED_OPTION, array() ); return isset( $snoozed[ $this->get_id() ] ) && $snoozed[ $this->get_id() ] > ( time() * 1000 ); } /** * Snooze the task. * * @param string $duration Duration to snooze. day|hour|week. * * @deprecated 7.2.0 * * @return bool */ public function snooze( $duration = 'day' ) { wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.2.0' ); if ( ! $this->is_snoozeable() ) { return false; } $snoozed = get_option( self::SNOOZED_OPTION, array() ); $snoozed_until = $this->duration_to_ms[ $duration ] + ( time() * 1000 ); $snoozed[ $this->get_id() ] = $snoozed_until; $update = update_option( self::SNOOZED_OPTION, $snoozed ); if ( $update ) { if ( $update ) { $this->record_tracks_event( 'remindmelater_task', array( 'task_name' => $this->get_id() ) ); } } return $update; } /** * Undo task snooze. * * @deprecated 7.2.0 * * @return bool */ public function undo_snooze() { wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.2.0' ); $snoozed = get_option( self::SNOOZED_OPTION, array() ); unset( $snoozed[ $this->get_id() ] ); $update = update_option( self::SNOOZED_OPTION, $snoozed ); if ( $update ) { $this->record_tracks_event( 'undo_remindmelater_task', array( 'task_name' => $this->get_id() ) ); } return $update; } /** * Check if a task list has previously been marked as complete. * * @return bool */ public function has_previously_completed() { $complete = get_option( self::COMPLETED_OPTION, array() ); return in_array( $this->get_id(), $complete, true ); } /** * Track task completion if task is viewable. */ public function possibly_track_completion() { if ( $this->has_previously_completed() ) { return; } // Expensive check. if ( ! $this->is_complete() ) { return; } $completed_tasks = get_option( self::COMPLETED_OPTION, array() ); $completed_tasks[] = $this->get_id(); update_option( self::COMPLETED_OPTION, $completed_tasks ); $this->record_tracks_event( 'task_completed', array( 'task_name' => $this->get_id() ) ); } /** * Set this as the active task across page loads. */ public function set_active() { if ( $this->is_complete() ) { return; } set_transient( self::ACTIVE_TASK_TRANSIENT, $this->get_id(), DAY_IN_SECONDS ); } /** * Check if this is the active task. */ public function is_active() { return get_transient( self::ACTIVE_TASK_TRANSIENT ) === $this->get_id(); } /** * Check if the store is capable of viewing the task. * * @return bool */ public function can_view() { return true; } /** * Check if task is disabled. * * @deprecated 7.2.0 * * @return bool */ public function is_disabled() { wc_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '7.2.0' ); return false; } /** * Check if the task is complete. * * @return bool */ public function is_complete() { return self::is_actioned(); } /** * Check if the task has been visited. * * @return bool */ public function is_visited() { $user_id = get_current_user_id(); $response = WCAdminUser::get_user_data_field( $user_id, 'task_list_tracked_started_tasks' ); $tracked_tasks = $response ? json_decode( $response, true ) : array(); return isset( $tracked_tasks[ $this->get_id() ] ) && $tracked_tasks[ $this->get_id() ] > 0; } /** * Check if should record event when task is viewed * * @return bool */ public function get_record_view_event(): bool { return false; } /** * Get the task as JSON. * * @return array */ public function get_json() { $this->possibly_track_completion(); return array( 'id' => $this->get_id(), 'parentId' => $this->get_parent_id(), 'title' => $this->get_title(), 'badge' => $this->get_badge(), 'canView' => $this->can_view(), 'content' => $this->get_content(), 'additionalInfo' => $this->get_additional_info(), 'actionLabel' => $this->get_action_label(), 'actionUrl' => $this->get_action_url(), 'isComplete' => $this->is_complete(), 'time' => $this->get_time(), 'level' => 3, 'isActioned' => $this->is_actioned(), 'isDismissed' => $this->is_dismissed(), 'isDismissable' => $this->is_dismissable(), 'isSnoozed' => false, 'isSnoozeable' => false, 'isVisited' => $this->is_visited(), 'isDisabled' => false, 'snoozedUntil' => null, 'additionalData' => self::convert_object_to_camelcase( $this->get_additional_data() ), 'eventPrefix' => $this->prefix_event( '' ), 'recordViewEvent' => $this->get_record_view_event(), ); } /** * Convert object keys to camelcase. * * @param array $data Data to convert. * @return object */ public static function convert_object_to_camelcase( $data ) { if ( ! is_array( $data ) ) { return $data; } $new_object = (object) array(); foreach ( $data as $key => $value ) { $new_key = lcfirst( implode( '', array_map( 'ucfirst', explode( '_', $key ) ) ) ); $new_object->$new_key = $value; } return $new_object; } /** * Mark a task as actioned. Used to verify an action has taken place in some tasks. * * @return bool */ public function mark_actioned() { $actioned = get_option( self::ACTIONED_OPTION, array() ); $actioned[] = $this->get_id(); $update = update_option( self::ACTIONED_OPTION, array_unique( $actioned ) ); if ( $update ) { $this->record_tracks_event( 'actioned_task', array( 'task_name' => $this->get_id() ) ); } return $update; } /** * Check if a task has been actioned. * * @return bool */ public function is_actioned() { return self::is_task_actioned( $this->get_id() ); } /** * Check if a provided task ID has been actioned. * * @param string $id Task ID. * @return bool */ public static function is_task_actioned( $id ) { $actioned = get_option( self::ACTIONED_OPTION, array() ); return in_array( $id, $actioned, true ); } /** * Sorting function for tasks. * * @param Task $a Task a. * @param Task $b Task b. * @param array $sort_by list of columns with sort order. * @return int */ public static function sort( $a, $b, $sort_by = array() ) { $result = 0; foreach ( $sort_by as $data ) { $key = $data['key']; $a_val = $a->$key ?? false; $b_val = $b->$key ?? false; if ( 'asc' === $data['order'] ) { $result = $a_val <=> $b_val; } else { $result = $b_val <=> $a_val; } if ( 0 !== $result ) { break; } } return $result; } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\TaskList\CompleteSetupTask does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73

Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Admin\Features\OnboardingTasks\Task" not found in /htdocs/wp-content/plugins/google-listings-and-ads/src/TaskList/CompleteSetupTask.php:18 Stack trace: #0 /htdocs/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php(90): require() #1 [internal function]: Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackā“„13_5\al3_0_8\PHP_Autoloader::load_class('Automattic\\WooC...') #2 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php(73): class_implements('Automattic\\WooC...') #3 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/CoreServiceProvider.php(303): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\AbstractServiceProvider->share_with_tags('Automattic\\WooC...') #4 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php(102): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\CoreServiceProvider->register() #5 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(172): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\ServiceProvider\ServiceProviderAggregate->register('Automattic\\WooC...') #6 /htdocs/wp-content/plugins/google-listings-and-ads/src/Container.php(90): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #7 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(130): Automattic\WooCommerce\GoogleListingsAndAds\Container->get('Automattic\\WooC...') #8 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(91): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->maybe_register_services() #9 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\{closure}('') #10 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #11 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #12 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #13 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #14 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #15 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #16 /htdocs/index.php(17): require('/htdocs/wp-blog...') #17 {main} thrown in /htdocs/wp-content/plugins/google-listings-and-ads/src/TaskList/CompleteSetupTask.php on line 18