public function create_error_message( $type = '' ) {
		global $pagenow;

		$update_pages   = [ 'update-core.php', 'plugins.php', 'themes.php' ];
		$settings_pages = [ 'settings.php', 'options-general.php' ];

		if (
			( ( ! isset( $_GET['page'] ) || 'github-updater' !== $_GET['page'] ) &&
			in_array( $pagenow, $settings_pages, true ) ) ||
			! in_array( $pagenow, array_merge( $update_pages, $settings_pages ), true )
		) {
			return false;
		}

		if ( is_admin() && ! static::is_doing_ajax() ) {
			switch ( $type ) {
				case is_wp_error( $type ):
					self::$error_message = $type->get_error_message();
					add_action(
						is_multisite() ? 'network_admin_notices' : 'admin_notices',
						[
							$this,
							'show_wp_error',
						]
					);
					break;
				case 'waiting':
					if ( ! apply_filters( 'github_updater_disable_wpcron', false ) ) {
						add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', [ $this, 'waiting' ] );
					}
					// no break.
				case 'git':
				default:
					add_action(
						is_multisite() ? 'network_admin_notices' : 'admin_notices',
						[
							$this,
							'show_403_error_message',
						]
					);
					add_action(
						is_multisite() ? 'network_admin_notices' : 'admin_notices',
						[
							$this,
							'show_401_error_message',
						]
					);
			}
		}

		return true;
	}
public function create_error_message( $type = '' ) {
		global $pagenow;

		$update_pages   = [ 'update-core.php', 'plugins.php', 'themes.php' ];
		$settings_pages = [ 'settings.php', 'options-general.php' ];

		if (
			( ( ! isset( $_GET['page'] ) || 'github-updater' !== $_GET['page'] ) &&
			in_array( $pagenow, $settings_pages, true ) ) ||
			! in_array( $pagenow, array_merge( $update_pages, $settings_pages ), true )
		) {
			return false;
		}

		if ( is_admin() && ! static::is_doing_ajax() ) {
			switch ( $type ) {
				case is_wp_error( $type ):
					self::$error_message = $type->get_error_message();
					add_action(
						is_multisite() ? 'network_admin_notices' : 'admin_notices',
						[
							$this,
							'show_wp_error',
						]
					);
					break;
				case 'waiting':
					if ( ! apply_filters( 'github_updater_disable_wpcron', false ) ) {
						add_action( is_multisite() ? 'network_admin_notices' : 'admin_notices', [ $this, 'waiting' ] );
					}
					// no break.
				case 'git':
				default:
					add_action(
						is_multisite() ? 'network_admin_notices' : 'admin_notices',
						[
							$this,
							'show_403_error_message',
						]
					);
					add_action(
						is_multisite() ? 'network_admin_notices' : 'admin_notices',
						[
							$this,
							'show_401_error_message',
						]
					);
			}
		}

		return true;
	}
public function create_error_message ( $ type = '' ) { global $ pagenow ; $ update_pages = [ 'update-core.php' , 'plugins.php' , 'themes.php' ] ; $ settings_pages = [ 'settings.php' , 'options-general.php' ] ; if ( ( ( ! isset ( $ _GET [ 'page' ] ) || 'github-updater' !== $ _GET [ 'page' ] ) && in_array ( $ pagenow , $ settings_pages , true ) ) || ! in_array ( $ pagenow , array_merge ( $ update_pages , $ settings_pages ) , true ) ) { return false ; } if ( is_admin ( ) && ! static :: is_doing_ajax ( ) ) { switch ( $ type ) { case is_wp_error ( $ type ) : self :: $ error_message = $ type -> get_error_message ( ) ; add_action ( is_multisite ( ) ? 'network_admin_notices' : 'admin_notices' , [ $ this , 'show_wp_error' , ] ) ; break ; case 'waiting' : if ( ! apply_filters ( 'github_updater_disable_wpcron' , false ) ) { add_action ( is_multisite ( ) ? 'network_admin_notices' : 'admin_notices' , [ $ this , 'waiting' ] ) ; } // no break. case 'git' : default : add_action ( is_multisite ( ) ? 'network_admin_notices' : 'admin_notices' , [ $ this , 'show_403_error_message' , ] ) ; add_action ( is_multisite ( ) ? 'network_admin_notices' : 'admin_notices' , [ $ this , 'show_401_error_message' , ] ) ; } } return true ; }
Display message when API returns other than 200 or 404.

@param string $type

@return bool
Display message when API returns other than 200 or 404 .