get_var( "SELECT SUPPORT FROM information_schema.ENGINES WHERE ENGINE = 'InnoDB'" ); self::$innodb = in_array( strtoupper( (string) $support ), [ 'YES', 'DEFAULT' ], true ); } return self::$innodb; } /** * Table options for CREATE TABLE: "ENGINE=InnoDB DEFAULT CHARACTER SET … COLLATE …". * Without InnoDB on the server (or when the server cannot be asked) only * the charset, as before: the host's default engine applies. */ public static function table_options(): string { global $wpdb; $charset = $wpdb->get_charset_collate(); return self::innodb_available() ? trim( 'ENGINE=InnoDB ' . $charset ) : $charset; } }