Title: Code not working logout
Last modified: July 1, 2020

---

# Code not working logout

 *  Resolved [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/)
 * Yesterday, my snippets work without problems. But, today only work if the user
   is login into wordpress.
 * The problem is that I need the snippets work when the user is logout.
 * Can anybody help me?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcode-not-working-logout%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/code-not-working-logout/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/code-not-working-logout/page/2/?output_format=md)

 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13057651)
 * Hello.
 * Did you change something on the site? Maybe you installed plugins or edited snippets?
   Can you show the settings of snippets?
 *  Thread Starter [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13057741)
 * Thank you for your quick answer.
 * I didn’t install any new plugin, I only updated some plugins include Woody Snippets.
 * I have differents snippets. I show you my login snippet.
 * [My snippet code](http://collabedit.com/44wfv)
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13057829)
 * Nothing has changed in our plugin. Try creating a simple snippet with output 
   to the screen. And check whether it works for unauthorized users?
 *  Thread Starter [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13057850)
 * In my code some parts work fine.
    I did a echo after header function in my code,
   and I saw the result on the website correctly. But the header() function and 
   setcookie aren’t working.
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058069)
 * These functions must be called before any output to the screen. You probably 
   have something displayed on the screen before calling one of these functions.
   You can enable WordPress debugging mode and view PHP error logs
 *  Thread Starter [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058133)
 * I haven’t any code error.
 * The only change did it was update plugin. If it’s error code, the code not works
   with an authorized user too.
 * I activated the debug mode to show errors but wordpress doesn’t show any error
   in my code. It’s very strange.
 * I’m despereta with this problem, because our customers need it this sections 
   to work.
 * You can check into the url: [https://atecresa.com/logincliente/](https://atecresa.com/logincliente/)
   
   User: [cristo@atecresa.com](https://wordpress.org/support/topic/code-not-working-logout/cristo@atecresa.com?output_format=md)
   Pass: ArPBtSJQaDdG
 * The php works because the api return ok, but some part of the code not work.
    -  This reply was modified 5 years, 9 months ago by [cristoto](https://wordpress.org/support/users/cristoto/).
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058212)
 * Enable debug mode – add these lines to the **wp-config.php** file:
 *     ```
       define( 'WP_DEBUG', true ); 
       define( 'WP_DEBUG_LOG', true );
       define( 'WP_DEBUG_DISPLAY', false );
       ```
   
 * After that, try to login. Error messages will appear in the **wp-content/debug.
   log** file. Send them all here
 *  Thread Starter [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058260)
 * The log show these messages
 * [01-Jul-2020 11:24:07 UTC] PHP Warning: call_user_func_array() expects parameter
   1 to be a valid callback, function ‘WordPress_secret’ not found or invalid function
   name in /var/www/html/wp-includes/class-wp-hook.php on line 287
    [01-Jul-2020
   11:24:07 UTC] PHP Notice: Undefined index: back in /var/www/html/wp-content/themes/
   Avada-Child-Theme/functions.php on line 18 [01-Jul-2020 11:24:44 UTC] PHP Warning:
   call_user_func_array() expects parameter 1 to be a valid callback, function ‘
   WordPress_secret’ not found or invalid function name in /var/www/html/wp-includes/
   class-wp-hook.php on line 287 [01-Jul-2020 11:24:44 UTC] PHP Notice: Undefined
   index: back in /var/www/html/wp-content/themes/Avada-Child-Theme/functions.php
   on line 18 [01-Jul-2020 11:24:44 UTC] PHP Warning: Cannot modify header information–
   headers already sent by (output started at /var/www/html/wp-includes/formatting.
   php:5600) in /var/www/html/wp-content/plugins/insert-php/includes/shortcodes/
   shortcode-php.php(52) : eval()’d code on line 2 [01-Jul-2020 11:24:44 UTC] PHP
   Notice: Undefined property: stdClass::$code in /var/www/html/wp-content/plugins/
   insert-php/includes/shortcodes/shortcode-php.php(52) : eval()’d code on line 
   6 [01-Jul-2020 11:24:44 UTC] PHP Warning: Cannot modify header information – 
   headers already sent by (output started at /var/www/html/wp-includes/formatting.
   php:5600) in /var/www/html/wp-content/plugins/insert-php/includes/shortcodes/
   shortcode-php.php(52) : eval()’d code on line 16 [01-Jul-2020 11:24:44 UTC] PHP
   Warning: Cannot modify header information – headers already sent by (output started
   at /var/www/html/wp-includes/formatting.php:5600) in /var/www/html/wp-content/
   plugins/insert-php/includes/shortcodes/shortcode-php.php(52) : eval()’d code 
   on line 18
    -  This reply was modified 5 years, 9 months ago by [cristoto](https://wordpress.org/support/users/cristoto/).
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058289)
 * `[01-Jul-2020 11:24:44 UTC] PHP Warning: Cannot modify header information - headers
   already sent by (output started at /var/www/html/wp-includes/formatting.php:5600)
   in /var/www/html/wp-content/plugins/insert-php/includes/shortcodes/shortcode-
   php.php(52) : eval()'d code on line 16`
    Here it says that it can’t send headers,
   since they have already been sent. Do you run PHP snippets everywhere?
 *  Thread Starter [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058327)
 * No, I only run in a page.
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058449)
 * Take a screenshot of the snippet settings
 *  Thread Starter [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058472)
 * [https://ibb.co/5GtbT6g](https://ibb.co/5GtbT6g) this is my settings for all 
   snippet.
 * [https://ibb.co/DgfLQQC](https://ibb.co/DgfLQQC) this is my plugin settings.
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058502)
 * Everything is clear. The header() and setcookie() functions will not work with
   the shortcode.
    Use Everywhere for php code in a separate snippet.
 *  Thread Starter [cristoto](https://wordpress.org/support/users/cristoto/)
 * (@cristoto)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058555)
 * But before the updated the plugin, the script worked fine with this configuration.
 * If I put the code eveywhere, I need filter that only run in the page “logincliente”
   for example. Is it possible?
 * Is it possible that the problem is for this notice:
    Notice: Undefined property:
   stdClass::$code in /var/www/html/wp-content/plugins/insert-php/includes/shortcodes/
   shortcode-php.php(52) : eval()’d code on line 10
    -  This reply was modified 5 years, 9 months ago by [cristoto](https://wordpress.org/support/users/cristoto/).
 *  [Temyk](https://wordpress.org/support/users/webtemyk/)
 * (@webtemyk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/#post-13058649)
 * Check whether the form has been sent in the code, and only then call header()
   and setcookie(). The form is sent only on the authorization page.
 * > Is it possible that the problem is for this notice:
   >  Notice: Undefined property:
   > stdClass::$code in /var/www/html/wp-content/plugins/insert-php/includes/shortcodes/
   > shortcode-php.php(52) : eval()’d code on line 10
 * This is an error in your snippet in line 10

Viewing 15 replies - 1 through 15 (of 20 total)

1 [2](https://wordpress.org/support/topic/code-not-working-logout/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/code-not-working-logout/page/2/?output_format=md)

The topic ‘Code not working logout’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3475630)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 20 replies
 * 2 participants
 * Last reply from: [cristoto](https://wordpress.org/support/users/cristoto/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/code-not-working-logout/page/2/#post-13061951)
 * Status: resolved