Skip to content
Merged
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
6 changes: 6 additions & 0 deletions src/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ protected function send_request( $license_key, $route ) {
* License Refresh Endpoint
*/
public function refresh_license_api() {
if ( ! current_user_can( 'manage_options' ) || ! check_ajax_referer( $this->client->name, '_nonce', false ) ) {
wp_send_json_error( [ 'message' => 'Unauthorized.' ], 403 );
}

$this->check_license_status();

wp_send_json_success(
Expand Down Expand Up @@ -367,6 +371,8 @@ public function check_license_status() {
}

update_option( $this->option_key, $license, false );

$this->is_valid_license = null;
}
}

Expand Down
Loading