Plugin Directory

Changeset 3441586


Ignore:
Timestamp:
01/17/2026 01:36:21 PM (8 weeks ago)
Author:
elementinvader
Message:

update

Location:
elementinvader-addons-for-elementor/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • elementinvader-addons-for-elementor/trunk/README.txt

    r3375965 r3441586  
    55Requires at least: 5.2
    66Requires PHP: 5.6
    7 Tested up to: 6.8
    8 Stable tag: 1.4.1
     7Tested up to: 6.9
     8Stable tag: 1.4.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8989== Changelog ==
    9090
     91= 1.4.2 =
     92* Security fix
     93
    9194= 1.4.1 =
    9295* Disable retrieved in form email / name from
     96* _load_textdomain_just_in_time issue
    9397
    9498= 1.4.0 =
  • elementinvader-addons-for-elementor/trunk/elementinvader-addons-for-elementor.php

    r3375965 r3441586  
    55 * Description: Ready to use Elementor Addon Elements like Menu, Forms, Maps, Newsletter with many styling options
    66 * Plugin URI:  https://elementinvader.com
    7  * Version:     1.4.1
     7 * Version:     1.4.2
    88 * Author:      ElementInvader
    99 * Author URI:  https://elementinvader.com
     
    2525$ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PROTOCOL = stripos($elementinvader_addons_for_elementor_server_prtc, 'https') !== false ? 'https://' : 'http://';
    2626define('ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PROTOCOL', $ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PROTOCOL);
     27
     28
     29
    2730/**
    2831 * Elementor Blocks
     
    3235 * @since 1.0.0
    3336 */
    34 function ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_load()
     37
     38 add_action('init', function ()
    3539{
    3640
     
    7983        return;
    8084    }
     85});
     86
     87
     88
     89/**
     90 * Elementor Blocks
     91 *
     92 * Load the plugin after Elementor (and other plugins) are loaded.
     93 *
     94 * @since 1.0.0
     95 */
     96function ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_load()
     97{
     98
     99    // Load wlistingation file
     100    load_plugin_textdomain('elementinvader-addons-for-elementor', false, basename(dirname(__FILE__)) . '/locale');
     101
     102    // Notice if the Elementor is not active
     103    if (! did_action('elementor/loaded')) {
     104        return;
     105    }
     106
     107    // Check required version
     108    $elementor_version_required = '1.8.0';
     109    if (! version_compare(ELEMENTOR_VERSION, $elementor_version_required, '>=')) {
     110        return;
     111    }
    81112
    82113    // Require the main plugin file
  • elementinvader-addons-for-elementor/trunk/modules/forms/ajax-handler.php

    r3375965 r3441586  
    555555                }           
    556556            }
     557
     558            if($email && !empty($form_data['send_action_brevo_api_key']) && !empty($form_data['send_action_brevo_list_id'])) {
     559                $this->bravo($form_data['send_action_brevo_api_key'], $form_data['send_action_brevo_list_id'], 'create_add', $email);
     560            }
    557561            /* end action after send */
    558562           
     
    810814        return $string;
    811815    }
     816
     817   
     818    /**
     819     * Bravo Api https://developers.brevo.com/
     820     * @param  string  $apiKey  Date in string
     821     * @param  string  $listid  Number of list id (if need add contact into list)
     822     * @param  string  $action  create|add|create_add  (create - add new contact, add - add into list, create_add - create contact and add into list)
     823     * @param  string  $email  email of contact is required field
     824     *
     825     * @return string true or contact id
     826    */
     827
     828    public function bravo($apiKey = null, $listid = null, $action = 'create', $email = '') {
     829        if(empty($apiKey)) return false;
     830        if(empty($email)) return false;
     831
     832        switch ($action) {
     833            case 'create':
     834                return ($this->_bravo_create ($apiKey, $email)) ? true : false;
     835                break;
     836            case 'add':
     837                if(empty($listid)) return false;
     838                return ($this->_bravo_add_to_list ($apiKey, $listid, $email)) ? true : false;
     839                break;
     840            case 'create_add':
     841                if(empty($listid)) return false;
     842
     843                $this->_bravo_create ($apiKey, $email);
     844                if(true) {
     845                    return ($this->_bravo_add_to_list ($apiKey, $listid, $email)) ? true : false;
     846                }
     847
     848                return false;
     849                break;
     850        }
     851
     852        return false;
     853
     854    }
     855
     856    /*
     857    * https://developers.brevo.com/reference/addcontacttolist-1
     858    */
     859    private function _bravo_add_to_list ($apiKey = null, $listid = null, $email = '') {
     860        // Replace these values with your actual data
     861        $brevoApiUrl = 'https://api.brevo.com/v3/contacts/lists/' . $listid . '/contacts/add';
     862        $brevoApiHeaders = array(
     863            'Accept'       => 'application/json',
     864            'Content-Type' => 'application/json',
     865            'api-key' => $apiKey,
     866        );
     867       
     868        $brevoApiData = array(
     869            'emails' => array(
     870                $email,
     871            ),
     872        );
     873       
     874        $response = wp_remote_post(
     875            $brevoApiUrl,
     876            array(
     877                'headers' => $brevoApiHeaders,
     878                'body'    => wp_json_encode($brevoApiData),
     879            )
     880        );
     881       
     882        if (is_wp_error($response)) {
     883            return false;
     884        } else {
     885            $body = wp_remote_retrieve_body($response);
     886            if(stripos($body, 'success') !== FALSE) {
     887                return true;
     888            }
     889        }
     890        return false;
     891    }
     892
     893    /*
     894    * https://developers.brevo.com/reference/createcontact
     895    */
     896    private function _bravo_create ($apiKey = null, $email = '') {
     897        // Replace these values with your actual data
     898
     899        $brevoApiUrl = 'https://api.brevo.com/v3/contacts';
     900        $brevoApiHeaders = array(
     901            'Accept'       => 'application/json',
     902            'Content-Type' => 'application/json',
     903            'api-key' => $apiKey,
     904        );
     905       
     906        $brevoApiData = array(
     907            "updateEnabled" => true,
     908            "email" => $email
     909        );
     910       
     911        $response = wp_remote_post(
     912            $brevoApiUrl,
     913            array(
     914                'headers' => $brevoApiHeaders,
     915                'body'    => wp_json_encode($brevoApiData),
     916            )
     917        );
     918       
     919        if (is_wp_error($response)) {
     920            return false;
     921        } else {
     922            $body = wp_remote_retrieve_body($response);
     923            $data = json_decode($body);
     924            return true;
     925        }
     926
     927        return false;
     928    }
    812929}
  • elementinvader-addons-for-elementor/trunk/modules/mail_base/mail_base.php

    r2945525 r3441586  
    2222function eli_mails_datatable()
    2323{
     24
     25    if ( ! current_user_can( 'administrator' ) ) {
     26        exit();
     27    }
     28   
     29    check_ajax_referer('eli_secure_ajax', 'eli_secure');
     30
    2431    //$this->enable_error_reporting();
    2532   // remove_action( 'shutdown', 'wp_ob_end_flush_all', 1 );
     
    198205function eli_mails_bulk_remove()
    199206{
    200 
     207    if ( ! current_user_can( 'administrator' ) ) {
     208        exit();
     209    }
     210   
     211    check_ajax_referer('eli_secure_ajax', 'eli_secure');
     212   
    201213    $ids= eli_xss_clean($_POST['ids']);
    202214
  • elementinvader-addons-for-elementor/trunk/views/blog_preview/meta.php

    r3349540 r3441586  
    66        <?php echo esc_html__('This is example meta', 'elementinvader-addons-for-elementor');?>
    77    <?php else:?>
    8         <?php echo $this->set_dinamic_field($eli_post_id, $settings['config_fields_title']); ?>
     8        <?php
     9        $meta_value = $this->set_dinamic_field($eli_post_id, $settings['config_fields_title']);
     10        if (is_array($meta_value)) {
     11            echo '<ul class="eli-meta-list">';
     12            foreach ($meta_value as $item) {
     13                echo '<li>' . wp_kses_post($item) . '</li>';
     14            }
     15            echo '</ul>';
     16        } else {
     17            echo wp_kses_post($meta_value);
     18        }
     19        ?>
    920    <?php endif?>
    1021    <?php if(!empty($settings['link_enabled'])):?>
  • elementinvader-addons-for-elementor/trunk/widgets/blog-grid.php

    r3349540 r3441586  
    367367            ]
    368368        );
    369 
    370        
     369               
    371370        if(true){
    372371            $repeater = new Repeater();
     
    429428        }
    430429
     430       
     431
    431432        if(true){
    432433            $repeater = new Repeater();
     
    12831284        );
    12841285        $this->generate_renders_tabs($selectors, 'styles_carousel_arrows_dynamic', ['margin','color','background','border','border_radius','padding','shadow','transition','font-size','hover_animation']);
    1285 
    12861286
    12871287        $this->end_controls_section();
     
    18761876        }
    18771877
    1878        
    1879         if($settings['config_limit_order_by'] == 'custom_field' && !empty($settings['config_limit_order_by_custom'])) {
    1880             $allposts ['meta_query'] = [
    1881                                             [
    1882                                                 'key' => $settings['config_limit_order_by_custom'],
    1883                                             ],
    1884                                     ];
    1885              $allposts ['meta_key'] = $settings['config_limit_order_by_custom'];                 
    1886              $allposts ['orderby'] = 'meta_value';                 
    1887              $allposts ['order'] = $settings['config_limit_order'];               
    1888         }
    1889 
    1890         // Inject repeater-based meta filters here
    1891         if ( ! empty( $settings['filter_by_meta'] ) && is_array( $settings['filter_by_meta'] ) ) {
     1878
     1879        if ($settings['config_limit_order_by'] == 'custom_field' && !empty($settings['config_limit_order_by_custom'])) {
     1880
     1881            $order_string = $settings['config_limit_order_by_custom'];
     1882            // "is_featured DESC, length, region ASC"
     1883             $allposts ['orderby'] = 'meta_value';   
     1884            $order_parts = array_map('trim', explode(',', $order_string));
     1885
     1886            $meta_query = [];
     1887            $orderby    = [];
     1888
     1889            foreach ($order_parts as $part) {
     1890                $field     = $part;
     1891                $direction = strtoupper($settings['config_limit_order']);
     1892
     1893
     1894                if (preg_match('/\s+(ASC|DESC)$/i', $part, $matches)) {
     1895                    $direction = strtoupper($matches[1]);
     1896                    $field     = trim(preg_replace('/\s+(ASC|DESC)$/i', '', $part));
     1897                }
     1898
     1899       
     1900                $alias = "{$field}_clause";
     1901
     1902                $meta_query[$alias] = [
     1903                    'key'     => $field,
     1904                    'type'    => 'NUMERIC',
     1905                    'compare' => 'EXISTS', 
     1906
     1907                ];
     1908
     1909                $orderby[$alias] = $direction;
     1910            }
     1911
     1912                $allposts['meta_query'] = $meta_query;
     1913            $allposts['orderby']    = $orderby;
     1914        }
     1915       
     1916       
     1917       
     1918    // Inject repeater-based meta filters here
     1919        if (! empty( $settings['filter_by_meta'] ) && is_array( $settings['filter_by_meta'] ) ) {
    18921920            $meta_query = isset( $allposts['meta_query'] ) ? (array) $allposts['meta_query'] : [];
    18931921
     
    19221950            }
    19231951        }
     1952       
     1953        if(isset($_GET['test'])) {
     1954            dump($allposts);
     1955        }
     1956   
    19241957
    19251958        $wp_query = new \WP_Query($allposts);
Note: See TracChangeset for help on using the changeset viewer.