• 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 13 replies - 1 through 13 (of 13 total)
  • Farhad

    (@farhadvn)

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

    Thread Starter 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 5 years ago by Farhad.
    Thread Starter 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?

    Thread Starter 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)

    www.remarpro.com 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.)

    Thread Starter 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!

    Thread Starter MimmiN

    (@mimmin)

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

    @mimmin by doing define('WP_DEBUG', false); you will just hide the error on front end and back-end but in error log file it will continue. So better to solve the issue rather then hiding it.

    And solution is very simple… downgrade the PHP version. And this kind of error is mostly showing in PHP 7.3 version. So my advice downgrade to 7.0 or 7.2 till get solved.

    And this to be solve by plugins and theme’s developers. ?? Cheers!

    I can confirm that the issue for me is ThemeREX

    #0 _doing_it_wrong() called at [/var/www/html/wp-admin/includes/plugin.php:1385]  
    
    #1 add_submenu_page() called at [/var/www/html/wp-admin/includes/plugin.php:1506]  
    
    #2 add_theme_page() called at [/var/www/html/wp-content/plugins/trx_addons/includes/plugin.options.customizer.php:27]  
    
    #3 trx_addons_add_menu_items() called at [/var/www/html/wp-includes/class-wp-hook.php:288]  
    
    #4 WP_Hook->apply_filters() called at [/var/www/html/wp-includes/class-wp-hook.php:312] 
Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Update 5.3: “headers already sent”-failure’ is closed to new replies.