D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
everqlsh
/
www
/
wp-admin
/
user
/
577040
/
Filename :
pro.zip
back
Copy
PK �\~\�$�I� � mailerlite/mailerlite.phpnu �[��� <?php /** * Integration Name: MailerLite * Version: 1.0 * Plugin URI: https://wpmudev.com/ * Description: Integrate Forminator Custom Forms with MailerLite to get notified in real time. * Author: WPMU DEV * Author URI: http://wpmudev.com * * @package Forminator */ define( 'FORMINATOR_ADDON_MAILERLITE_VERSION', '1.0' ); require_once __DIR__ . '/lib/class-forminator-addon-mailerlite-wp-api.php'; Forminator_Integration_Loader::get_instance()->register( 'mailerlite' ); PK �\~\���d d ; mailerlite/lib/class-forminator-addon-mailerlite-wp-api.phpnu �[��� <?php /** * Forminator Addon Mailerlite API. * * @package Forminator */ /** * Class Forminator_Mailerlite_Wp_Api * Wrapper @see wp_remote_request() to be used to do request to mailerlite server */ class Forminator_Mailerlite_Wp_Api { /** * Mailerlite API instance * * @var self|null */ private static $instance = null; /** * Endpoint of Mailerlite API * * @var string */ private $endpoint = 'https://connect.mailerlite.com/api/'; /** * API Key used to send request * * @var string */ private $api_key = ''; /** * Last data sent to mailerlite API * * @var array */ private $last_data_sent = array(); /** * Last data received from mailerlite API * * @var array */ private $last_data_received = array(); /** * Last URL requested * * @var string */ private $last_url_request = ''; /** * Forminator_Mailerlite_Wp_Api constructor. * * @param string $api_key API Key. */ private function __construct( $api_key ) { $this->api_key = $api_key; } /** * Get singleton * * @param string $api_key API Key. * * @return Forminator_Mailerlite_Wp_Api */ public static function get_instance( $api_key ) { if ( is_null( self::$instance ) || self::$instance->api_key !== $api_key ) { self::$instance = new self( $api_key ); } return self::$instance; } /** * HTTP Request * * @param string $verb Request type. * @param string $path Request path. * @param array $args Arguments. * * @return array|mixed|object * @throws Forminator_Integration_Exception Throws Integration Exception. */ private function request( $verb, $path, $args = array() ) { $url = $this->get_endpoint() . $path; $_args = array( 'headers' => array( 'Authorization' => 'Bearer ' . $this->api_key, 'Content-Type' => 'application/json', 'Accept' => 'application/json', 'User-Agent' => 'ForminatorMailerLite/1.0', ), ); if ( 'GET' === $verb ) { $url .= ( '?' . http_build_query( $args ) ); } else { $_args['body'] = wp_json_encode( $args ); $_args['method'] = 'POST'; } $this->last_data_sent = $args; $this->last_url_request = $url; $res = wp_remote_request( $url, $_args ); $default_error = esc_html__( 'Failed to process the request. Please ensure the API key is correct and the server has an active internet connection.', 'forminator' ); if ( is_wp_error( $res ) || ! $res ) { forminator_addon_maybe_log( __METHOD__, $res ); throw new Forminator_Integration_Exception( esc_html( $default_error ) ); } $body = wp_remote_retrieve_body( $res ); // Got no response from API. if ( empty( $body ) ) { forminator_addon_maybe_log( __METHOD__, $res ); throw new Forminator_Integration_Exception( esc_html( $default_error ) ); } $response = null; if ( ! empty( $body ) ) { $response = json_decode( $body ); $response_code = wp_remote_retrieve_response_code( $res ); // check response status from API. if ( isset( $response_code ) && $response_code >= 400 ) { forminator_addon_maybe_log( __METHOD__, $response ); $msg = ''; if ( isset( $response->message ) ) { // if exist, error detail is given by mailerlite here. $msg = $response->message; } $this->last_data_received = $response; throw new Forminator_Integration_Exception( sprintf( /* translators: %s: Error message */ esc_html__( 'Failed to process request : %s', 'forminator' ), esc_html( $msg ) ) ); } // Probably response is failed to be json decoded. if ( is_null( $response ) ) { $this->last_data_received = $body; forminator_addon_maybe_log( __METHOD__, $res ); throw new Forminator_Integration_Exception( sprintf( /* translators: %s: Error message */ esc_html__( 'Failed to process request : %s', 'forminator' ), esc_html( json_last_error_msg() ) ) ); } } $wp_response = $res; // in case not receiving json decoded body use $wp_response. if ( is_null( $response ) ) { $response = $wp_response; } /** * Filter mailerlite api response returned to integration * * @param mixed $response * @param string $body original content of http response's body. * @param array|WP_Error $wp_response original wp remote request response. */ $response = apply_filters( 'forminator_addon_mailerlite_api_response', $response, $body, $wp_response ); $this->last_data_received = $response; return $response; } /** * Get User Info for the current API KEY * * @return array|mixed|object */ public function get_info() { return $this->request( 'GET', 'subscribers', array( 'limit' => 0 ) ); } /** * Get Mailerlite Lists * * @param array $args Arguments. * * @return array|mixed|object */ public function get_lists( $args ) { return $this->request( 'GET', 'groups', $args ); } /** * Get all lists * * @param bool $force Use cahce or not. * @return array */ public function get_all_lists( $force = false ) { $option_key = 'forminator_mailerlite_' . $this->api_key; if ( ! $force ) { $lists = get_option( $option_key ); if ( ! empty( $lists ) && is_array( $lists ) ) { return $lists; } } $args = array( 'sort' => 'name', ); $response = $this->get_lists( $args ); if ( is_wp_error( $response ) || ! isset( $response->data ) || ! is_array( $response->data ) ) { forminator_addon_maybe_log( __METHOD__, __( 'The request to retrieve the lists has failed.', 'forminator' ) ); return array(); } $lists = $response->data; update_option( $option_key, $lists ); return $lists; } /** * Get List of contact_properties * * @return array */ public function get_contact_properties() { $fields = $this->request( 'GET', 'fields', array( 'sort' => 'name' ) ); $properties = array(); if ( ! empty( $fields->data ) && is_array( $fields->data ) ) { $properties = $fields->data; } return $properties; } /** * Add member if not available, or update member if exist * * @param string $list_id List ID. * @param string $email Email. * @param array $args Additional arguments. * * @return array|mixed|object */ public function add_or_update_member( $list_id, $email, $args ) { $data = array( 'email' => $email, 'groups' => array( $list_id ), 'status' => 'active', ); if ( ! empty( $args['merge_fields'] ) ) { $data['fields'] = (object) $args['merge_fields']; } $result = $this->request( 'POST', 'subscribers/', $data ); if ( empty( $result->data ) ) { return false; } return $result; } /** * Get last data sent * * @return array */ public function get_last_data_sent() { return $this->last_data_sent; } /** * Get last data received * * @return array */ public function get_last_data_received() { return $this->last_data_received; } /** * Get last data received * * @return string */ public function get_last_url_request() { return $this->last_url_request; } /** * Get current endpoint to send to Malchimp * * @return string */ public function get_endpoint() { return $this->endpoint; } } PK �\~\C���* �* 0 mailerlite/class-forminator-addon-mailerlite.phpnu �[��� <?php /** * Forminator Addon Mailerlite. * * @package Forminator */ /** * Class Forminator_Mailerlite * The class that defines mailerlite integration */ class Forminator_Mailerlite extends Forminator_Integration { /** * Mailerlite Integration Instance * * @var self|null */ protected static $instance = null; /** * Slug * * @var string */ protected $_slug = 'mailerlite'; /** * Mailerlite version * * @var string */ protected $_version = FORMINATOR_ADDON_MAILERLITE_VERSION; /** * Forminator minimum version * * @var string */ protected $_min_forminator_version = '1.30'; /** * Short title * * @var string */ protected $_short_title = 'MailerLite'; /** * Title * * @var string */ protected $_title = 'MailerLite'; /** * Position * * @var integer */ protected $_position = 4; /** * Forminator_Mailerlite constructor. * - Set dynamic translatable text(s) that will be displayed to end-user * - Set dynamic icons and images */ public function __construct() { // late init to allow translation. $this->_description = esc_html__( 'Get awesome by your form.', 'forminator' ); $this->is_multi_global = true; } /** * Check if user already completed settings * * @return bool */ public function is_authorized() { $setting_values = $this->get_settings_values(); return ! empty( $setting_values['api_key'] ); } /** * Return with true / false, you may update you setting update message too * * @param string $api_key API key. * * @return bool */ protected function validate_api_keys( $api_key ) { try { // Check API Key and Secret key. $info = $this->get_api( $api_key )->get_info(); forminator_addon_maybe_log( __METHOD__, $info ); } catch ( Forminator_Integration_Exception $e ) { $this->_update_settings_error_message = $e->getMessage(); return false; } return true; } /** * Get API Instance * * @param string|null $api_key API key. * * @return Forminator_Mailerlite_Wp_Api|null */ public function get_api( $api_key = null ) { if ( is_null( $api_key ) ) { $api_key = $this->get_api_key(); } $api = Forminator_Mailerlite_Wp_Api::get_instance( $api_key ); return $api; } /** * Get currently saved api key * * @return string|null */ private function get_api_key() { $setting_values = $this->get_settings_values(); if ( isset( $setting_values['api_key'] ) ) { return $setting_values['api_key']; } return null; } /** * Build settings help on settings * * @return string */ private function settings_help() { $help = '<span class="sui-description" style="margin-top: 20px;">'; if ( $this->is_authorized() ) { // Show currently connected mailerlite account if it's already connected. $help .= esc_html__( 'Change your API Key or disconnect this MailerLite Integration below.', 'forminator' ); } else { // Display how to get mailerlite API Key by default. /* Translators: 1. Opening <a> tag with link to the MailerLite API Key, 2. closing <a> tag. */ $help .= sprintf( esc_html__( 'Please get your MailerLite API Key %1$shere%2$s', 'forminator' ), '<a href="https://dashboard.mailerlite.com/integrations/api" target="_blank">', '</a>' ); } $help .= '</span>'; return $help; } /** * Settings description * * @return string */ private function settings_description() { $description = ''; if ( $this->is_authorized() ) { // Show currently connected mailerlite account if its already connected. $description .= '<span class="sui-description">' . esc_html__( 'Please note that changing your API Key or disconnecting this integration will affect ALL of your connected forms.', 'forminator' ) . '</span>'; } return $description; } /** * Settings wizard * * @return array */ public function settings_wizards() { return array( array( 'callback' => array( $this, 'configure_api_key' ), 'is_completed' => array( $this, 'is_authorized' ), ), ); } /** * Wizard of configure_api_key * * @param array $submitted_data Submitted data. * * @return array */ public function configure_api_key( $submitted_data ) { $setting_values = $this->get_settings_values(); $identifier = $setting_values['identifier'] ?? ''; $api_key = $this->get_api_key(); // ON Submit. if ( isset( $submitted_data['api_key'] ) ) { $api_key = $submitted_data['api_key']; $identifier = $submitted_data['identifier'] ?? ''; if ( empty( $api_key ) ) { $api_key_error_message = esc_html__( 'Please add valid MailerLite API Key.', 'forminator' ); } else { $api_key_validated = $this->validate_api_keys( $api_key ); /** * Filter validating api key result * * @param bool $api_key_validated * @param string $api_key API Key to be validated. */ $api_key_validated = apply_filters( 'forminator_addon_mailerlite_validate_api_keys', $api_key_validated, $api_key ); if ( ! $api_key_validated ) { $error_message = $this->_update_settings_error_message; $api_key_error_message = esc_html__( 'Invalid API key. Please check and try again.', 'forminator' ); } else { $save_values = array( 'api_key' => $api_key, 'identifier' => $identifier, ); if ( ! forminator_addon_is_active( $this->get_slug() ) ) { $activated = Forminator_Integration_Loader::get_instance()->activate_addon( $this->get_slug() ); if ( ! $activated ) { $error_message = Forminator_Integration_Loader::get_instance()->get_last_error_message(); } else { $this->save_settings_values( $save_values ); } } else { $this->save_settings_values( $save_values ); } } } $has_error = ! empty( $error_message ) || ! empty( $api_key_error_message ); if ( ! $has_error ) { $html = $this->success_authorize(); return array( 'html' => $html, 'redirect' => false, 'has_errors' => false, 'notification' => array( 'type' => 'success', 'text' => '<strong>' . $this->get_title() . '</strong> ' . esc_html__( 'is connected successfully.', 'forminator' ), ), ); } } $error_message = $error_message ?? false; $has_error = $has_error ?? ''; $buttons = array(); if ( $this->is_connected() ) { $buttons['disconnect'] = array( 'markup' => self::get_button_markup( esc_html__( 'Disconnect', 'forminator' ), 'sui-button-ghost forminator-addon-disconnect' ), ); $buttons['submit'] = array( 'markup' => '<div class="sui-actions-right">' . self::get_button_markup( esc_html__( 'Save', 'forminator' ), 'forminator-addon-connect' ) . '</div>', ); } else { $buttons['submit'] = array( 'markup' => self::get_button_markup( esc_html__( 'Connect', 'forminator' ), 'forminator-addon-connect' ), ); } $html = '<div class="forminator-integration-popup__header">'; /* translators: ... */ $html .= '<h3 id="dialogTitle2" class="sui-box-title sui-lg" style="overflow: initial; text-overflow: none; white-space: normal;">' . /* translators: 1: Add-on name */ sprintf( esc_html__( 'Configure %1$s', 'forminator' ), 'MailerLite' ) . '</h3>'; $html .= $this->settings_help(); $html .= $error_message ? '<div class="sui-notice sui-notice-error"><div class="sui-notice-content"><div class="sui-notice-message"> <span class="sui-notice-icon sui-icon-info" aria-hidden="true" ></span> <p>' . $error_message . '</p> </div></div></div>' : ''; $html .= '</div>'; $html .= '<form>'; // FIELD: API Key. $html .= '<div class="sui-form-field ' . ( ! empty( $api_key_error_message ) ? 'sui-form-field-error' : '' ) . '">'; $html .= '<label class="sui-label">' . esc_html__( 'API Key', 'forminator' ) . '</label>'; $html .= '<div class="sui-control-with-icon">'; /* translators: ... */ $html .= '<input name="api_key" value="' . esc_attr( $api_key ) . '" placeholder="' . /* translators: 1: Add-on name */ sprintf( esc_html__( 'Enter %1$s API Key', 'forminator' ), 'MailerLite' ) . '" class="sui-form-control" />'; $html .= '<i class="sui-icon-key" aria-hidden="true"></i>'; $html .= '</div>'; $html .= ( ! empty( $api_key_error_message ) ? '<span class="sui-error-message">' . esc_html( $api_key_error_message ) . '</span>' : '' ); $html .= $this->settings_description(); $html .= '</div>'; // FIELD: Identifier. $html .= '<div class="sui-form-field">'; $html .= '<label class="sui-label">' . esc_html__( 'Identifier', 'forminator' ) . '</label>'; $html .= '<input name="identifier" value="' . esc_attr( $identifier ) . '" placeholder="' . esc_attr__( 'E.g., Business Account', 'forminator' ) . '" class="sui-form-control" />'; $html .= '<span class="sui-description">' . esc_html__( 'Helps distinguish between integrations if connecting to the same third-party app with multiple accounts.', 'forminator' ) . '</span>'; $html .= '</div>'; $html .= '</form>'; return array( 'html' => $html, 'buttons' => $buttons, 'redirect' => false, 'has_errors' => $has_error, ); } /** * Flag for check if has lead form integration connected to a quiz * by default it will check if last step of form settings already completed by user * * @param int $quiz_id Quiz Id. * * @return bool * @throws Forminator_Integration_Exception Throws Integration Exception. */ public function is_quiz_lead_connected( $quiz_id ) { try { // initialize with null. $quiz_settings_instance = null; if ( ! $this->is_connected() ) { throw new Forminator_Integration_Exception( esc_html__( 'MailerLite integration not connected.', 'forminator' ) ); } $quiz_settings_instance = $this->get_addon_settings( $quiz_id, 'quiz' ); if ( ! $quiz_settings_instance instanceof Forminator_Mailerlite_Quiz_Settings ) { throw new Forminator_Integration_Exception( esc_html__( 'Form settings instance is not valid.', 'forminator' ) ); } $quiz_settings = $quiz_settings_instance->get_quiz_settings(); $is_quiz_connected = ! empty( $quiz_settings['hasLeads'] ); } catch ( Forminator_Integration_Exception $e ) { $is_quiz_connected = false; forminator_addon_maybe_log( __METHOD__, $e->getMessage() ); } /** * Filter connected status of mailerlite with the form * * @param bool $is_quiz_connected * @param int $quiz_id Current Form ID. * @param Forminator_Mailerlite_Quiz_Settings|null $quiz_settings_instance Instance of form settings, or null when unavailable. */ $is_quiz_connected = apply_filters( 'forminator_addon_mailerlite_is_quiz_lead_connected', $is_quiz_connected, $quiz_id, $quiz_settings_instance ); return $is_quiz_connected; } } PK �\~\m:?f� � mailerlite/error_lognu �[��� [28-Mar-2026 20:16:02 UTC] PHP Fatal error: Uncaught Error: Class "Forminator_Integration" not found in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite.php:12 Stack trace: #0 {main} thrown in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite.php on line 12 [28-Mar-2026 20:18:01 UTC] PHP Fatal error: Uncaught Error: Class "Forminator_Integration_Quiz_Settings" not found in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-quiz-settings.php:12 Stack trace: #0 {main} thrown in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-quiz-settings.php on line 12 [28-Mar-2026 20:19:06 UTC] PHP Fatal error: Uncaught Error: Class "Forminator_Integration_Form_Settings" not found in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-form-settings.php:12 Stack trace: #0 {main} thrown in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-form-settings.php on line 12 [28-Mar-2026 20:30:15 UTC] PHP Fatal error: Uncaught Error: Class "Forminator_Integration_Form_Hooks" not found in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-form-hooks.php:13 Stack trace: #0 {main} thrown in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-form-hooks.php on line 13 [28-Mar-2026 20:39:35 UTC] PHP Fatal error: Uncaught Error: Class "Forminator_Integration_Quiz_Hooks" not found in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-quiz-hooks.php:13 Stack trace: #0 {main} thrown in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/class-forminator-addon-mailerlite-quiz-hooks.php on line 13 [28-Mar-2026 20:55:32 UTC] PHP Fatal error: Uncaught Error: Class "Forminator_Integration_Loader" not found in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/mailerlite.php:17 Stack trace: #0 {main} thrown in /home/everqlsh/public_html/wp-content/plugins/forminator/addons/pro/mailerlite/mailerlite.php on line 17 PK �\~\�d ] ; mailerlite/class-forminator-addon-mailerlite-form-hooks.phpnu �[��� <?php /** * Forminator Addon Mailerlite form hooks. * * @package Forminator */ /** * Class Forminator_Mailerlite_Form_Hooks * * Hooks that used by Mailerlite Integration defined here */ class Forminator_Mailerlite_Form_Hooks extends Forminator_Integration_Form_Hooks { } PK �\~\"ڤ � ? mailerlite/class-forminator-addon-mailerlite-settings-trait.phpnu �[��� <?php /** * Trait for common methods for Mailerlite settings classes * * @since 1.30 * @package Mailerlite Integration */ /** * Trait Forminator_Mailerlite_Settings_Trait */ trait Forminator_Mailerlite_Settings_Trait { /** * For settings Wizard steps * * @return array */ public function module_settings_wizards() { // Already filtered on Forminator_Integration::get_wizard. $this->addon_settings = $this->get_settings_values(); // Numerical array steps. return array( // 1 array( 'callback' => array( $this, 'choose_mail_list' ), 'is_completed' => array( $this, 'step_choose_mail_list_is_completed' ), ), // 2 array( 'callback' => array( $this, 'get_map_fields' ), 'is_completed' => array( $this, 'step_map_fields_is_completed' ), ), ); } /** * Get mail list data * * @param array $submitted_data Submitted data. * @return array */ private function mail_list_data( $submitted_data ) { $default_data = array( 'mail_list_id' => '', ); return $this->get_current_data( $default_data, $submitted_data ); } /** * Choose Mail wizard * * @param array $submitted_data Submitted data. * * @return array */ public function choose_mail_list( $submitted_data ) { $current_data = $this->mail_list_data( $submitted_data ); $api_error = ''; $list_error = ''; $lists = array(); try { $lists = $this->get_prepared_lists(); if ( empty( $lists ) ) { $list_error = __( 'Your MailerLite List is empty, please create one.', 'forminator' ); } elseif ( ! empty( $submitted_data ) ) { // logic when user submit mail list. $mail_list_name = $this->get_choosen_mail_list_name( $lists, $submitted_data ); if ( empty( $mail_list_name ) ) { $list_error = __( 'Please select a valid Email List', 'forminator' ); } else { $this->save_settings( $submitted_data, $mail_list_name ); } } } catch ( Forminator_Integration_Exception $e ) { // send error back to client. $api_error = $e->get_error_notice(); } $html = self::get_choose_list_header( $api_error ); if ( ! $api_error ) { $html .= '<form enctype="multipart/form-data">'; $html .= self::get_choose_list_field( $current_data, $lists, $list_error ); $html .= '</form>'; } return array( 'html' => $html, 'redirect' => false, 'buttons' => $this->get_choose_list_buttons( $api_error ), 'has_errors' => ! empty( $api_error ) || ! empty( $list_error ), 'size' => 'small', ); } /** * Save submitted settings * * @param array $submitted_data Submitted data. * @param string $list_name List name. */ private function save_settings( $submitted_data, $list_name ) { $this->addon_settings['mail_list_id'] = $submitted_data['mail_list_id']; $this->addon_settings['mail_list_name'] = $list_name; $this->save_module_settings_values(); } /** * Get current data based on submitted or saved data * * @param array $current_data Default data. * @param array $submitted_data Submitted data. * @return array */ private function get_current_data( $current_data, $submitted_data ) { foreach ( array_keys( $current_data ) as $key ) { if ( isset( $submitted_data[ $key ] ) ) { $current_data[ $key ] = $submitted_data[ $key ]; } elseif ( isset( $this->addon_settings[ $key ] ) ) { $current_data[ $key ] = $this->addon_settings[ $key ]; } } forminator_addon_maybe_log( __METHOD__, 'current_data', $current_data ); return $current_data; } /** * Get HTML for buttons on Choose List step. * * @param string $api_error API error. * @return array */ private function get_choose_list_buttons( $api_error ) { $buttons = array(); if ( ! $api_error ) { if ( $this->addon->is_connected( $this->module_id, static::$module_slug ) ) { $buttons['disconnect']['markup'] = Forminator_Integration::get_button_markup( esc_html__( 'Deactivate', 'forminator' ), 'sui-button-ghost sui-tooltip sui-tooltip-top-center forminator-addon-form-disconnect', esc_html__( 'Deactivate Mailerlite from this module.', 'forminator' ) ); } $buttons['next']['markup'] = '<div class="sui-actions-right">' . Forminator_Integration::get_button_markup( esc_html__( 'Next', 'forminator' ), 'forminator-addon-next' ) . '</div>'; } return $buttons; } /** * Get mail List Name of submitted data * * @param array $lists Lists. * @param array $submitted_data Submitted data. * * @return string */ private function get_choosen_mail_list_name( $lists, $submitted_data ) { forminator_addon_maybe_log( __METHOD__, '$submitted_data', $submitted_data ); $mail_list_id = $submitted_data['mail_list_id'] ?? 0; $mail_list_name = $lists[ $mail_list_id ] ?? ''; forminator_addon_maybe_log( __METHOD__, '$mail_list_name', $mail_list_name ); return $mail_list_name; } /** * Check if map fields is completed * * @return bool */ public function step_map_fields_is_completed() { $this->addon_settings = $this->get_settings_values(); if ( ! $this->step_choose_mail_list_is_completed() ) { return false; } if ( empty( $this->addon_settings['fields_map'] ) ) { return false; } if ( ! is_array( $this->addon_settings['fields_map'] ) ) { return false; } if ( count( $this->addon_settings['fields_map'] ) < 1 ) { return false; } /** * TODO: check if saved fields_map still valid, by request merge_fields on mailerlite * Easy achieved but will add overhead on site * force_form_disconnect(); * save_force_form_disconnect_reason(); */ return true; } /** * Check if mail list already selected completed * * @return bool */ public function step_choose_mail_list_is_completed() { $this->addon_settings = $this->get_settings_values(); if ( ! isset( $this->addon_settings['mail_list_id'] ) ) { // preliminary value. $this->addon_settings['mail_list_id'] = 0; return false; } if ( empty( $this->addon_settings['mail_list_id'] ) ) { return false; } /** * TODO: check if saved mail list id still valid, by request info on mailerlite * Easy achieved but will add overhead on site * force_form_disconnect(); * save_force_form_disconnect_reason(); */ return true; } } PK �\~\�)]6 6 >