Ticket #5405 (closed task: fixed)

Opened 7 months ago

Last modified 4 months ago

Refactor wp-login.php

Reported by: westi Assigned to: westi
Priority: normal Milestone: 2.5
Component: Optimization Version:
Severity: normal Keywords:
Cc:

Description

wp-login.php has a lot of code in it's case statement and it would be good to refactor it so that the different actions are handled by functions.

Attachments

wp-login.diff (27.6 kB) - added by ryan on 01/22/08 04:56:30.

Change History

11/30/07 23:26:03 changed by santosj

Dude. You've totally read my mind.

There have been a couple of times where I'm all like, "Damn it, I'm doing this, I'm refactoring this mess!"

Then looking through everything, I realize it isn't that bad and while there are somethings that would better be in a function, a lot of the code is presentation and can't easily be placed in a function or I can't think of a reason.

However, where I was coming from was refactoring the current stuff, the viewpoint might be to add in additional features or something.

01/22/08 04:56:30 changed by ryan

  • attachment wp-login.diff added.

01/22/08 05:04:05 changed by ryan

Patch moves the POST handling code into functions, making the template-y bits easier to read. retrieve_password(), reset_password(), and register_new_user() are defined at the top of the file. All of them return WP_Error objects in the event of an error. wp_signon() is defined in user.php and is meant to be reusable. The logout code moved into a wp_logout() pluggable function. wp_login() is deprecated in favor of the new wp_authenticate() function which returns a WP_Error object rather than setting an $error global.

01/22/08 19:35:19 changed by ryan

(In [6643]) Refactor login. see #5405

01/23/08 01:59:38 changed by darkdragon

Yeah. Hmm.

I probably should have suggested a couple of things earlier, but I'll just make a patch instead.

01/23/08 02:00:03 changed by darkdragon

I will say that it is awesomely sweet and the suggestions are minor.

01/23/08 02:31:24 changed by lloydbudd

  • milestone changed from 2.6 to 2.5.

01/23/08 18:20:59 changed by ryan

(In [6644]) Pass remember arg. see #5405

01/23/08 18:22:22 changed by ryan

Urg, stuff for #5439 slipped in. Only the user.php change is pertinent.

03/20/08 01:44:03 changed by ffemtcj

  • status changed from new to closed.
  • resolution set to fixed.