WC_Helper_Updater::get_updates_count_based_on_site_status()public staticWC 1.0

Get the update count to based on the status of the site.

Method of the class: WC_Helper_Updater{}

No Hooks.

Return

Int.

Usage

$result = WC_Helper_Updater::get_updates_count_based_on_site_status();

WC_Helper_Updater::get_updates_count_based_on_site_status() code WC 9.7.1

public static function get_updates_count_based_on_site_status() {
	if ( ! WC_Helper::is_site_connected() ) {
		return 0;
	}

	$count = self::get_updates_count() ?? 0;
	if ( ! WC_Woo_Update_Manager_Plugin::is_plugin_installed() || ! WC_Woo_Update_Manager_Plugin::is_plugin_active() ) {
		++$count;
	}

	return $count;
}