send email to all registered users when post expires

Don’t do this if you have too many registered users on the site. Below is the edited portion from your code.

} elseif( ! $gone && ( $is_stats || $is_cm ) ) {
   // we are in 3 days frame and trying to access to stats => redirect to post

   // Start the code to send the emails
   $subject="3 days have passed";
   $users = get_users();
   foreach($users as $user) {
      $message="Hello ".$user->display_name.', '.PHP_EOL;
      $message .= 'The 3 days have past since the post.';
      wp_mail($user->user_email, $subject, $message);
   }
   // End the code to send the emails

   wp_redirect( $pl );
   exit();
}