'activate_license', 'license' => $license, 'item_name' => urlencode( WPRSS_ET_SL_ITEM_NAME ) // the name of our product in EDD ); } else if ( isset( $_POST['wprss_et_license_deactivate'] ) ) { // data to send in our API request $api_params = array( 'edd_action'=> 'deactivate_license', 'license' => $license, 'item_name' => urlencode( WPRSS_ET_SL_ITEM_NAME ) // the name of our product in EDD ); } // Call the custom API. $response = wp_remote_get( add_query_arg( $api_params, WPRSS_ET_SL_STORE_URL ) ); // make sure the response came back okay if ( is_wp_error( $response ) ) return false; // decode the license data $license_data = json_decode( wp_remote_retrieve_body( $response ) ); // $license_data->license will be either "active" or "inactive" update_option( 'wprss_et_license_status', $license_data->license ); } }