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

Deprecate 2 lookup methods #446

Merged
merged 1 commit into from
Apr 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,14 @@ function on_activate_redirect( $plugin ) {
}
}

// TODO: Deprecate
/**
* @deprecated 3.6.0 - Use WPA0_PLUGIN_URL constant
*
* @return string
*/
public static function get_plugin_dir_url() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return WPA0_PLUGIN_URL;
}

Expand Down
16 changes: 11 additions & 5 deletions lib/WP_Auth0_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ public function is_wp_registration_enabled() {
return get_site_option( 'users_can_register', 0 ) == 1;
}

// TODO: Deprecate, not used
public function get_enabled_connections() {
return array( 'facebook', 'twitter', 'google-oauth2' );
}

public function set_connection( $key, $value ) {
$options = $this->get_options();
$options['connections'][$key] = $value;
Expand Down Expand Up @@ -252,4 +247,15 @@ protected function defaults() {
'chart_age_step' => '5',
);
}

/**
* @deprecated 3.6.0 - Social connections are no longer set during initial setup so this data is no longer needed.
*
* @return array
*/
public function get_enabled_connections() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );
return array( 'facebook', 'twitter', 'google-oauth2' );
Copy link
Contributor

Choose a reason for hiding this comment

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

is weird that this was (and is) hardcoding an array of enabled connections. I've read the deprecation message. However, are you currently calling this method somewhere in your plugin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't remove it so I'm not entirely sure when or where this was used. I checked through all the functions here and did not see it used anywhere in the code. I think this was part of the initial setup at some point?

This is the case with a number of this deprecations. I didn't remove them and didn't see them used anywhere. If we're not using the method internally, I don't want to maintain it 👍

}
}