WC_Install::check_version()public staticWC 1.0

Check WooCommerce version and run the updater is required.

This check is done on all requests and runs if the versions do not match.

Method of the class: WC_Install{}

Return

null. Nothing (null).

Usage

$result = WC_Install::check_version();

WC_Install::check_version() code WC 9.4.2

public static function check_version() {
	$wc_version      = get_option( 'woocommerce_version' );
	$wc_code_version = WC()->version;
	$requires_update = version_compare( $wc_version, $wc_code_version, '<' );
	if ( ! Constants::is_defined( 'IFRAME_REQUEST' ) && $requires_update ) {
		self::install();
		/**
		 * Run after WooCommerce has been updated.
		 *
		 * @since 2.2.0
		 */
		do_action( 'woocommerce_updated' );
		do_action_deprecated( 'woocommerce_admin_updated', array(), $wc_code_version, 'woocommerce_updated' );
	}
}