Can someone help me out? Why isn’t this working?

For the benefit of those who will come across this question, I have solved it.
This is how the functioning code works. Now this code helps me to delete Subscribers who have registered on the blog using a plan of their choice, I am working on a paid blog and figured I could do it all by myself without having to buy a plugin.

//Auto Delete Expired Users
function delete_users(){
    require_once(ABSPATH.'wp-admin/includes/user.php' );
   $bloguser = get_users( array( 'role' => 'subscriber' ) );
   foreach ( $bloguser as $user ) {

   //Monthly Subscribers
   if ($user->user_plan == 'month' and date('Y-m-d H:m:s') - $user->user_registered > 30){
   $id = ($user->ID); 
       wp_delete_user($id);
   }

   //Yearly Subscribers
   if ($user->user_plan == 'year' and date('Y-m-d H:m:s') - $user->user_registered > 365){
   $id = ($user->ID); 
       wp_delete_user($id);
   }
             }
}
add_action('wp_footer','delete_users');