I have located the file which initiating the activation process. please review the file and made the necessary changes.
Also, I not fully sure that the file I have attached is the only file initiating the activation process. So please correct me if I am wrong.
PFA.
Also, you can find the codes below:
<?php defined( 'ABSPATH' ) OR die( 'This script cannot be accessed directly.' );
/**
* About admin page
*/
add_action( 'admin_menu', 'us_add_info_home_page', 50 );
function us_add_info_home_page() {
add_submenu_page( 'us-theme-options', US_THEMENAME . ': Home', us_translate_x( 'About', 'personal data group label' ), 'manage_options', 'us-home', 'us_welcome_page', 11 );
}
function us_welcome_page() {
// Predefined URLs
$help_portal = 'https://help.us-themes.com';
$help_portal_api_url = '
https://help.us-themes.com/envato_auth';
$urlparts = parse_url( site_url() );
$domain = $urlparts['host'];
$return_url = admin_url( 'admin.php?page=us-home' );
if ( ! empty( $_GET['activation_action'] ) ) {
if ( $_GET['activation_action'] == 'activate' AND ! empty( $_GET['secret'] ) ) {
$url = $help_portal_api_url . '?secret=' . $_GET['secret'] . '&domain=' . $domain;
$response = us_api_remote_request( $url );
if ( $response == '1' ) {
update_option( 'us_license_activated', 1 );
update_option( 'us_license_secret', $_GET['secret'] );
delete_transient( 'us_update_addons_data_' . US_THEMENAME );
}
}
} elseif ( get_option( 'us_license_activated', 0 ) == 1 ) {
$url = $help_portal_api_url . '?secret=' . get_option( 'us_license_secret' ) . '&domain=' . $domain;
$response = wp_remote_get( $url );
if ( ! is_wp_error( $response ) ) {
if ( $response['body'] != '1' ) {
update_option( 'us_license_activated', 0 );
update_option( 'us_license_secret', '' );
delete_transient( 'us_update_addons_data_' . US_THEMENAME );
}
}
}
?>