Title: Bug in function definition
Last modified: September 14, 2022

---

# Bug in function definition

 *  Resolved [Daniele](https://wordpress.org/support/users/dabesa/)
 * (@dabesa)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/bug-in-function-definition/)
 * Dear support,
 * We found that WP-Appbox is defining a WordPress function incorrectly.
    This is
   affecting WPremote plugin, that is using that function if available causing a
   fatal error.
 * ‘ Got error ‘PHP message: PHP Fatal error: Uncaught Error: Call to undefined 
   function wp_get_current_user() in /var/www/vhosts/<site>/httpdocs/wp-content/
   plugins/wp-appbox/wp-appbox.php:102\nStack trace:\n#0 /var/www/vhosts/<site>/
   httpdocs/wp-content/plugins/wpremote/protect/fw/fw.php(182): is_user_logged_in()\
   n#1 /var/www/vhosts/<site>/httpdocs/wp-content/plugins/wpremote/protect/fw/fw.
   php(188): BVFW->canLog()\n#2 [internal function]: BVFW->log()\n#3 {main}\n thrown
   in /var/www/vhosts/<site>/httpdocs/wp-content/plugins/wp-appbox/wp-appbox.php
   on line 102′, referer: [https://<site>/&#8217](https://<site>/&#8217);
 * WP-appbox plugin is defining the following function in the wp-appbox/wp-appbox.
   php file.
    if ( !function_exists(‘is_user_logged_in’) ) : function is_user_logged_in(){
   $user = wp_get_current_user(); if ( empty( $user->ID ) ) return false; return
   true; } endif;
 * Now anyone using this function will face the same issue.
 * Can you issue a fix?
 * Thanks!
    Daniele
    -  This topic was modified 3 years, 8 months ago by [Daniele](https://wordpress.org/support/users/dabesa/).
      Reason: hidden site with

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Marcelismus](https://wordpress.org/support/users/marcelismus/)
 * (@marcelismus)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/bug-in-function-definition/#post-16014215)
 * Old and unused function, therefore removed with 4.4.7. So should run again.
 *  Thread Starter [Daniele](https://wordpress.org/support/users/dabesa/)
 * (@dabesa)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/bug-in-function-definition/#post-16015253)
 * Perfect, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug in function definition’ is closed to new replies.

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

 * 3 replies
 * 2 participants
 * Last reply from: [Daniele](https://wordpress.org/support/users/dabesa/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/bug-in-function-definition/#post-16015253)
 * Status: resolved