The plugin generated 198 characters of unexpected output during activation. If you notice “headers already sent” messages…… ,

The plugin generated 198 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

How to solve this ?

function custom_plugin_tables(){
global $wpdb;
require_once (ABSPATH.’wp-admin/includes/upgrade.php’);
if (count($wpdb->get_var(‘SHOW TABLES LIKE “wp_custom_plugin”‘)) == 0) {
$sql_query_to_create_table = “CREATE TABLE `wp_custom_plugin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(150) DEFAULT NULL,
`email` varchar(150) DEFAULT NULL,
`phone` varchar(50) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1” ;// sql query to create table
dbDelta( $sql_query_to_create_table);
}
}

register_activation_hook( __FILE__, ‘custom_plugin_tables’ );

Read more here:: The plugin generated 198 characters of unexpected output during activation. If you notice “headers already sent” messages…… ,

Leave a Reply

Your email address will not be published. Required fields are marked *