| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) exit; |
| 2 |
$license = trim( get_option( 'wow_license_key_'.self::PREF ) ); |
| 3 |
$api_params = array( |
| 4 |
'edd_action'=> 'deactivate_license', |
| 5 |
'license' => $license, |
| 6 |
'item_name' => urlencode( $this->name ), |
| 7 |
'url' => home_url() |
| 8 |
); |
| 9 |
$response = wp_remote_post( WOW_ESTORE, array( 'timeout' => 15, 'sslverify' => false, 'body' => $api_params ) ); |
| 10 |
// decode the license data |
| 11 |
$license_data = json_decode( wp_remote_retrieve_body( $response ) ); |
| 12 |
// $license_data->license will be either "deactivated" or "failed" |
| 13 |
if( $license_data->license == 'deactivated' ) { |
| 14 |
delete_option( 'wow_license_status_'.self::PREF ); |
| 15 |
} |
| 16 |
?> |
| 17 |
|