Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved code quality in WP_Auth0_LoginManager #437

Merged
merged 1 commit into from
Apr 18, 2018

Conversation

joshcanhelp
Copy link
Contributor

Very minimal functional changes, mostly comments.

  • Added docblocks, parameter + error descriptions, and better inline comments
  • Renamed internal variables to conform to snake_case and better describe what they're for
  • Changed urlencode -> rawurlencode per phpcs suggestion (RFC-compliant encoding, improves interoperability)
  • Changed die() -> exit for standardization (identical functionality)
  • Changed json_encode() to wp_ json_encode() to catch more problematic encoding

@joshcanhelp joshcanhelp added this to the v3-Next milestone Apr 17, 2018
@@ -61,38 +126,43 @@ public function login_auto() {
// Create the link to log in.
$login_url = 'https://' . $this->a0_options->get( 'domain' ) .
'/authorize?' .
'scope=' . urlencode( $options['auth']['params']['scope'] ) .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@cocojoe cocojoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of periods.

*
* @see WP_Auth0_LoginManager::init()
*/
public function auth0_singlelogout_footer() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have changed the signature here, sneaky. This looks like an internal method though so fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's hooked to the wp_footer action, which does not pass any arguments to that function so that wasn't doing anything anyways. I was talking about this with @lbalmaceda, these callbacks have to be public to be hooked but I can't think of a use case where someone would call this directly, let alone have any use for an already non-functioning parameter.

@joshcanhelp joshcanhelp merged commit f8a6cbe into dev Apr 18, 2018
@joshcanhelp joshcanhelp deleted the fix-phpcs-scan-wp-auth-loginmanager branch April 18, 2018 15:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants