<?php
$sql = "CREATE TABLE wp_extra_products (
            Id INT PRIMARY KEY,
            Name VARCHAR(50) NOT NULL,
            Nature VARCHAR(50) NOT NULL,
            Vote TINYINT NOT NULL,
            OldPrice TINYINT NOT NULL,
            NewPrice TINYINT NOT NULL,
            Image VARCHAR(100) NOT NULL
        ) $charset_collate;";

@dbDelta($sql);

$sql = "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (1, 'Organic Natural Bananas', 'Supermarket', 5, '79', '79', '/images/best-seller-products/bananas.jpg');";
$sql .= "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (2, 'Awake Shower Shampoo Gel', 'Fishes & Raw Meats', 5, '87', '87', '/images/best-seller-products/shower-shampoo.jpg');";
$sql .= "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (3, 'The Sparkling Mineral Water', 'Supermarket', 4, '99', '99', '/images/best-seller-products/water.jpg');";
$sql .= "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (4, 'Best Roast Chicken Slices', 'Fruits & Vegetables', 5, '69', '69', '/images/best-seller-products/chicken.jpg');";
$sql .= "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (5, 'Easy Body Wash Shampoo', 'Others', 4, '15', '12', '/images/best-seller-products/wash-shampoo.jpg');";
$sql .= "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (6, 'Organic Natural Blueberries', 'Breads & Sweats', 5, '35', '35', '/images/best-seller-products/blueberries.jpg');";
$sql .= "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (7, 'Flash Spray Wipe Done', 'Breads & Sweats', 5, '35', '35', '/images/best-seller-products/flash-spray.jpg');";
$sql .= "INSERT INTO wp_extra_products (Id, Name, Nature, Vote, OldPrice, NewPrice, Image)
VALUES (8, 'Dove Colour Care Pro', 'Breads & Sweats', 5, '35', '35', '/images/best-seller-products/dove.jpg');";

//echo '$sql:' . $sql;
//$wpdb->query($sql);

$queries = explode(';', $sql);

foreach ($queries as $query) {
    $query = trim($query);
    if (!empty($query)) {
        $wpdb->query($query);
    }
}
