false ) ); if ( is_wp_error( $licenseValid ) ) { /** @var WP_Error $licenseValid */ /** Couldn't connect to the API URL - possible because wp_remote_get failed for whatever reason. Maybe CURL not activated on server, for instance */ $response = new stdClass(); $response->success = 0; $response->reason = sprintf( __( "An error occurred while connecting to the license server. Error: %s. Please login to thrivethemes.com, report this error message on the forums and we'll get this sorted for you", 'thrive' ), $licenseValid->get_error_message() ); return $response; } $response = @json_decode( $licenseValid['body'] ); if ( empty( $response ) ) { $response = new stdClass(); $response->success = 0; $response->reason = sprintf( __( "An error occurred while receiving the license status. The response was: %s. Please login to thrivethemes.com, report this error message on the forums and we'll get this sorted for you.", 'thrive' ), $licenseValid['body'] ); return $response; } return $response; } /** retrospectively modify license status to remove liceense details from db once activated **/ if ( get_option( "thrive_license_status" ) == "ACTIVE" ) { update_option( 'thrive_license_email', "License Activated" ); update_option( 'thrive_license_key', "License Activated" ); } if ( isset( $_POST['thrive_license_email'] ) && isset( $_POST['thrive_license_key'] ) ) { update_option( 'thrive_license_email', trim( $_POST['thrive_license_email'] ) ); update_option( 'thrive_license_key', trim( $_POST['thrive_license_key'] ) ); $validate = thrive_license_check( get_option( 'thrive_license_email' ), get_option( 'thrive_license_key' ) ); // license validated if ( isset( $validate->success ) && $validate->success == 1 ) { update_option( 'thrive_license_status', "ACTIVE" ); update_option( 'thrive_license_email', "License Activated" ); update_option( 'thrive_license_key', "License Activated" ); ?>

Thank you - You have successfully validated your license!

success == 0 ) { ?>

reason; ?>

License activation error - please contact support copying this message and we'll get this sorted for you.