Automattic\WooCommerce\Internal\Features

FeaturesController::process_pending_declarationsprivateWC 10.1.0

Processes any pending compatibility declarations by normalizing plugin file paths and registering them internally.

This method is called lazily when compatibility information is queried (via get_compatible_features_for_plugin() or get_compatible_plugins_for_feature()). It resolves plugin IDs using PluginUtil and logs errors for unrecognized plugins. Pending declarations are cleared after processing to avoid redundant work.

Method of the class: FeaturesController{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->process_pending_declarations(): void;

Changelog

Since 10.1.0 Introduced.

FeaturesController::process_pending_declarations() code WC 10.3.3

private function process_pending_declarations(): void {
	if ( empty( $this->pending_declarations ) ) {
		return;
	}

	foreach ( $this->pending_declarations as $declaration ) {
		[ $feature_id, $plugin_file, $positive_compatibility ] = $declaration;

		// Register internally.
		$this->register_compatibility_internal( $feature_id, $plugin_file, $positive_compatibility );
	}

	$this->pending_declarations = array();
	$this->lazy                 = false;
}