The function can not create a table on MariaDB server

I am not sure why you are creating a UNIQUE constraint for your “ID”, which can be a primary key.

Also, please note that the dbDelta fails in certain versions of MariaDB when you create a table with a Unique Key Index or a Composite Key or any other indexes except the Primary Key.

The Workaround would be to create the table first:

 $sql = "CREATE TABLE ". $this->table_name ." (
        id bigint(20) unsigned NOT NULL auto_increment,
        name varchar(255) NOT NULL default '',
        rows int(11) NOT NULL default 0,
        cols int(11) NOT NULL default 0,
        subs varchar(255) NOT NULL default '',
        color varchar(255) NOT NULL default '',
        responsive tinyint(1) DEFAULT '0',
        tvalues longtext NOT NULL,
        PRIMARY KEY (id)
        ) $this->charset_collate;";
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );

And then you can use the $wpdb to create the Unique Index using the “ALTER TABLE” method.

global $wpdb;
$wpdb->query("ALTER TABLE `{$this->table_name}` ADD UNIQUE KEY(`column_name`)");

NOTE:You may want to run a check if the index exists before running the above query in your logic.

Hope this helps 🙂