Plugin Directory

Changeset 3367881


Ignore:
Timestamp:
09/25/2025 02:25:24 PM (6 months ago)
Author:
mdashikul
Message:

update 3.5.29

Location:
ultimate-addons-for-contact-form-7/trunk
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • ultimate-addons-for-contact-form-7/trunk/addons/mailchimp/mailchimp.php

    r3333753 r3367881  
    55class UACF7_MAILCHIMP {
    66
    7     public $mailchimlConnection = '';
    8     public static $mailchimp = null;
    9     private $mailchimp_api = '';
     7    public  $mailchimlConnection = '';
     8    public  static $mailchimp    = null;
     9    private $mailchimp_api       = '';
    1010
    1111    public function __construct() {
     
    140140
    141141                $response = json_decode( $response, true );
    142 
    143142                if ( isset( $response['lists'] ) && is_array( $response['lists'] ) ) {
    144143                    foreach ( $response['lists'] as $list ) {
     
    294293                    'field_width' => '25',
    295294                    'dependency' => [ 'uacf7_mailchimp_form_enable', '==', '1' ],
     295                ),
     296                'uacf7_mailchimp_subscriber_tags' => array(
     297                    'id'         => 'uacf7_mailchimp_subscriber_tags',
     298                    'type'       => 'select2',
     299                    'label'      => __( 'Tags To Add', 'ultimate-addons-cf7' ),
     300                    'subtitle'   => 'Add tags to your subscribers. These tags will be added from your mailchimp tag list.',
     301                    'query_args' => array(
     302                        'post_id'  => $post_id,
     303                        'specific' => 'text',
     304                    ),
     305                    'options'     => 'mailchimp_tags',
     306                    'field_width' => '100',
     307                    'multiple'    => true,
     308                    'is_pro'      => true,
     309                    'dependency'  => [ 'uacf7_mailchimp_form_enable', '==', '1' ],
    296310                ),
    297311                'uacf7_mailchimp_merge_fields' => array(
     
    462476            $subscriber_lname = isset( $mailchimp['uacf7_mailchimp_subscriber_lname'] ) ? $mailchimp['uacf7_mailchimp_subscriber_lname'] : '';
    463477            $subscriber_lname = ! empty( $subscriber_lname ) ? $posted_data[ $subscriber_lname ] : '';
    464 
    465             $extra_fields = isset( $mailchimp['uacf7_mailchimp_merge_fields'] ) && is_array( $mailchimp['uacf7_mailchimp_merge_fields'] ) ? $mailchimp['uacf7_mailchimp_merge_fields'] : array();
     478            $subscriber_tags  = isset( $mailchimp['uacf7_mailchimp_subscriber_tags'] ) ? $mailchimp['uacf7_mailchimp_subscriber_tags'] : [];
     479            $extra_fields     = isset( $mailchimp['uacf7_mailchimp_merge_fields'] ) && is_array( $mailchimp['uacf7_mailchimp_merge_fields'] ) ? $mailchimp['uacf7_mailchimp_merge_fields'] : array();
    466480           
    467481            $extra_merge_fields = '';
     
    515529
    516530            curl_close( $curl );
     531
     532            do_action(
     533                'uacf7_mailchimp_after_subscribe',
     534                $id,                 // Form ID
     535                $audience,           // List ID
     536                $subscriber_email,   // Subscriber email
     537                $subscriber_tags,    // Tags array
     538                $headers,            // cURL headers
     539                $server_prefix       // Server prefix
     540            );
     541
    517542            return $resp;
    518543        } else {
  • ultimate-addons-for-contact-form-7/trunk/admin/tf-options/fields/select2/UACF7_select2.php

    r3333753 r3367881  
    8686            }
    8787
     88            if ( ! empty( $args['query_args'] ) && $args['options'] == 'mailchimp_tags' ) {
     89                $post_id  = isset( $args['query_args']['post_id'] ) ? (int) $args['query_args']['post_id'] : 0;
     90                $args['options'] = [];
     91               
     92                if ( $post_id > 0 ) {
     93                   
     94                    $addon_option = get_option( 'uacf7_settings' );
     95                    $uacf7_existing_plugin_status = get_option( 'uacf7_existing_plugin_status' );
    8896
    89             $field_name = !empty($this->field['multiple']) ? $this->field_name() . '[]' : $this->field_name();
     97                    if ( apply_filters( 'uacf7_checked_license_status', '' ) == false || $uacf7_existing_plugin_status != 'done' ) {
     98                        return;
     99                    }
     100                    //Addon - Addon mailchimp pro is enabled
     101                    if ( isset( $addon_option['uacf7_enable_mailchimp_pro'] ) && $addon_option['uacf7_enable_mailchimp_pro'] != true ) {
     102                        return;
     103                    }
     104                    // Get API key
     105                    $api_key = uacf7_settings( 'uacf7_mailchimp_api_key' ); // adjust option name
     106                    // Get selected audience for this form
     107                    $mailchimp = uacf7_get_form_option( $post_id, 'mailchimp' );
     108                    $audience_id = isset( $mailchimp['uacf7_mailchimp_audience'] ) ? $mailchimp['uacf7_mailchimp_audience'] : '';
     109
     110                    if ( $api_key && $audience_id ) {
     111                        $path     = "lists/$audience_id/tag-search?count=100";
     112                        $response = $this->set_config( $api_key, $path );
     113                        $response = json_decode( $response, true );
     114
     115                        if ( ! empty( $response['tags'] ) && is_array( $response['tags'] ) ) {
     116                            foreach ( $response['tags'] as $tag ) {
     117                                $args['options'][ $tag['name'] ] = $tag['name'];
     118                            }
     119                        }
     120                    }
     121                }
     122            }
     123
     124            $field_name           = !empty($this->field['multiple']) ? $this->field_name() . '[]' : $this->field_name();
    90125            $tf_select2_unique_id = str_replace( array("[","]"),"_",esc_attr( $this->field_name() ) );
    91             $parent_class = ( ! empty( $this->parent_field ) ) ? 'tf-select2-parent' : 'tf-select2';
    92             $parent_class = ( isset( $this->field['select2'] ) ) ? 'tf-select2' : $parent_class ;
     126            $parent_class         = ( ! empty( $this->parent_field ) ) ? 'tf-select2-parent' : 'tf-select2';
     127            $parent_class         = ( isset( $this->field['select2'] ) ) ? 'tf-select2' : $parent_class ;
    93128
    94129            echo '<select name="' . $field_name . '" id="' . $tf_select2_unique_id . '" class=" tf-select-two '.$parent_class.' " data-placeholder="' . esc_attr( $placeholder ) . '" ' . $multiple . ' '. $this->field_attributes() .'>';
     
    122157        }
    123158
     159        private function set_config( $api_key = '', $path = '' ) {
     160
     161            $server_prefix = explode( "-", $api_key );
     162
     163            if ( ! isset( $server_prefix[1] ) ) {
     164                return;
     165            }
     166            $server_prefix = $server_prefix[1];
     167
     168            $url = "https://$server_prefix.api.mailchimp.com/3.0/$path";
     169
     170            $curl = curl_init( $url );
     171            curl_setopt( $curl, CURLOPT_URL, $url );
     172            curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
     173
     174            $headers = array(
     175                "Authorization: Bearer $api_key"
     176            );
     177            curl_setopt( $curl, CURLOPT_HTTPHEADER, $headers );
     178            //for debug only!
     179            curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );
     180            curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
     181
     182            $resp = curl_exec( $curl );
     183            curl_close( $curl );
     184
     185            return $resp;
     186        }
     187
    124188    }
    125189}
  • ultimate-addons-for-contact-form-7/trunk/readme.txt

    r3366254 r3367881  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 3.5.28
     7Stable tag: 3.5.29
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    482482== Changelog ==
    483483
     484= 3.5.29 - 25/09/2025 =
     485
     486- Added: Mailchimp tags selection feature (Pro).
     487- Fixed: Deprecated issue in drag and drop multiple file uploads.
     488
    484489= 3.5.28 - 23/09/2025 =
    485490
  • ultimate-addons-for-contact-form-7/trunk/ultimate-addons-for-contact-form-7.php

    r3366254 r3367881  
    44 * Plugin URI: https://cf7addons.com/
    55 * Description: 50+ Essential Addons for Contact Form 7 - Conditional Fields, Multi Step Forms, Redirection, Form Templates, Columns, WooCommerce, Mailchimp and more, all in one.
    6  * Version: 3.5.28
     6 * Version: 3.5.29
    77 * Author: Themefic
    88 * Author URI: https://themefic.com/
     
    3131        define( 'UACF7_PATH', plugin_dir_path( __FILE__ ) );
    3232
    33         define( 'UACF7_VERSION', '3.5.28' );
     33        define( 'UACF7_VERSION', '3.5.29' );
    3434
    3535        if ( ! class_exists( 'Appsero\Client' ) ) {
Note: See TracChangeset for help on using the changeset viewer.