s->merchant_center->is_setup_complete(), 'mcSupportedCountry' => $this->merchant_center->is_store_country_supported(), 'mcSupportedLanguage' => $this->merchant_center->is_language_supported(), 'adsCampaignConvertStatus' => $this->options->get( OptionsInterface::CAMPAIGN_CONVERT_STATUS ), 'adsSetupComplete' => $this->ads->is_setup_complete(), 'enableReports' => $this->enableReports(), 'dateFormat' => get_option( 'date_format' ), 'timeFormat' => get_option( 'time_format' ), 'siteLogoUrl' => wp_get_attachment_image_url( get_theme_mod( 'custom_logo' ), 'full' ), 'initialWpData' => [ 'version' => $this->get_version(), 'mcId' => $this->options->get_merchant_id() ?: null, 'adsId' => $this->options->get_ads_id() ?: null, ], ] ); $assets[] = ( new AdminStyleAsset( 'google-listings-and-ads-css', '/js/build/index', defined( 'WC_ADMIN_PLUGIN_FILE' ) ? [ 'wc-admin-app' ] : [], (string) filemtime( "{$this->get_root_dir()}/js/build/index.css" ), $wc_admin_condition ) ); $product_condition = function () { $screen = get_current_screen(); return ( null !== $screen && 'product' === $screen->id ); }; $assets[] = ( new AdminScriptWithBuiltDependenciesAsset( 'gla-product-attributes', 'js/build/product-attributes', "{$this->get_root_dir()}/js/build/product-attributes.asset.php", new BuiltScriptDependencyArray( [ 'dependencies' => [], 'version' => (string) filemtime( "{$this->get_root_dir()}/js/build/product-attributes.js" ), ] ), $product_condition ) )->add_inline_script( 'glaProductData', [ 'applicableProductTypes' => ProductSyncer::get_supported_product_types(), ] ); $assets[] = ( new AdminStyleAsset( 'gla-product-attributes-css', 'js/build/product-attributes', [], '', $product_condition ) ); return $assets; } /** * Adds links to the plugin's row in the "Plugins" wp-admin page. * * @see https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name) * @param array $links The existing list of links that will be rendered. */ protected function add_plugin_links( $links ): array { $plugin_links = []; // Display settings url if setup is complete otherwise link to get started page if ( $this->merchant_center->is_setup_complete() ) { $plugin_links[] = sprintf( '%2$s', esc_attr( $this->get_settings_url() ), esc_html__( 'Settings', 'google-listings-and-ads' ) ); } else { $plugin_links[] = sprintf( '%2$s', esc_attr( $this->get_start_url() ), esc_html__( 'Get Started', 'google-listings-and-ads' ) ); } $plugin_links[] = sprintf( '%2$s', esc_attr( $this->get_documentation_url() ), esc_html__( 'Documentation', 'google-listings-and-ads' ) ); // Add new links to the beginning return array_merge( $plugin_links, $links ); } /** * Adds a meta box. * * @param MetaBoxInterface $meta_box */ public function add_meta_box( MetaBoxInterface $meta_box ) { add_filter( "postbox_classes_{$meta_box->get_screen()}_{$meta_box->get_id()}", function ( array $classes ) use ( $meta_box ) { return array_merge( $classes, $meta_box->get_classes() ); } ); add_meta_box( $meta_box->get_id(), $meta_box->get_title(), $meta_box->get_callback(), $meta_box->get_screen(), $meta_box->get_context(), $meta_box->get_priority(), $meta_box->get_callback_args() ); } /** * @param string $view Name of the view * @param array $context_variables Array of variables to pass to the view * * @return string The rendered view * * @throws ViewException If the view doesn't exist or can't be loaded. */ public function get_view( string $view, array $context_variables = [] ): string { return $this->view_factory->create( $view ) ->render( $context_variables ); } /** * Only show reports if we enable it through a snippet. * * @return bool Whether reports should be enabled . */ protected function enableReports(): bool { return apply_filters( 'woocommerce_gla_enable_reports', true ); } /** * Add suggested privacy policy content * * @return void */ public function privacy_policy() { $policy_text = sprintf( /* translators: 1) HTML anchor open tag 2) HTML anchor closing tag */ esc_html__( 'By using this extension, you may be storing personal data or sharing data with an external service. %1$sLearn more about what data is collected by Google and what you may want to include in your privacy policy%2$s.', 'google-listings-and-ads' ), '', '' ); // As the extension doesn't offer suggested privacy policy text, the button to copy it is hidden. $content = '

' . $policy_text . '

'; wp_add_privacy_policy_content( 'Google Listings & Ads', wpautop( $content, false ) ); } /** * This method is ONLY used during development. * * The runtime.js file is created when the front-end is developed in Fast Refresh mode * and must be loaded together to enable the mode. * * When Gutenberg is not installed or not activated, the react dependency will not have * the 'wp-react-refresh-entry' handle, so here injects the Fast Refresh scripts we built. * * The Fast Refresh also needs the development version of React and ReactDOM. * They will be replaced if the SCRIPT_DEBUG flag is not enabled. * * @param WP_Scripts $scripts WP_Scripts instance. */ private function inject_fast_refresh_for_dev( $scripts ) { $runtime_path = "{$this->get_root_dir()}/js/build/runtime.js"; if ( ! file_exists( $runtime_path ) ) { return; } $react_script = $scripts->query( 'react', 'registered' ); if ( ! $react_script ) { return; } if ( ! ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) { $react_dom_script = $scripts->query( 'react-dom', 'registered' ); $react_dom_script->src = str_replace( '.min', '', $react_dom_script->src ); $react_script->src = str_replace( '.min', '', $react_script->src ); } $plugin_url = $this->get_plugin_url(); $scripts->add( 'gla-webpack-runtime', "{$plugin_url}/js/build/runtime.js", [], (string) filemtime( $runtime_path ) ); $react_script->deps[] = 'gla-webpack-runtime'; if ( ! in_array( 'wp-react-refresh-entry', $react_script->deps, true ) ) { $scripts->add( 'wp-react-refresh-runtime', "{$plugin_url}/js/build-dev/react-refresh-runtime.js", [] ); $scripts->add( 'wp-react-refresh-entry', "{$plugin_url}/js/build-dev/react-refresh-entry.js", [ 'wp-react-refresh-runtime' ] ); $react_script->deps[] = 'wp-react-refresh-entry'; } } }
Warning: class_implements(): Class Automattic\WooCommerce\GoogleListingsAndAds\Admin\Admin does not exist and could not be loaded in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 119

Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, bool given in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php:120 Stack trace: #0 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php(120): array_key_exists('Automattic\\WooC...', false) #1 /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/CoreServiceProvider.php(283): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\AbstractServiceProvider->conditionally_share_with_tags('Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...', 'Automattic\\WooC...') #2 /htdocs/wp-content/plugins/google-listings-and-ads/vendor/league/container/src/ServiceProvider/ServiceProviderAggregate.php(102): Automattic\WooCommerce\GoogleListingsAndAds\Internal\DependencyManagement\CoreServiceProvider->register() #3 /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...') #4 /htdocs/wp-content/plugins/google-listings-and-ads/src/Container.php(90): Automattic\WooCommerce\GoogleListingsAndAds\Vendor\League\Container\Container->get('Automattic\\WooC...') #5 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(130): Automattic\WooCommerce\GoogleListingsAndAds\Container->get('Automattic\\WooC...') #6 /htdocs/wp-content/plugins/google-listings-and-ads/src/Infrastructure/GoogleListingsAndAdsPlugin.php(91): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->maybe_register_services() #7 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\GoogleListingsAndAdsPlugin->Automattic\WooCommerce\GoogleListingsAndAds\Infrastructure\{closure}('') #8 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #9 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #10 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #11 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #12 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #13 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #14 /htdocs/index.php(17): require('/htdocs/wp-blog...') #15 {main} thrown in /htdocs/wp-content/plugins/google-listings-and-ads/src/Internal/DependencyManagement/AbstractServiceProvider.php on line 120