[ static::PHASE_MIGRATION_NOT_REQUIRED, static::PHASE_MIGRATION_COMPLETE ] ); } /** * Check if we should allow a reverse migration action to occur. There is an expiration period of time for how long * we allow someone to reverse. * * @since 6.0.0 * * @return bool * * @throws \Exception */ public function should_allow_reverse_migration() { // If we have not migrated yet, don't block reversing. if ( ! $this->is_migrated() ) { return true; } // Missing our timestamp for some reason? if ( ! $this->get( 'complete_timestamp' ) ) { return true; } $current_date = ( new \DateTime( 'now', wp_timezone() ) ); $date_completed = ( new \DateTime( 'now', wp_timezone() ) )->setTimestamp( $this->get( 'complete_timestamp' ) ); // 8 day old expiration $expires_in_seconds = 8 * 24 * 60 * 60; // If time for our reverse migration has expired return ( $current_date->format( 'U' ) - $expires_in_seconds ) < $date_completed->format( 'U' ); } /** * Returns whether there is work being done. Does not only check for an in progress migration. * * @since 6.0.0 * * @return bool Whether some worker actions are in flight. */ public function is_running() { $states = [ self::PHASE_MIGRATION_IN_PROGRESS, self::PHASE_PREVIEW_IN_PROGRESS, self::PHASE_CANCEL_IN_PROGRESS, self::PHASE_REVERT_IN_PROGRESS, self::PHASE_MIGRATION_FAILURE_IN_PROGRESS, ]; return in_array( $this->get_phase(), $states, true ); } /** * Checks the phases we want to lock out access to certain features. * * @since 6.0.0 * * @return bool Whether we should lock the site for maintenance mode. */ public function should_lock_for_maintenance() { $states = [ self::PHASE_MIGRATION_IN_PROGRESS, self::PHASE_CANCEL_IN_PROGRESS, self::PHASE_REVERT_IN_PROGRESS, self::PHASE_MIGRATION_FAILURE_IN_PROGRESS, ]; return in_array( $this->get_phase(), $states, true ); } /** * Returns whether the migration is required or not. * * @since 6.0.0 * * @return bool Whether the migration is required or not. */ public function is_required() { $phase = $this->get_phase(); if ( in_array( $phase, [ self::PHASE_MIGRATION_NOT_REQUIRED, self::PHASE_MIGRATION_COMPLETE ], true ) ) { return false; } return true; } /** * Returns the current migration phase the site is in. * * @since 6.0.0 * * @return string The current migration phase the site is in. */ public function get_phase() { return $this->data['phase']; } /** * Returns a value for a specific data key or nested data key. * * @since 6.0.0 * * @param string ...$keys A set of one or more indexes to get the * value of. * * @return mixed|null The value of the requested index, or nested indexed, or `null` * if not defined. */ public function get( ...$keys ) { return Arr::get( $this->data, $keys, null ); } /** * Set a value for the migration state. * * @since 6.0.0 * * @param ...$keys string The key(s) of the value to store. * @param $value mixed The value to store. */ public function set( ...$keys ) { $value = array_pop( $keys ); $this->data = Arr::set( $this->data, $keys, $value ); } /** * Save our current state. * * @since 6.0.0 */ public function save() { // This will return `false` on failure to save and if the value is the same, not indicative of a failure. update_option( self::STATE_OPTION_KEY, $this->data ); } /** * Returns whether the current phase is a migration dry-run or not. * * @since 6.0.2 * * @return bool Whether the current phase is a migration dry-run or not. */ public function is_dry_run(): bool { $phase = $this->get_phase(); switch($phase) { case State::PHASE_REVERT_COMPLETE: case State::PHASE_CANCEL_COMPLETE: case State::PHASE_PREVIEW_PROMPT: case State::PHASE_PREVIEW_IN_PROGRESS: case State::PHASE_MIGRATION_FAILURE_COMPLETE: return true; default: return false; } } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\GoogleListingsAndAds\Vendor\Google\Service\ShoppingContent\Resource\Csses" not found in /htdocs/wp-content/plugins/google-listings-and-ads/vendor/google/apiclient-services/src/ShoppingContent.php:974 Stack trace: #0 [internal function]: Automattic\WooCommerce\GoogleListingsAndAds\Vendor\Google\Service\ShoppingContent->__construct(Object(Automattic\WooCommerce\GoogleListingsAndAds\Vendor\Google\Client), 'https://api-vip...') #1 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(256): ReflectionClass->newInstanceArgs(Array) #2 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(212): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveClass('Automattic\\WooC...') #3 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/DefinitionAggregate.php(94): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolve(false) #4 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(157): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\DefinitionAggregate->resolve('Automattic\\WooC...', false) #5 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(45): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #6 [internal function]: Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Argument\{closure}('Automattic\\WooC...') #7 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(19): array_map(Object(Closure), Array) #8 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(253): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveArguments(Array) #9 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(212): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveClass('Automattic\\WooC...') #10 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/DefinitionAggregate.php(94): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolve(false) #11 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(157): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\DefinitionAggregate->resolve('Automattic\\WooC...', false) #12 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(45): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #13 [internal function]: Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Argument\{closure}('Automattic\\WooC...') #14 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(19): array_map(Object(Closure), Array) #15 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(253): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveArguments(Array) #16 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(212): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveClass('Automattic\\WooC...') #17 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/DefinitionAggregate.php(94): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolve(false) #18 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(157): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\DefinitionAggregate->resolve('Automattic\\WooC...', false) #19 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(45): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #20 [internal function]: Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Argument\{closure}('Automattic\\WooC...') #21 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(19): array_map(Object(Closure), Array) #22 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(253): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveArguments(Array) #23 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(212): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveClass('Automattic\\WooC...') #24 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/DefinitionAggregate.php(106): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolve(false) #25 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(162): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\DefinitionAggregate->resolveTagged('Automattic\\WooC...', false) #26 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(45): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #27 [internal function]: Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Argument\{closure}('Automattic\\WooC...') #28 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(19): array_map(Object(Closure), Array) #29 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(253): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveArguments(Array) #30 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(212): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveClass('Automattic\\WooC...') #31 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/DefinitionAggregate.php(94): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolve(false) #32 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(157): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\DefinitionAggregate->resolve('Automattic\\WooC...', false) #33 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(45): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #34 [internal function]: Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Argument\{closure}('Automattic\\WooC...') #35 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(19): array_map(Object(Closure), Array) #36 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(253): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveArguments(Array) #37 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(212): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveClass('Automattic\\WooC...') #38 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/DefinitionAggregate.php(106): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolve(false) #39 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(162): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\DefinitionAggregate->resolveTagged('Automattic\\WooC...', false) #40 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(45): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #41 [internal function]: Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Argument\{closure}('Automattic\\WooC...') #42 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Argument/ArgumentResolverTrait.php(19): array_map(Object(Closure), Array) #43 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(237): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveArguments(Array) #44 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/Definition.php(198): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolveCallable(Object(Closure)) #45 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Definition/DefinitionAggregate.php(106): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\Definition->resolve(false) #46 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(162): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Definition\DefinitionAggregate->resolveTagged('Automattic\\WooC...', false) #47 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/Container.php(178): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...', false) #48 /htdocs/wp-content/plugins/google-listings-and-ads/src/Container.php(90): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #49 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(130): Automattic\WooCommerce\GoogleListingsAndAds\Container->get('Automattic\\WooC...') #50 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(91): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->maybe_register_services() #51 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\{closure}('') #52 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #53 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #54 /htdocs/wp-settings.php(506): do_action('plugins_loaded') #55 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #56 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #57 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #58 /htdocs/index.php(17): require('/htdocs/wp-blog...') #59 {main} thrown in /htdocs/wp-content/plugins/google-listings-and-ads/vendor/google/apiclient-services/src/ShoppingContent.php on line 974