Title: PHP Warning
Last modified: November 15, 2025

---

# PHP Warning

 *  [osti47](https://wordpress.org/support/users/osti47/)
 * (@osti47)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-556/)
 * Hi,
 * i am getting this PHP warning when not logged in:
 * Warning: Undefined variable $status in /wp/wp-content/plugins/wp-members/includes/
   api/api.php on line 411

Viewing 1 replies (of 1 total)

 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [6 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-556/#post-18720654)
 * That comes from the API function wpmem_login_status(), which I presume you’re
   using somewhere in custom code or something.
 * Interestingly, it is not used within the plugin itself – it’s just a useable 
   function for customization. It has been in the plugin since version 2.0 and as
   an API function since 3.1, which means it has been there for well over a decade
   and no one has mentioned this issue up until now, which means it is likely not
   used by all that many people.
 * The problem is that $status is defined only when the user is logged in, but it
   is used in the return value even if the user is not logged in, so it is undefined
   when not logged in.
 * I will correct this in the next version of the plugin – either by adding a logged
   out state, or by creating a null value for the logged out state. In the meantime,
   you can edit the function in api.php. In the function `wpmem_login_status()`,
   right after the following line:
 *     ```wp-block-code
       global $user_login;
       ```
   
 * add the following:
 *     ```wp-block-code
       $status = '';
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘PHP Warning’ is closed to new replies.

 * ![](https://ps.w.org/wp-members/assets/icon-256x256.png?rev=1226414)
 * [WP-Members Membership Plugin](https://wordpress.org/plugins/wp-members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-members/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-members/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * Last activity: [6 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-556/#post-18720654)
 * Status: not resolved