So. I made the decision to remake these question for clarification.

Background:

  • Wordpress plugin according to an MVC architecture.
  • You are able to register customers.
  • A person have to activate their account.

Problem:

When one clicks the hyperlink in the email the user recieve they arrive at the correct page, get no php errors. However the account has already been triggered. That's everything works just like the page is first tell you but no output, then tell you again which is displayed towards the user.

I've through var_dump, echo and print_r() determined the account is triggered before my wordpress plugin is even initialized, so its no problem during my code..

Codeflow:

  1. Within the cause of the wordpress plugin: $controller = new Controller()

  2. Controller hooks $controller->init() to init

  3. init() runs $get_handler->handle($_GET) where $get_handler is instanced in $controller->__construct()

  4. The handler triggers $get_handler->activate() when $_GET['activation_key'] is placed and never empty string

But so far as i can tell this code operates two times, for no no reason.

I recieve 2 messages, wich is added into _SESSION until displayed.

The very first saying the account is triggered, the 2nd stating that the account has already been triggered.

Is how wordpress always will it? It is possible to deal with? Why I do not have this issue elsewhere on the website? Can there be any Wordpress hooks which are run two times?

Edit:

Appears like its only if klicking the hyperlink in the mail, thus opening a brand new tab. Basically reload the tab everything works fine. I am using gmail, does gmail run the page before showing it?

Appears like i happened upon an answer.

There is a slash missing. A SLASH!

This link is correct:

http://www.page.com/permalink/?activation_key=2ad60f33
                             ^

This link triggers dual messages:

http://www.page.com/permalink?activation_key=2ad60f33