I use WordPress and my plugin generated 11 characters of unexpected display during the activation but i don’t know why.
I’m I trying to activate the plugin and to generate the table on Workbench.

<?php 
    if(!class_exists('Test')){
        $inst_test = new Test();
    }
    if(isset($inst_test)){
         register_activation_hook(__FILE__, array($inst_test, 'test_install'));
    }    
    class Test {
        function test_install(){
            global $wpdb;
            $table_site = $wpdb->prefix.'test';

            if($wpdb->get_var("SHOW TABLES LIKE '$table_site'") != $table_site) {
                $sql = "CREATE TABLE `$table_site'(
                    `id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
                    `nom` VARCHAR(255) NOT NULL,
                    `title` VARCHAR(255) NOT NULL,
                    `subtitle` VARCHAR(255) NOT NULL
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;";
            require_once(ABSPATH.'wp-admin/includes/upgrade.php');
            dbDelta($sql);
            }
        }
    }?>

Read more here: WordPress: plugin generated 11 characters of unexpected output during the activation


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: