Warning: Class "Automattic\WooCommerce\Internal\Admin\RemoteInboxNotifications" not found in /htdocs/wp-content/plugins/woocommerce/src/Admin/Features/Features.php on line 377
m string $handle Unique name of the script. * @param string $relative_src Relative url for the script to the path from plugin root. * @param array $dependencies Optional. An array of registered script handles this script depends on. Default empty array. * @param bool $has_i18n Optional. Whether to add a script translation call to this file. Default: true. */ public function register_script( $handle, $relative_src, $dependencies = [], $has_i18n = true ) { $script_data = $this->get_script_data( $relative_src, $dependencies ); if ( in_array( $handle, $script_data['dependencies'], true ) ) { if ( $this->package->feature()->is_development_environment() ) { $dependencies = array_diff( $script_data['dependencies'], [ $handle ] ); add_action( 'admin_notices', function() use ( $handle ) { echo '

'; /* translators: %s file handle name. */ printf( esc_html__( 'Script with handle %s had a dependency on itself which has been removed. This is an indicator that your JS code has a circular dependency that can cause bugs.', 'woocommerce' ), esc_html( $handle ) ); echo '

'; } ); } else { throw new Exception( sprintf( 'Script with handle %s had a dependency on itself. This is an indicator that your JS code has a circular dependency that can cause bugs.', $handle ) ); } } /** * Filters the list of script dependencies. * * @since 3.0.0 * * @param array $dependencies The list of script dependencies. * @param string $handle The script's handle. * @return array */ $script_dependencies = apply_filters( 'woocommerce_blocks_register_script_dependencies', $script_data['dependencies'], $handle ); wp_register_script( $handle, $script_data['src'], $script_dependencies, $script_data['version'], true ); if ( $has_i18n && function_exists( 'wp_set_script_translations' ) ) { wp_set_script_translations( $handle, 'woocommerce', $this->package->get_path( 'languages' ) ); } } /** * Registers a style according to `wp_register_style`. * * @since 2.5.0 * @since 2.6.0 Change src to be relative source. * * @param string $handle Name of the stylesheet. Should be unique. * @param string $relative_src Relative source of the stylesheet to the plugin path. * @param array $deps Optional. An array of registered stylesheet handles this stylesheet depends on. Default empty array. * @param string $media Optional. The media for which this stylesheet has been defined. Default 'all'. Accepts media types like * 'all', 'print' and 'screen', or media queries like '(orientation: portrait)' and '(max-width: 640px)'. */ public function register_style( $handle, $relative_src, $deps = [], $media = 'all' ) { $filename = str_replace( plugins_url( '/', __DIR__ ), '', $relative_src ); $src = $this->get_asset_url( $relative_src ); $ver = $this->get_file_version( $filename ); wp_register_style( $handle, $src, $deps, $ver, $media ); } /** * Returns the appropriate asset path for current builds. * * @param string $filename Filename for asset path (without extension). * @param string $type File type (.css or .js). * @return string The generated path. */ public function get_block_asset_build_path( $filename, $type = 'js' ) { return "build/$filename.$type"; } /** * Adds an inline script, once. * * @param string $handle Script handle. * @param string $script Script contents. */ public function add_inline_script( $handle, $script ) { if ( ! empty( $this->inline_scripts[ $handle ] ) && in_array( $script, $this->inline_scripts[ $handle ], true ) ) { return; } wp_add_inline_script( $handle, $script ); if ( isset( $this->inline_scripts[ $handle ] ) ) { $this->inline_scripts[ $handle ][] = $script; } else { $this->inline_scripts[ $handle ] = array( $script ); } } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\Assets\Api" not found in /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Domain/Bootstrap.php:222 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/AbstractDependencyType.php(42): Automattic\WooCommerce\Blocks\Domain\Bootstrap->Automattic\WooCommerce\Blocks\Domain\{closure}(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #1 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/SharedType.php(28): Automattic\WooCommerce\Blocks\Registry\AbstractDependencyType->resolve_value(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #2 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/Container.php(96): Automattic\WooCommerce\Blocks\Registry\SharedType->get(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #3 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Domain/Bootstrap.php(228): Automattic\WooCommerce\Blocks\Registry\Container->get('Automattic\\WooC...') #4 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/AbstractDependencyType.php(42): Automattic\WooCommerce\Blocks\Domain\Bootstrap->Automattic\WooCommerce\Blocks\Domain\{closure}(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #5 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/SharedType.php(28): Automattic\WooCommerce\Blocks\Registry\AbstractDependencyType->resolve_value(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #6 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/Container.php(96): Automattic\WooCommerce\Blocks\Registry\SharedType->get(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #7 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Domain/Bootstrap.php(121): Automattic\WooCommerce\Blocks\Registry\Container->get('Automattic\\WooC...') #8 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Domain/Bootstrap.php(75): Automattic\WooCommerce\Blocks\Domain\Bootstrap->init() #9 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Package.php(125): Automattic\WooCommerce\Blocks\Domain\Bootstrap->__construct(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #10 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/AbstractDependencyType.php(42): Automattic\WooCommerce\Blocks\Package::Automattic\WooCommerce\Blocks\{closure}(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #11 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/SharedType.php(28): Automattic\WooCommerce\Blocks\Registry\AbstractDependencyType->resolve_value(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #12 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Registry/Container.php(96): Automattic\WooCommerce\Blocks\Registry\SharedType->get(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #13 /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Package.php(44): Automattic\WooCommerce\Blocks\Registry\Container->get('Automattic\\WooC...') #14 [internal function]: Automattic\WooCommerce\Blocks\Package::init() #15 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(71): call_user_func(Array) #16 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(44): Automattic\WooCommerce\Packages::load_packages() #17 /htdocs/wp-includes/class-wp-hook.php(310): Automattic\WooCommerce\Packages::on_init('') #18 /htdocs/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array) #19 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #20 /htdocs/wp-settings.php(495): do_action('plugins_loaded') #21 /htdocs/wp-config.php(96): require_once('/htdocs/wp-sett...') #22 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #23 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #24 /htdocs/index.php(17): require('/htdocs/wp-blog...') #25 {main} thrown in /htdocs/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/Domain/Bootstrap.php on line 222