Support » Fixing WordPress » Update 5.3: “headers already sent”-failure

  • MimmiN

    (@mimmin)


    After upgrading to 5.3 from WordPress backend I get a lot of failure-messages “headers already sent”. I have both tried to upgrade and deactivate all plugins. And I have tried to switch templates.

    Notice: add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be an integer representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.) in /home/3/d/dotl/www/wp-includes/functions.php on line 4903

    Warning: Cannot modify header information – headers already sent by (output started at /home/3/d/dotl/www/wp-includes/functions.php:4903) in /home/3/d/dotl/www/wp-includes/functions.php on line 5946

    Warning: Cannot modify header information – headers already sent by (output started at /home/3/d/dotl/www/wp-includes/functions.php:4903) in /home/3/d/dotl/www/wp-admin/includes/misc.php on line 1252

    Warning: Cannot modify header information – headers already sent by (output started at /home/3/d/dotl/www/wp-includes/functions.php:4903) in /home/3/d/dotl/www/wp-includes/pluggable.php on line 1265

    Warning: Cannot modify header information – headers already sent by (output started at /home/3/d/dotl/www/wp-includes/functions.php:4903) in /home/3/d/dotl/www/wp-includes/pluggable.php on line 1268

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Farhad

    (@farhadvn)

    Please clear cache of site, sign out, clear cache of browser, login and check again.

    MimmiN

    (@mimmin)

    Thank you. I suddenly had to run so I forgot to write that I have tried to login in a different browser, one I never used at this site. I guess that is equal to:

    clear cache of site, sign out, clear cache of browser, login and check again

    Or not?

    Farhad

    (@farhadvn)

    Yes, try it. Also save Permalinks again.
    You can reinstall wordpress in update center also.

    Try wordpress default theme also.


      + P.S: as i saw, there is many same error that is by themes and plugins, so
      try check your theme.

    • This reply was modified 1 month ago by Farhad.
    MimmiN

    (@mimmin)

    I have downloaded the problematic files to see what fails.
    wp-includes/functions.php on line 5946 is the line starting with header here:

    /**
    * Send a HTTP header to limit rendering of pages to same origin iframes.
    *
    * @since 3.1.3
    *
    * @see https://developer.mozilla.org/en/the_x-frame-options_response_header
    */
    function send_frame_options_header() {
    header( ‘X-Frame-Options: SAMEORIGIN’ );
    }

    wp-admin/includes/misc.php on line 1252

    /**
    * Filters the admin referrer policy header value.
    *
    * @since 4.9.0
    * @since 4.9.5 The default value was changed to ‘strict-origin-when-cross-origin’.
    *
    * @link https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
    *
    * @param string $policy The admin referrer policy header value. Default ‘strict-origin-when-cross-origin’.
    */
    $policy = apply_filters( ‘admin_referrer_policy’, $policy );

    header( sprintf( ‘Referrer-Policy: %s’, $policy ) );
    }

    wp-includes/pluggable.php on line 1265 and 1268

    /**
    * Filters the X-Redirect-By header.
    *
    * Allows applications to identify themselves when they’re doing a redirect.
    *
    * @since 5.1.0
    *
    * @param string $x_redirect_by The application doing the redirect.
    * @param int $status Status code to use.
    * @param string $location The path to redirect to.
    */
    $x_redirect_by = apply_filters( ‘x_redirect_by’, $x_redirect_by, $status, $location );
    if ( is_string( $x_redirect_by ) ) {
    header( “X-Redirect-By: $x_redirect_by” );
    }

    header( “Location: $location”, true, $status );

    return true;

    Farhad

    (@farhadvn)

    @mimmin Do you checked it with default theme?

    MimmiN

    (@mimmin)

    I saw your P.S. now. I tried to activate the 2015-theme earlier and the fail continued. Now I tried the 2020-theme and that worked! I will contact the creators of Great Lotus theme and ask them to upgrade.

    Thank you very much for your time and effort!

    Farhad

    (@farhadvn)

    @mimmin Ok! Great!
    Hope it fixed soon 🍀

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Hi! You focused on the wrong message.

    This is the one that matters:

    The seventh parameter passed to add_submenu_page() should be an integer representing menu position.

    Somewhere in your plugin or theme, you have a piece of code calling a function in WordPress called add_submenu_page(). That code is doing it wrong, and this check was added in 5.3 to make them fix it. So, you have two real problems here:

    1. The plugin or theme code you’re running is broken. You need to find the makers of that code and ask them to fix it.

    2. You should not have “debug” notices enabled on your site to begin with. The fact that a “Notice” shows up on your live site is a problem. Ask your hosting service how you can edit the PHP.INI file to turn off the display_errors setting, since that should never, ever, be turned on for a live site. Additionally, make sure that you do not have the WP_DEBUG constant turned on in your wp-config.php file.

    Farhad

    (@farhadvn)

    @otto42 yes it is another bug that is by theme. (Reported many times in other themes & plugins)

    Simple when an error is in core, not important which line, its from plugins or theme.

    (I think its better lock This conversation, the problem was found.)

    MimmiN

    (@mimmin)

    Thank you, further investigation shows it’s a problem both with theme and plugin:

    • Theme Great Lotus by Ancora
    • Plugin ThemeREX Addons
    • Plugin ThemeREX Donations

    I have notified both Ancora and ThemeREX.

    Than you very much for your swift help!

    MimmiN

    (@mimmin)

    @otto42
    Thank you for your warning! I checked my wp-config.php and switched from true to false:
    define('WP_DEBUG', false);

Viewing 11 replies - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.