royboy789 / wp-api-social-login

Using WP-API and Hello.js to create seamless login and registration via social channels
GNU General Public License v3.0
40 stars 4 forks source link

Clean up social-routes.php #1

Closed carlalexander closed 9 years ago

carlalexander commented 9 years ago

So as a first step, you should always look to reduce your code to its essential "essence". This allows you to have a better view of the larger picture. It's important because that's how you'll find patterns to build your classes.

I removed the unused global. I also restructured your code so that we could see an initial state when the function started. I came to notice that you reused the same bit of code for your response. I moved that to its own function.

Make sure to test it. I might have inserted a bug. I just edited the file directly on GitHub :joy: