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 unused methods and classes for initial setup #550

Merged
merged 1 commit into from
Oct 2, 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
46 changes: 29 additions & 17 deletions lib/initial-setup/WP_Auth0_InitialSetup_Connections.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,28 @@ public function render( $step ) {
include WPA0_PLUGIN_DIR . 'templates/initial-setup/connections.php';
}

public function callback() {
wp_redirect( admin_url( 'admin.php?page=wpa0-setup&step=5' ) );
}

public function add_validation_error( $error ) {
wp_redirect(
admin_url(
'admin.php?page=wpa0-setup&step=5&error=' .
urlencode( 'There was an error setting up your connections.' )
)
);
exit;
}

/**
* TODO: Deprecate, not used
* @deprecated - 3.8.0, not used and no replacement provided.
*
* @codeCoverageIgnore - Deprecated
*/
public function update_connection() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );

$provider_name = $_POST['connection'];

Expand All @@ -27,9 +45,13 @@ public function update_connection() {
}

/**
* TODO: Deprecate when self::update_connection() is deprecated
* @deprecated - 3.8.0, not used and no replacement provided.
*
* @codeCoverageIgnore - Deprecated
*/
protected function toggle_db() {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );

$domain = $this->a0_options->get( 'domain' );
$app_token = $this->a0_options->get( 'auth0_app_token' );
Expand Down Expand Up @@ -61,9 +83,13 @@ protected function toggle_db() {
}

/**
* TODO: Deprecate when self::update_connection() is deprecated
* @deprecated - 3.8.0, not used and no replacement provided.
*
* @codeCoverageIgnore - Deprecated
*/
protected function toggle_social( $provider_name ) {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );

$provider_options = array(
'facebook' => array(
Expand Down Expand Up @@ -108,18 +134,4 @@ protected function toggle_social( $provider_name ) {

exit;
}

public function callback() {
wp_redirect( admin_url( 'admin.php?page=wpa0-setup&step=5' ) );
}

public function add_validation_error( $error ) {
wp_redirect(
admin_url(
'admin.php?page=wpa0-setup&step=5&error=' .
urlencode( 'There was an error setting up your connections.' )
)
);
exit;
}
}
10 changes: 9 additions & 1 deletion lib/initial-setup/WP_Auth0_InitialSetup_Migration.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<?php
/**
* TODO: Deprecate, not used
* @deprecated - 3.8.0, not used and no replacement provided.
*
* @codeCoverageIgnore - Deprecated
*/
class WP_Auth0_InitialSetup_Migration {

protected $a0_options;

/**
* @deprecated - 3.8.0, not used and no replacement provided.
*/
public function __construct( WP_Auth0_Options $a0_options ) {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );

$this->a0_options = $a0_options;
}

Expand Down
10 changes: 9 additions & 1 deletion lib/initial-setup/WP_Auth0_InitialSetup_Rules.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
<?php
/**
* TODO: Deprecate, not used
* @deprecated - 3.8.0, not used and no replacement provided.
*
* @codeCoverageIgnore - Deprecated
*/
class WP_Auth0_InitialSetup_Rules {

protected $a0_options;

/**
* @deprecated - 3.8.0, not used and no replacement provided.
*/
public function __construct( WP_Auth0_Options $a0_options ) {
// phpcs:ignore
trigger_error( sprintf( __( 'Method %s is deprecated.', 'wp-auth0' ), __METHOD__ ), E_USER_DEPRECATED );

$this->a0_options = $a0_options;
}

Expand Down