Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Internal\DeprecatedFilters 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

Warning: foreach() argument must be of type array|object, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 73
$this->integration_registry->get_all_registered_editor_script_handles() ), $has_i18n ); } if ( null !== $this->get_block_type_script() ) { $data = $this->asset_api->get_script_data( $this->get_block_type_script( 'path' ) ); $has_i18n = in_array( 'wp-i18n', $data['dependencies'], true ); $this->asset_api->register_script( $this->get_block_type_script( 'handle' ), $this->get_block_type_script( 'path' ), array_merge( $this->get_block_type_script( 'dependencies' ), $this->integration_registry->get_all_registered_script_handles() ), $has_i18n ); } } /** * Injects Chunk Translations into the page so translations work for lazy loaded components. * * The chunk names are defined when creating lazy loaded components using webpackChunkName. * * @param string[] $chunks Array of chunk names. */ protected function register_chunk_translations( $chunks ) { foreach ( $chunks as $chunk ) { $handle = 'wc-blocks-' . $chunk . '-chunk'; $this->asset_api->register_script( $handle, $this->asset_api->get_block_asset_build_path( $chunk ), [], true ); wp_add_inline_script( $this->get_block_type_script( 'handle' ), wp_scripts()->print_translations( $handle, false ), 'before' ); wp_deregister_script( $handle ); } } /** * Generate an array of chunks paths for loading translation. * * @param string $chunks_folder The folder to iterate over. * @return string[] $chunks list of chunks to load. */ protected function get_chunks_paths( $chunks_folder ) { $build_path = \Automattic\WooCommerce\Blocks\Package::get_path() . 'build/'; $blocks = []; if ( ! is_dir( $build_path . $chunks_folder ) ) { return []; } foreach ( new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator( $build_path . $chunks_folder ) ) as $block_name ) { $blocks[] = str_replace( $build_path, '', $block_name ); } $chunks = preg_filter( '/.js/', '', $blocks ); return $chunks; } /** * Registers the block type with WordPress. * * @return string[] Chunks paths. */ protected function register_block_type() { $block_settings = [ 'render_callback' => $this->get_block_type_render_callback(), 'editor_script' => $this->get_block_type_editor_script( 'handle' ), 'editor_style' => $this->get_block_type_editor_style(), 'style' => $this->get_block_type_style(), ]; if ( isset( $this->api_version ) && '2' === $this->api_version ) { $block_settings['api_version'] = 2; } $metadata_path = $this->asset_api->get_block_metadata_path( $this->block_name ); // Prefer to register with metadata if the path is set in the block's class. if ( ! empty( $metadata_path ) ) { register_block_type_from_metadata( $metadata_path, $block_settings ); return; } /* * Insert attributes and supports if we're not registering the block using metadata. * These are left unset until now and only added here because if they were set when registering with metadata, * the attributes and supports from $block_settings would override the values from metadata. */ $block_settings['attributes'] = $this->get_block_type_attributes(); $block_settings['supports'] = $this->get_block_type_supports(); $block_settings['uses_context'] = $this->get_block_type_uses_context(); register_block_type( $this->get_block_type(), $block_settings ); } /** * Get the block type. * * @return string */ protected function get_block_type() { return $this->namespace . '/' . $this->block_name; } /** * Get the render callback for this block type. * * Dynamic blocks should return a callback, for example, `return [ $this, 'render' ];` * * @see $this->register_block_type() * @return callable|null; */ protected function get_block_type_render_callback() { return [ $this, 'render_callback' ]; } /** * Get the editor script data for this block type. * * @see $this->register_block_type() * @param string $key Data to get, or default to everything. * @return array|string */ protected function get_block_type_editor_script( $key = null ) { $script = [ 'handle' => 'wc-' . $this->block_name . '-block', 'path' => $this->asset_api->get_block_asset_build_path( $this->block_name ), 'dependencies' => [ 'wc-blocks' ], ]; return $key ? $script[ $key ] : $script; } /** * Get the editor style handle for this block type. * * @see $this->register_block_type() * @return string|null */ protected function get_block_type_editor_style() { return 'wc-blocks-editor-style'; } /** * Get the frontend script handle for this block type. * * @see $this->register_block_type() * @param string $key Data to get, or default to everything. * @return array|string|null */ protected function get_block_type_script( $key = null ) { $script = [ 'handle' => 'wc-' . $this->block_name . '-block-frontend', 'path' => $this->asset_api->get_block_asset_build_path( $this->block_name . '-frontend' ), 'dependencies' => [], ]; return $key ? $script[ $key ] : $script; } /** * Get the frontend style handle for this block type. * * @see $this->register_block_type() * @return string|null */ protected function get_block_type_style() { return 'wc-blocks-style'; } /** * Get the supports array for this block type. * * @see $this->register_block_type() * @return string; */ protected function get_block_type_supports() { return []; } /** * Get block attributes. * * @return array; */ protected function get_block_type_attributes() { return []; } /** * Get block usesContext. * * @return array; */ protected function get_block_type_uses_context() { return []; } /** * Parses block attributes from the render_callback. * * @param array|WP_Block $attributes Block attributes, or an instance of a WP_Block. Defaults to an empty array. * @return array */ protected function parse_render_callback_attributes( $attributes ) { return is_a( $attributes, 'WP_Block' ) ? $attributes->attributes : $attributes; } /** * Render the block. Extended by children. * * @param array $attributes Block attributes. * @param string $content Block content. * @param WP_Block $block Block instance. * @return string Rendered block type output. */ protected function render( $attributes, $content, $block ) { return $content; } /** * Enqueue frontend assets for this block, just in time for rendering. * * @internal This prevents the block script being enqueued on all pages. It is only enqueued as needed. Note that * we intentionally do not pass 'script' to register_block_type. * * @param array $attributes Any attributes that currently are available from the block. */ protected function enqueue_assets( array $attributes ) { if ( $this->enqueued_assets ) { return; } $this->enqueue_data( $attributes ); $this->enqueue_scripts( $attributes ); $this->enqueued_assets = true; } /** * Data passed through from server to client for block. * * @param array $attributes Any attributes that currently are available from the block. * Note, this will be empty in the editor context when the block is * not in the post content on editor load. */ protected function enqueue_data( array $attributes = [] ) { $registered_script_data = $this->integration_registry->get_all_registered_script_data(); foreach ( $registered_script_data as $asset_data_key => $asset_data_value ) { if ( ! $this->asset_data_registry->exists( $asset_data_key ) ) { $this->asset_data_registry->add( $asset_data_key, $asset_data_value ); } } if ( ! $this->asset_data_registry->exists( 'wcBlocksConfig' ) ) { $this->asset_data_registry->add( 'wcBlocksConfig', [ 'buildPhase' => Package::feature()->get_flag(), 'pluginUrl' => plugins_url( '/', dirname( __DIR__ ) ), 'productCount' => array_sum( (array) wp_count_posts( 'product' ) ), 'restApiRoutes' => [ '/wc/store/v1' => array_keys( $this->get_routes_from_namespace( 'wc/store/v1' ) ), ], 'defaultAvatar' => get_avatar_url( 0, [ 'force_default' => true ] ), /* * translators: If your word count is based on single characters (e.g. East Asian characters), * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. * Do not translate into your own language. */ 'wordCountType' => _x( 'words', 'Word count type. Do not translate!', 'woocommerce' ), ] ); } } /** * Get routes from a REST API namespace. * * @param string $namespace Namespace to retrieve. * @return array */ protected function get_routes_from_namespace( $namespace ) { $rest_server = rest_get_server(); $namespace_index = $rest_server->get_namespace_index( [ 'namespace' => $namespace, 'context' => 'view', ] ); if ( is_wp_error( $namespace_index ) ) { return []; } $response_data = $namespace_index->get_data(); return $response_data['routes'] ?? []; } /** * Register/enqueue scripts used for this block on the frontend, during render. * * @param array $attributes Any attributes that currently are available from the block. */ protected function enqueue_scripts( array $attributes = [] ) { if ( null !== $this->get_block_type_script() ) { wp_enqueue_script( $this->get_block_type_script( 'handle' ) ); } } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock" not found in /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/Cart.php:11 Stack trace: #0 /htdocs/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php(90): require() #1 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypesController.php(222): Automattic\Jetpack\Autoloader\jpf11009ded9fc4592b6a05b61ce272b3c_jetpackā“„12_4\PHP_Autoloader::load_class('Automattic\\WooC...') #2 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypesController.php(61): Automattic\WooCommerce\Blocks\BlockTypesController->get_block_types() #3 /htdocs/wp-includes/class-wp-hook.php(310): Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks('') #4 /htdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #5 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #6 /htdocs/wp-settings.php(632): do_action('init') #7 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #8 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #9 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #10 /htdocs/index.php(17): require('/htdocs/wp-blog...') #11 {main} thrown in /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypes/Cart.php on line 11