Automator_Load::is_php8_compat()

is_php8_compat


Description Description

Checks and displays an admin notices if php is version 8 or above and both automator free and pro is version 3.2 or above.


Top ↑

Return Return

(boolean) True if version is 8 and both free or pro is less than 3.2. Otherwise, false.


Source Source

File: src/class-automator-load.php

	public function is_php8_compat() {
		// if Pro is not active, bail
		if ( ! defined( 'AUTOMATOR_PRO_PLUGIN_VERSION' ) ) {
			return true;
		}
		// Check if the php version is 8.0 and above.
		if ( ! version_compare( PHP_VERSION, '8.0.0', '>=' ) ) {
			return true;
		}
		$automator_pro_version_is_less_than_3_2 = version_compare( AUTOMATOR_PRO_PLUGIN_VERSION, '3.2', '<' );
		// If > php8.
		// If either of free and pro is < 3.2.
		if ( $automator_pro_version_is_less_than_3_2 ) {
			add_action( 'admin_notices', array( $this, 'check_automator32_php8_compat_message' ) );
			return false;
		}
		return true;
	}