Skip to:
Content
Pages
Categories
Search
Top
Bottom

Bug: An Error after Click the Activation Link in Email

  • Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    Hi @r-a-y or anyone

    Urgent! I can’t launch the site without fix this bug. I just was testing to complete sign-up and click activation link in the email. I get an error:

    `Warning: Cannot modify header information – headers already sent by (output started at /path/wordpress/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php:3) in /path/wordpress/wp-includes/pluggable.php on line 897`

    This warning doesn’t tell where the problem was causing the error. It takes me awhile to find the problem. These codes are working from “Duplicate Content: Slash and No Slash at the End of URL” but I found the problem either in functions.php or bp-custom.php or buddypress/bp-core/bp-core-catchuri.php is the same an errors when I clicked the activation link.

    `function bp_core_redirect_canonical() {
    if ( bp_is_blog_page() )
    return;

    add_action( ‘get_header’, ‘redirect_canonical’, 0 );
    }
    add_action( ‘bp_loaded’, ‘bp_core_redirect_canonical’ );`

    OR

    `function bp_core_redirect_canonical() {
    if ( bp_is_blog_page() )
    return;

    add_action( ‘get_header’, ‘redirect_canonical’, 0 );
    }
    add_action( ‘init’, ‘bp_core_redirect_canonical’ );`

    When I deleted the above code the activation link in email is working. Can you fix the above code that I need it before launching the site?

    Thanks, Mikey3D

Viewing 10 replies - 1 through 10 (of 10 total)
  • Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    I got it working by add rewrite rules trailing slash to the end of the URL in .htaccess:

    `
    RewriteEngine On
    RewriteBase /blog/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ http://domain.com/blog/$1/ [L,R=301]
    `

    Make sure the above codes are before the # BEGIN WordPress rewrite rules.

    Don’t use @r-a-y codes.

    Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    I was just looking for BuddyPress or WordPress sites if they have the end of redirect trailing slash URL without duplicate content:

    Who doesn’t have the redirect to trailing slash?

    http://bp-tricks.com/members
    http://commons.gc.cuny.edu/members
    http://savannahvideocentral.com/members
    http://yoast.com/articles/wordpress-seo

    Only this has working:

    http://wordpress.org/about/philosophy

    Most of them don’t even know the problem.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Not sure why this is a problem? the trailing slash is in essence a nicety in that it means one is asking for a directory rather than a file and it helps the server otherwise the server first searches for a file named /foo before checking if /foo is actually a directory /foo/ but you’re right although all my test sites links terminate correctly / I can manually write the url without and it’s not added but it doesn’t cause any issues – however I may well be missing the point of what you are explaining

    Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    To avoid having the duplicate content, you only need one content and not to have the same two content. Ex. the two different URLs that have the same content:

    http://bp-tricks.com/members
    http://bp-tricks.com/members/

    You need to 301s redirect to trailing slash at the end of URLs to one of content.

    Avatar of Hugo
    Hugo
    Moderator

    @hnla

    Oh ok ; yes I’m with you now, usually think of duplicate content from the perspective of www and non www it’s really googles issue though, the url refers to the same thing ultimately.

    However google trawls links in a page and the links are trailing slashed, from the perspective of inbound links that might not have the trailing slash added it could be an issue I guess.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Don’t use @r-a-y codes

    @mikey3d – Is that a general recommendation? ;)

    I did say it was test code. Looks like you have whitespace issues in your /registration/activate.php. Delete any trailing whitespace from the beginning of that file.

    eg.
    `   -spaces – <?php` – Delete that trailing space!

    Your htaccess rewrite rules look like it will interfere with querystring variables.
    eg. example.com/my-page/?variable=my-test

    Avatar of stwc
    stwc
    Participant

    @stwc

    `Warning: Cannot modify header information – headers already sent by (output started at /path/wordpress/wp-content/plugins/buddypress/bp-themes/bp-default/registration/activate.php:3) in /path/wordpress/wp-includes/pluggable.php on line 897`

    As @r-a-y suggests, in my experience at least, that kind of error is almost always malformed PHP files — trailing spaces, unclosed brackets, stuff like that. If you’ve pasted functions into your functions.php or bp-custom.php, look there first, then any other template files you’ve edited.

    Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    @r-a-y

    “Is that a general recommendation? ;)

    :-) – No! However I have only been using your two codes that works but after awhile when I found the bugs it’s causing of your codes.

    1. Duplicate Content: Slash and No Slash at the End of URL
    2. The page isn’t redirecting properly

    “I did say it was test code. Looks like you have whitespace issues in your /registration/activate.php. Delete any trailing whitespace from the beginning of that file.”

    I did put back the function bp_core_redirect_canonical in functions.php and deleted redirect trailing slash in .htaccess before process your above posted. It is the same problem I had it before except no warning error show up, only missed a key link in the domain link.

    I haven’t touch activate.php in bp-default therefore when I looked for trailing space, it looks like this:

    `

    `

    If that is what you were talking about I deleted the whole line 1 and I tested it again and result I get when click the activation link in email:

    http://www.domain.com/blog/activate/

    `Activate your Account

    Please provide a valid activation key.
    Activation Key:`

    There is no key link in the domain. e.g.

    http://www.domain.com/blog/activate?key=afd7528c3b5664d429f94a2ed59a4c32

    The line 1 in activate.php said “This template is only used on multisite installations.” I have single WordPress. Does it matter? All those error the user still able get in after clicked the activation link in the email. Huh?

    Is there a fix? What is the solution for Single WP after user completed sign-up?

    “Your htaccess rewrite rules look like it will interfere with querystring variables.
    eg. example.com/my-page/?variable=my-test”

    Ha, thanks for noticed.

    Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    @stwc

    `As r-a-y suggests, in my experience at least, that kind of error is almost always malformed PHP files — trailing spaces, unclosed brackets, stuff like that. If you’ve pasted functions into your functions.php or bp-custom.php, look there first, then any other template files you’ve edited.`

    There was no error in my functions.php, bp-custom.php and template files. The warning error, above in my first posted, was possible from the core bp-default /registration/activate.php.

    Avatar of @mikey3d
    @mikey3d
    Participant

    @mikey3d

    @r-a-y haven’t responded my above message. Is he embarrassing that he is wrong? Because either activate.php file is the bp-default theme which is not my problem and I have delete the whole first two lines in my child theme /registration/activate.php and the problem is after clicked activation link in email I get:

    `http://www.domain.com/blog/activate/

    Activate your Account

    Please provide a valid activation key.
    Activation Key:`

    There is no key link in the domain. e.g.

    http://www.domain.com/blog/activate?key=afd7528c3b5664d429f94a2ed59a4c32

    I have single WP. What is the solution?

    Thanks, Mikey3D

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

You must be logged in to reply to this topic.