Skip to content

Commit

Permalink
fix: remove license related options when deactivated
Browse files Browse the repository at this point in the history
  • Loading branch information
selul committed Sep 24, 2019
1 parent 2a2559a commit d3c1a1f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Modules/Licenser.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,19 @@ function activate_license() {
$this->reset_failed_checks();
}

$this->set_error( '' );

if ( 'deactivate_license' === $api_params['edd_action'] ) {

delete_option( $this->product->get_key() . '_license_data' );
delete_option( $this->product->get_key() . '_license_plan' );
delete_transient( $this->product->get_key() . '_license_data' );

return;
}
if ( isset( $license_data->plan ) ) {
update_option( $this->product->get_key() . '_license_plan', $license_data->plan );
}
$this->set_error( '' );
update_option( $this->product->get_key() . '_license_data', $license_data );
set_transient( $this->product->get_key() . '_license_data', $license_data, 12 * HOUR_IN_SECONDS );

Expand Down

0 comments on commit d3c1a1f

Please sign in to comment.