/var/www/wp2.qr4y.com/www/wp-content/plugins/elementor-pro/modules/forms/classes
NameSizeModeActions
action-base.php8120644editdlrm
activecampaign-handler.php31410644editdlrm
ajax-handler.php91880644editdlrm
akismet.php55270644editdlrm
convertkit-handler.php26710644editdlrm
drip-handler.php20630644editdlrm
form-base.php83030644editdlrm
form-record.php97880644editdlrm
getresponse-handler.php31030644editdlrm
honeypot-handler.php27980644editdlrm
integration-base.php24150644editdlrm
mailchimp-handler.php44320644editdlrm
mailerlite-handler.php26200644editdlrm
recaptcha-handler.php90010644editdlrm
recaptcha-v3-handler.php46630644editdlrm
rest-client.php44410644editdlrm
Edit: /var/www/wp2.qr4y.com/www/wp-content/plugins/elementor-pro/modules/forms/classes/drip-handler.php (2063B)
init_rest_client( $api_token ); if ( ! $this->is_valid_api_token() ) { throw new \Exception( 'Invalid API key.' ); } } private function init_rest_client( $api_token ) { $this->api_token = $api_token; $this->rest_client = new Rest_Client( 'https://api.getdrip.com/v2/' ); $this->rest_client->add_headers( [ 'Authorization' => 'Basic ' . base64_encode( $this->api_token ), 'Content-Type' => 'application/vnd.api+json', ] ); } /** * validate api token * * @return bool * @throws \Exception */ private function is_valid_api_token() { $accounts = $this->get_accounts(); if ( ! empty( $accounts ) ) { return true; } $this->api_token = ''; return false; } /** * get drip accounts associated with API token * @return array * @throws \Exception */ public function get_accounts() { $results = $this->rest_client->get( 'accounts' ); $accounts = [ '' => esc_html__( 'Select...', 'elementor-pro' ), ]; if ( ! empty( $results['body']['accounts'] ) ) { foreach ( $results['body']['accounts'] as $index => $account ) { $accounts[ $account['id'] ] = $account['name']; } } $return_array = [ 'accounts' => $accounts, ]; return $return_array; } /** * create subscriber at drip via api * * @param string $account_id * @param array $subscriber_data * * @return array|mixed * @throws \Exception */ public function create_subscriber( $account_id = '', $subscriber_data = [] ) { $end_point = sprintf( '%s/subscribers/', $account_id ); return $this->rest_client->post( $end_point, [ 'subscribers' => [ $subscriber_data ] ] ); } }