); } } /** * Set an option indicating that WooCommerce Admin has just been updated, * run the specs, then clear that option. This lets the * WooCommerceAdminUpdatedRuleProcessor trigger on WCA update. */ public static function run_on_woocommerce_admin_updated() { update_option( self::WCA_UPDATED_OPTION_NAME, true, false ); self::run(); update_option( self::WCA_UPDATED_OPTION_NAME, false, false ); } /** * Gets the stored state option, and does the initial set up if it doesn't * already exist. * * @return object The stored state option. */ public static function get_stored_state() { $stored_state = get_option( self::STORED_STATE_OPTION_NAME ); if ( $stored_state === false ) { $stored_state = new \stdClass(); $stored_state = StoredStateSetupForProducts::init_stored_state( $stored_state ); add_option( self::STORED_STATE_OPTION_NAME, $stored_state, '', false ); } return $stored_state; } /** * The deactivated_plugin hook happens before the option is updated * (https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/plugin.php#L826) * so this captures the deactivated plugin path and pushes it into the * PluginsProvider. * * @param string $plugin Path to the plugin file relative to the plugins directory. */ public static function run_on_deactivated_plugin( $plugin ) { PluginsProvider::set_deactivated_plugin( $plugin ); self::run(); } /** * Update the stored state option. * * @param object $stored_state The stored state. */ public static function update_stored_state( $stored_state ) { update_option( self::STORED_STATE_OPTION_NAME, $stored_state, false ); } /** * Get the note. This is used to display localized note. * * @param Note $note_from_db The note object created from db. * @return Note The note. */ public static function get_note_from_db( $note_from_db ) { if ( ! $note_from_db instanceof Note || get_user_locale() === $note_from_db->get_locale() ) { return $note_from_db; } $specs = RemoteInboxNotificationsDataSourcePoller::get_instance()->get_specs_from_data_sources(); foreach ( $specs as $spec ) { if ( $spec->slug !== $note_from_db->get_name() ) { continue; } $locale = SpecRunner::get_locale( $spec->locales, true ); if ( $locale === null ) { // No locale found, so don't update the note. break; } $localized_actions = SpecRunner::get_actions( $spec ); // Manually copy the action id from the db to the localized action, since they were not being provided. foreach ( $localized_actions as $localized_action ) { $action = $note_from_db->get_action( $localized_action->name ); if ( $action ) { $localized_action->id = $action->id; } } $note_from_db->set_title( $locale->title ); $note_from_db->set_content( $locale->content ); $note_from_db->set_actions( $localized_actions ); } return $note_from_db; } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Admin\RemoteInboxNotifications\RemoteInboxNotificationsEngine" not found in /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/RemoteInboxNotifications.php:42 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/src/Admin/Features/Features.php(138): Automattic\WooCommerce\Internal\Admin\RemoteInboxNotifications->__construct() #1 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Admin\Features\Features::load_features('') #2 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #3 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #4 /htdocs/wp-settings.php(704): do_action('init') #5 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #6 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #7 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #8 /htdocs/index.php(17): require('/htdocs/wp-blog...') #9 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/RemoteInboxNotifications.php on line 42