is_user_logged_in() not working in wordpress plugin

Solution:1

is_user_logged_in() is located in wp-includes/pluggable.php. So please include this file in your plugin file and check.

Solution:2

Try with

$user = wp_get_current_user();
if($user->ID != 0 or $user->ID != null) ...