WordPress.org

Ready to get started?Download WordPress

Forums

WP User Frontend
WP user frontend : headers already sent out ... (10 posts)

  1. llby
    Member
    Posted 3 years ago #

    Hi,

    Very nice plugin, exactly what I would need.
    Two things :
    - The shortcode to the plugin is wpuf and not wpfu .. but I figured it out, thanks to the others topics.
    - I tried to "manage" some things (like not showing the contacts info aim messenger etc .... which my users don't care about. When I update my profile without changing the password, everything's fine. But when I change the password, I've got a lot of these lines :

    "Warning: Cannot modify header information - headers already sent by (output started at /homez.403/amicalead/www/word/wp-content/themes/arthemia/header.php:2) in /homez.403/amicalead/www/word/wp-includes/pluggable.php on line 720"

    I can't see if it's from the theme, the plugin, ... could it because I removed the lines showing the contacts (I don't think so) ?

    (note : the password is updated all good)

    If someone has the answer .... thank you !

  2. dax702
    Member
    Posted 2 years ago #

    I'm having the exact same problem as you I think. I removed the plugin, but the header problem is still happening.. Did you find a solution?

  3. llby
    Member
    Posted 2 years ago #

    Hi,

    No solution.

    [Edit] :
    I wrote that I was using the backend but in fact, for the user profile, I'm using Frontend Edit Profile. I have bo solution for posting an article from the front end.

    Sorry ;)

  4. Tareq Hasan
    Member
    Plugin Author

    Posted 2 years ago #

    To Fix the header already sent message:

    Open wpuf-add-post.php and you'll see this code:

    function wpuf_add_post_shorcode() {
        wpuf_auth_redirect_login(); // if not logged in, redirect to login page
        nocache_headers();
        wpuf_add_post();
        add_action('wp_footer', 'wpuf_post_form_style');
    }

    replace this code with this one

    function wpuf_add_post_shorcode() {
        if ( is_user_logged_in() ) {
            wpuf_add_post();
            add_action('wp_footer', 'wpuf_post_form_style');
        } else {
            printf( __( "This page is restricted. Please %s to view this page.", 'wpuf' ), wp_loginout( get_permalink(), false ) );
        }
    }

    wpuf-editprofile.php
    replace the wpuf_user_edit_profile() function with this one

    function wpuf_user_edit_profile() {
        if ( is_user_logged_in() ) {
            wpuf_post_form_style();
            wpuf_user_edit_profile_form();
        } else {
            printf( __( "This page is restricted. Please %s to view this page.", 'wpuf' ), wp_loginout( get_permalink(), false ) );
        }
    }

    wpuf-edit-post.php
    replace the wpuf_edit_post_shorcode() function with this one

    function wpuf_edit_post_shorcode() {
        if ( is_user_logged_in() ) {
            wpuf_edit_post();
            add_action('wp_footer', 'wpuf_post_form_style');
        } else {
            printf( __( "This page is restricted. Please %s to view this page.", 'wpuf' ), wp_loginout( get_permalink(), false ) );
        }
    }
  5. Treebeard
    Member
    Posted 2 years ago #

    Looks like that fixed the issue, thanks Tareq!

  6. Treebeard
    Member
    Posted 2 years ago #

    NO, sorry, I take that back. It's still broken :(

    Does anyone have a solution to this issue with the Warning?

    Warning: Cannot modify header information - headers already sent by (output started at /home/admin/public_html/wp-content/plugins/seo-ultimate/modules/titles/titles.php:132) in /home/admin/public_html/wp-includes/pluggable.php on line 934

    Even if you disable / delete all the plugins, that message just changes to something else, but it's still the same warning with the header information thing.

    Anyone? Please? It's a live site with tons of traffic (like 30,000 people are members already) and I don't have a solution to this...

    OH and 1 more thing: The warning only appears when I'm not logged in to the admin, but it looks fine when I'm logged in as an admin... so strange...

    thanks in advance.

  7. Tareq Hasan
    Member
    Plugin Author

    Posted 2 years ago #

    You said after deleting all the plugins, you still have the issue. So how come you think that it's the issue by my plugin, thats ridiculous. Try to fix your theme itself.

  8. Treebeard
    Member
    Posted 2 years ago #

    Not a very nice tone of voice in your response, but perhaps you're just having a bad day. Tareq, it is your plugin. I specialize in WordPress website design, have tested tons of plugins, and I've been doing this for years. I'm not a newbie.

    It only happens on the pages with your plugin shortcode. The rest of the site is fine, but the pages with WP User Frontend code are showing this Warning message. All the other plugins are fine too, none of the other pages in the site have any issues.

    When I added your code above, it fixed the issue, then reverted back to the Warning later in the day, then I applied it again, and so far it's still fine. So obviously, it was your plugin, otherwise the code update wouldn't have fixed the Warning. I just don't know why the Warning came back again later, so I'm wondering if there's a security issue involved with the plugin. You may want to check your code and make sure there are no security issues, because obviously I'm not the only one that's mentioned this problem. Remember, your response above was not to my question, it was to someone else's - same issue..

  9. Tareq Hasan
    Member
    Plugin Author

    Posted 2 years ago #

    Sorry if I hurt you. But when you said after deleting all the plugins you still got the problem, I couldn't resist.

    Because when you deactivate the plugin, no interaction happens between WordPress and that plugin. Only one position the header already sent message shows in the plugin, when you are not logged in. Becuase it detects if you are loggedin or not, if not, it tries to redirect the user to the login page. But in some themes, the redirection doesn't work, because the theme already prints some informations before the redirection code, so the warning message shows instead. If you think it's a security issue, don't worry, its not a security issue at all. It just wants you to redirect, but fails, nothing more than that.

    The code I posted above, that solves the problem. In those codes, it doesn't try to redirect you, but just shows a message that you need to be loggedin to use the page. So it cuts off the origin from where it was generating.

    Warning: Cannot modify header information - headers already sent by (output started at /home/admin/public_html/wp-content/plugins/seo-ultimate/modules/titles/titles.php:132) in /home/admin/public_html/wp-includes/pluggable.php on line 934
    By seeing this code, it seems like the problem is occuring from /wp-content/plugins/seo-ultimate/modules/titles/titles.php:132 and I don't think it's from my plugin anymore.

  10. Treebeard
    Member
    Posted 2 years ago #

    Misunderstanding - I was typing a little fast. What I meant was that I disabled all the OTHER plugins and narrowed it down to this one. The message changed every time I disabled a plugin, it would mention a different one so the Warning I pasted above was just an example. However, the code fix you posted seems to be working. It hasn't reverted back to the warning again. The theme is custom coded (I don't use templates). I'm not a php programmer, so I'll take your word for it about the headers and redirects (not that I fully understand it) but at least it's fixed now. If you say there's no security issues, great, I'll let the client know. Thanks for getting back to me again with more information.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic