Plugin Directory

Changeset 3470240


Ignore:
Timestamp:
02/26/2026 11:58:05 AM (11 days ago)
Author:
unitecms
Message:

updated to 2.0.6 version.

Location:
unlimited-elements-for-elementor/trunk
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • unlimited-elements-for-elementor/trunk/assets_libraries/filters/ue_filters.js

    r3444776 r3470240  
    805805       
    806806        var objParent = objFilter.parent();     
    807                
     807       
    808808        if(objParent.hasClass("uc-checkbox-filter-accordion-container"))
    809809            objParent = objParent.parent();
     
    12841284     */
    12851285    function termsFilterUnselectByKey(event,key){
    1286        
     1286               
    12871287        var objFilter = jQuery(this);
    12881288       
     
    14751475     */
    14761476    function initGeneralFilter(objFilter){
    1477 
     1477       
    14781478        objFilter.on(g_vars.ACTION_FILTER_CHANGE, onGeneralFilterChange);
    14791479
     
    15611561        if(!arrTerms || arrTerms.length == 0)
    15621562            return(false);
    1563 
     1563       
    15641564        jQuery.each(objFilters,function(index, filter){
    15651565
     
    17671767
    17681768        var arrTax = {};
    1769         var arrGroupTax = {};
     1769        var arrGroupTax = [];
    17701770
    17711771        if(isDebug == true){
     
    17731773            trace(arrTerms);
    17741774        }
    1775 
     1775       
    17761776        jQuery.each(arrTerms, function(index, objTerm){
    17771777
    17781778            //group term
    17791779            if(jQuery.isArray(objTerm) && objTerm.length != 0){
    1780 
     1780               
     1781                if(objTerm.length == 1){
     1782                    arrTax = buildTermsQuery_handleTerm(objTerm[0], arrTax);
     1783                    return;
     1784                }
     1785
     1786                var arrGroupTaxonomy = {};
     1787               
    17811788                jQuery.each(objTerm, function(index, groupTerm){
    17821789                   
    1783                     arrGroupTax = buildTermsQuery_handleTerm(groupTerm, arrGroupTax);
    1784 
     1790                    arrGroupTaxonomy = buildTermsQuery_handleTerm(groupTerm, arrGroupTaxonomy);
    17851791                });
    17861792
     1793                arrGroupTax.push(arrGroupTaxonomy);
     1794
    17871795            }else{  //single term
    17881796
     
    17911799
    17921800        });
    1793 
     1801       
    17941802        if(isDebug == true){
    17951803            trace("first arr tax");
     
    18031811
    18041812        if(isDebug == true){
    1805             trace("build group");
     1813            trace("group tax");
    18061814            trace(arrGroupTax);
    18071815        }
    18081816       
    1809        
    1810         //build group slugs
    1811         jQuery.each(arrGroupTax,function(taxonomy, objSlugs){
    1812            
     1817        //build group slugs, in case that there is a group
     1818       
     1819        jQuery.each(arrGroupTax, function(index, objGroupTaxonomies){
     1820           
     1821            jQuery.each(objGroupTaxonomies, function(taxonomy, objSlugs){
     1822               
    18131823            var strSlugs = buildTermsQuery_getStrSlugs(objSlugs, true);
    18141824           
    1815             var strAdd = "|"+strSlugs+"|";
     1825            var strAdd = strSlugs;
     1826            if(strSlugs.indexOf(".") !== -1){
     1827                strAdd = "|"+strSlugs+"|";  //OR inside the group
     1828            }
    18161829               
    1817             var objTax = getVal(arrTax, taxonomy);
    1818             if(!objTax){
    1819                 objTax = {};
    1820 
    1821                 strAdd = strSlugs;
    1822             }
    1823 
    1824             objTax[strAdd] = true;
    1825 
    1826             arrTax[taxonomy] = objTax;
     1830                var objTax = getVal(arrTax, taxonomy);
     1831                if(!objTax)
     1832                    objTax = {};
     1833       
     1834                objTax[strAdd] = true;
     1835       
     1836                arrTax[taxonomy] = objTax;
     1837            });
    18271838        });
    18281839
    1829 
     1840       
    18301841        if(isDebug == true){
    1831             trace("group built");
     1842            trace("The result taxonomy after grouping");
    18321843            trace(arrTax);
    18331844        }
     
    36453656            var strTerms = buildTermsQuery(arrTerms);
    36463657       
    3647             if(strTerms)
     3658            if(strTerms){
    36483659                urlAjax += "&ucterms="+strTerms;
    3649            
    3650             //set the url params as well
    3651            
    3652             urlReplace = addUrlParam(urlReplace, "ucterms="+strTerms);
    3653 
    3654             urlFilterString = addUrlParam(urlFilterString, "ucterms="+strTerms);
     3660                //set the url params as well
     3661                urlReplace = addUrlParam(urlReplace, "ucterms="+strTerms);
     3662                urlFilterString = addUrlParam(urlFilterString, "ucterms="+strTerms);
     3663            }
     3664           
    36553665        }
    36563666       
  • unlimited-elements-for-elementor/trunk/changelog.txt

    r3444776 r3470240  
    1 
    2 
    31== Changelog ==
     2
     3= 2.0.6 - 2026-01-22 =
     4
     5Plugin Changes:
     6
     7* Feature: added new option: allow empty in items settings
     8* Feature: Added "File" attribute
     9* Feature: added option in general settings: "allow upload file types"
     10* Feature: added order by functionality in the most popular posts plugin
     11* Feature: added one more schema type: News Article
     12* Feature: added autocorrection option in ajax search
     13* Feature: added support for popular posts plugin for the sorting filter
     14* Fix: make sure that gallery has item title always, in product item also
     15* Fix: fixed some logical bug with the filters
     16* Fix: fixed mini cart pricing issue
     17* Fix: fixed some small form related vulnurability
     18* Fix: fixed the authors fetch, to get only author roles and not all roles with exclude
     19* Fix: fixed some breadcrumbs issues
     20
     21
     22Widgets Changes:
     23
     24* Feature: Post Carousel Lite (Free) - Performed a comprehensive review of widget options and enabled responsive controls (Desktop, Tablet, and Mobile) for all applicable settings to ensure better layout flexibility across devices
     25* Feature: Off Canvas Filters (Pro) - A new feature has been added allowing the Simple Popup widget to be included within the Offcanvas Filters widget. It now functions seamlessly alongside other filter widgets, providing more flexible layout options.
     26* Feature: Simple Popup (Free) - A new feature has been added allowing the Simple Popup widget to be included within the Offcanvas Filters widget. It now functions seamlessly alongside other filter widgets, providing more flexible layout options.
     27* Feature: Conditions (Free) - A new Is Logged In User trigger type has been added, allowing you to set up conditional actions or visibility rules based on whether a user is currently authenticated or browsing as a guest.
     28* Feature: Woo Mini Cart (Free) - A new Show Subtotal Type option has been added, allowing users to choose whether to display prices inclusive of tax or exclusive of tax.
     29* Feature: Post Carousel Lite (Free) - A new Link Entire Item Type option has been added, allowing users to choose specific link sources such as a Dynamic Post Popup, a Link from a Custom Field, and other dynamic destinations for the item-wide click action.
     30* Feature: Active Filters (Pro) - A new Flex Wrap option has been added, giving users the ability to control whether elements within a container should wrap onto multiple lines or stay on a single row.
     31* Feature: Post Grid (Free) - A new Order option has been added for each Additional Data element.
     32* Feature: Post Magazine Grid (Pro) - A new Order option has been added for each Additional Data element
     33* Feature: Post Carousel (Free) - A new Order option has been added for each Additional Data element
     34* Feature: Video on Hover (Free) - A new Show Controls option has been added, giving users the ability to display or hide native video player controls
     35* Feature: Post Magazine Grid (Pro) - A new Show Post Views option has been added, allowing users to display the total view count for individual posts within the widget.
     36* Feature: Post Carousel (Free) - A new Show Post Views option has been added, allowing users to display the total view count for individual posts within the widget.
     37* Feature: Video on Hover (Free) - new Play on Click value has been added to the Video Play Mode option, allowing videos to remain static until a user specifically interacts with them with a click event.
     38* Feature: Text Field (Free) - A new Hidden option has been implemented that allows a field to be visually concealed while ensuring that Form Entries still receive and record data from it
     39* Feature: AJAX Search (Free) - Added Autocorrection option that allows to display a suggestion with a clickable link when the initial search returns no results due to a potential typo.
     40* Feature: Video Carousel (Free) - A new YouTube video source option has been added to allow users to directly integrate and display video content from the platform within the widget.
     41* Feature: Repeater Table (Pro) - A new feature has been enabled within the widget that allows users to remove all existing items, bypassing the typical restriction in item-based widgets that requires at least one item to remain.
     42* Change: Icon Pointer Button (Pro) - Updated the Icon Selection attribute to utilize the native Icon Library, enabling support for both standard font icons and custom SVG graphics
     43* Change: Masonry & Justified Gallery (Free) - To improve clarity and avoid user confusion, the Column gallery type has been renamed to Masonry, more accurately reflecting its layout behavior.
     44* Fix: Button Icon Hover Effect (Pro) - Removed the Visibility Conditions options. These settings were previously added in error, as they are only compatible with form field logic and cannot function within standard widget layouts
     45* Fix: Background Switcher (Free) - An issue was resolved where disabling the First Selected option caused the widget to render as a blank space with no images visible. The widget now correctly initializes its display state even when no item is pre-selected.
     46* Fix: Background Switcher (Free) - An issue was resolved where the Hover Blur Effect only applied while the mouse was physically over a widget item. The effect has been corrected to persist on the active/selected item even when the mouse leaves the widget area
     47* Fix: Linear Progress Bar (Free) - An issue was resolved where browser background optimization features, such as bfcache and tab throttling, would freeze the widget's execution state. This caused the progress bar to remain stuck in a finished or desynchronized state upon page revisit or tab reactivation
     48* Fix: Post Carousel Lite (Free) - An issue was resolved where the Link Entire Item option was not functioning as expected
     49* Fix: WordPress Menu (Free) - An issue was resolved in the Elementor editor where the dropdown menu failed to display after clicking the burger icon, ensuring that navigation previews now function correctly within the editing interface.
     50* Fix: Huge Shapes Background (Pro) - An issue was resolved where the clearRect function utilized outdated or mismatched canvas dimensions, causing previous animation frames to persist and accumulate as visual "ghosting" or "smearing" artifacts.
     51* Fix: WordPress Menu (Free) - An issue was resolved in the Menu widget where the Clickable Parent Item option was incorrectly hidden when the Responsive Behavior was set to "Slide." This setting now logic-gates correctly: parent items remain visible and clickable on desktop, while automatically adjusting only at the responsive breakpoint to ensure sub-menus function properly on mobile devices.
     52* Fix: Alphabet Filter (Pro) - An issue was resolved where users were required to click the Close icon twice to unselect an active filter, ensuring that filters now deactivate as expected with a single click.
     53* Fix: Post Carousel (Free) - An issue was resolved where the Author element failed to inherit the color value defined in the Meta Data Color option
     54* Fix: Conditions (Free) - An issue was resolved where ACF Field trigger types were not functioning correctly, ensuring that conditional logic or actions tied to Advanced Custom Fields now trigger as expected
     55* Fix: Post Carousel (Free) - The CSS priority of the title selector has been increased to ensure that its specific styling consistently overrides any conflicting general styles
     56* Fix: Animated Split Text (Pro) - An issue was resolved where the Splitting library was being initialized before the necessary JavaScript files had fully loaded on the page, preventing proper execution.
     57
     58
    459
    560= 2.0.5 - 2026-01-22 =
  • unlimited-elements-for-elementor/trunk/inc_php/framework/settings.class.php

    r3397365 r3470240  
    3939        const TYPE_LINK = "link";
    4040        const TYPE_IMAGE = "image";
     41        const TYPE_FILE = "file";
    4142        const TYPE_BOOLEAN = "boolean";
    4243        const TYPE_EDITOR = "editor";
     
    754755            $this->add($name, $defaultValue, $text, self::TYPE_IMAGE, $arrParams);
    755756        }
     757
     758    /**
     759     * add file chooser setting
     760     */
     761    public function addFile($name, $defaultValue = "", $text = "", $arrParams = array()){
     762
     763        $arrParams["label_block"] = true;
     764
     765        $this->add($name, $defaultValue, $text, self::TYPE_FILE, $arrParams);
     766    }
    756767
    757768        /**
     
    14381449                if(empty($addSettingName))
    14391450                    continue;
    1440 
    1441                 $this->updateSettingProperty($addSettingName, self::PARAM_NODRAW, true);
     1451               
     1452                $addSettingNames = array();
     1453                if(is_array($addSettingName)){
     1454                    $addSettingNames = $addSettingName;
     1455                }else{
     1456                    $addSettingNames = explode(",", $addSettingName);
     1457                }
     1458               
     1459                $addSettingNames = array_map("trim", $addSettingNames);
     1460                $addSettingNames = array_filter($addSettingNames, function($value){
     1461                    return $value !== "";
     1462                });
     1463
     1464                foreach($addSettingNames as $addSettingSingleName){
     1465                    $this->updateSettingProperty($addSettingSingleName, self::PARAM_NODRAW, true);
     1466                }
    14421467            }
    14431468
  • unlimited-elements-for-elementor/trunk/inc_php/framework/settings_output_wide.class.php

    r3329756 r3470240  
    5454           
    5555            $addField = UniteFunctionsUC::getVal($setting, UniteSettingsUC::PARAM_ADDFIELD);
     56            $addFields = array();
     57            if(!empty($addField)){
     58                if(is_array($addField)){
     59                    $addFields = $addField;
     60                }else{
     61                    $addFields = explode(",", $addField);
     62                }
     63               
     64                $addFields = array_map("trim", $addFields);
     65                $addFields = array_filter($addFields, function($value){
     66                    return $value !== "";
     67                });
     68            }
    5669           
    5770            $drawTh = true;
     
    6982                       
    7083            <?php
    71             if(!empty($addField)):
    72                
    73                 $addSetting = $this->settings->getSettingByName($addField);
    74                 UniteFunctionsUC::validateNotEmpty($addSetting,"AddSetting {$addField}");
    75            
    76                 $addSettingText = UniteFunctionsUC::getVal($addSetting,"text","");
    77                 $addSettingText = str_replace(" ","&nbsp;", $addSettingText);
     84            if(!empty($addFields)):
     85               
     86                $addSettings = array();
     87                $hasAddSettingText = false;
     88                foreach($addFields as $addFieldName){
     89                    $addSetting = $this->settings->getSettingByName($addFieldName);
     90                    UniteFunctionsUC::validateNotEmpty($addSetting,"AddSetting {$addFieldName}");
     91                    $addSettings[] = $addSetting;
     92                   
     93                    $addSettingText = UniteFunctionsUC::getVal($addSetting,"text","");
     94                    if(!empty($addSettingText))
     95                        $hasAddSettingText = true;
     96                }
     97               
    7898                $tdSettingAdd = "";
    79                 if(!empty($addSetting)){
     99                if(!empty($addSettings)){
    80100                    $tdSettingAdd = ' class="unite-settings-onecell" colspan="2"';
    81101                }
     
    85105                uelm_echo($rowClass)?> valign="top">
    86106               
    87                 <?php if(empty($addSettingText)):?>
     107                <?php if($hasAddSettingText == false):?>
    88108                   
    89109                    <th <?php uelm_echo($textStyle)?> scope="row" <?php uelm_echo($textWidth) ?>>
     
    113133                            ?>
    114134                           
    115                         <?php if(!empty($addSettingText)):?>
     135                        <?php if($hasAddSettingText == true):?>
    116136                            <span class="setting_onecell_horsap"></span>
    117137                        <?php endif?>
    118138                    </span>
    119139                   
    120                     <span id="<?php echo esc_attr($addSetting["id_row"])?>">
    121                         <span class='setting_onecell_text'><?php echo esc_html($addSettingText)?></span>               
    122                         <?php
    123                             $this->drawInputs($addSetting);
    124                             $this->drawInputAdditions($addSetting);
     140                    <?php foreach($addSettings as $addSetting): ?>
     141                        <?php
     142                            $addSettingText = UniteFunctionsUC::getVal($addSetting,"text","");
     143                            $addSettingText = str_replace(" ","&nbsp;", $addSettingText);
    125144                        ?>
    126                     </span>
     145                        <span id="<?php echo esc_attr($addSetting["id_row"])?>">
     146                            <?php if(!empty($addSettingText)):?>
     147                                <span class='setting_onecell_text'><?php echo esc_html($addSettingText)?></span>
     148                            <?php endif?>
     149                            <?php
     150                                $this->drawInputs($addSetting);
     151                                $this->drawInputAdditions($addSetting);
     152                            ?>
     153                        </span>
     154                    <?php endforeach; ?>
    127155                </td>
    128156                </tr>
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_ajax_search.class.php

    r3379552 r3470240  
    450450       
    451451    }
     452   
     453    /**
     454     * get suggestion data for ajax search
     455     */
     456    public function getSearchSuggestionData($search, $args){
     457       
     458        $searchToken = $this->getSuggestionToken($search);
     459       
     460        if(empty($searchToken))
     461            return(null);
     462       
     463        $suggestion = $this->getSuggestionFromArgs($searchToken, $args);
     464       
     465        if(empty($suggestion) || $suggestion === $searchToken)
     466            return(null);
     467       
     468        $output = array();
     469        $output["original"] = $search;
     470        $output["suggestion"] = $suggestion;
     471       
     472        return($output);
     473    }
     474   
     475    /**
     476     * get suggestion from query args
     477     */
     478    private function getSuggestionFromArgs($searchToken, $args){
     479       
     480        if(empty($args) || is_array($args) == false)
     481            return(null);
     482       
     483        if(isset($args["s"]))
     484            unset($args["s"]);
     485       
     486        if(isset($args["search"]))
     487            unset($args["search"]);
     488       
     489        if(isset($args["paged"]))
     490            unset($args["paged"]);
     491       
     492        if(isset($args["offset"]))
     493            unset($args["offset"]);
     494       
     495        $args["posts_per_page"] = 50;
     496        $args["no_found_rows"] = true;
     497        $args["ignore_sticky_posts"] = true;
     498       
     499        $query = new WP_Query($args);
     500       
     501        if(empty($query) || empty($query->posts))
     502            return(null);
     503       
     504        $maxDistance = $this->getSuggestionMaxDistance($searchToken);
     505        $bestWord = null;
     506        $bestDistance = null;
     507       
     508        foreach($query->posts as $post){
     509           
     510            $title = "";
     511           
     512            if(is_object($post) && isset($post->post_title)){
     513                $title = $post->post_title;
     514            }else{
     515                $title = UniteFunctionsUC::getVal($post, "post_title");
     516            }
     517           
     518            if(empty($title))
     519                continue;
     520           
     521            $arrWords = $this->getSuggestionWordsFromTitle($title);
     522           
     523            if(empty($arrWords))
     524                continue;
     525           
     526            foreach($arrWords as $word){
     527               
     528                if($word === $searchToken)
     529                    return(null);
     530               
     531                $lenDiff = abs(strlen($word) - strlen($searchToken));
     532               
     533                if($lenDiff > $maxDistance)
     534                    continue;
     535               
     536                $distance = levenshtein($searchToken, $word);
     537               
     538                if($distance === false)
     539                    continue;
     540               
     541                if($distance <= $maxDistance && ($bestDistance === null || $distance < $bestDistance)){
     542                    $bestDistance = $distance;
     543                    $bestWord = $word;
     544                   
     545                    if($bestDistance === 0)
     546                        break 2;
     547                }
     548               
     549            }
     550           
     551        }
     552       
     553        return($bestWord);
     554    }
     555   
     556    /**
     557     * get suggestion token (single word)
     558     */
     559    private function getSuggestionToken($search){
     560       
     561        $search = trim($search);
     562       
     563        if(empty($search))
     564            return(null);
     565       
     566        $search = strtolower($search);
     567        $search = preg_replace("/[^a-z0-9\\s]/", " ", $search);
     568        $tokens = preg_split("/\\s+/", $search, -1, PREG_SPLIT_NO_EMPTY);
     569       
     570        if(empty($tokens))
     571            return(null);
     572       
     573        $token = $tokens[0];
     574       
     575        if(strlen($token) < 3)
     576            return(null);
     577       
     578        return($token);
     579    }
     580   
     581    /**
     582     * get words from title
     583     */
     584    private function getSuggestionWordsFromTitle($title){
     585       
     586        $title = strtolower($title);
     587        $title = preg_replace("/[^a-z0-9\\s]/", " ", $title);
     588        $words = preg_split("/\\s+/", $title, -1, PREG_SPLIT_NO_EMPTY);
     589       
     590        if(empty($words))
     591            return(array());
     592       
     593        $output = array();
     594       
     595        foreach($words as $word){
     596           
     597            if(strlen($word) < 3)
     598                continue;
     599           
     600            $output[$word] = true;
     601        }
     602       
     603        $output = array_keys($output);
     604       
     605        return($output);
     606    }
     607   
     608    /**
     609     * get suggestion max distance
     610     */
     611    private function getSuggestionMaxDistance($word){
     612       
     613        $length = strlen($word);
     614       
     615        if($length <= 4)
     616            return(1);
     617       
     618        if($length <= 7)
     619            return(2);
     620       
     621        return(3);
     622    }
    452623
    453624}
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_breadcrumbs.class.php

    r3329756 r3470240  
    2828            self::$showDebug = true;
    2929       
     30        $debugWrapperStyle = 'background:#fff; border:2px dashed #999; padding:1em 1.25em; margin:1em 0; font-family:inherit;';
     31        if(self::$showDebug == true)
     32            echo '<div class="uc-breadcrumbs-debug" style="' . esc_attr($debugWrapperStyle) . '">';
    3033           
    3134        if(self::$showDebug == true)
     
    4245        $search_page_text = $this->getParamValueByKey('search_page_text', $params, 'Results For:');
    4346
     47        if(self::$showDebug == true) {
     48            dmp("Options:");
     49            dmp(array(
     50                'show_home' => $show_home,
     51                'home_text' => $home_text,
     52                'show_category_breadcrumbs' => $show_category_breadcrumbs,
     53                'categories_show_direction' => $categories_show_direction,
     54                'max_category_depth' => $max_category_depth,
     55                'show_blog_page' => $show_blog_page,
     56                'search_page_text' => $search_page_text,
     57            ));
     58        }
     59
    4460        if($show_home === 'true') {
    4561            $items[] = $this->getHomeItem($home_text);
     
    6480                dmp("---- Category or Archive -----");
    6581
    66             $items = array_merge($items, $this->getBreadcrumbs_category($show_category_breadcrumbs, $categories_show_direction, $max_category_depth));
     82            $items = array_merge($items, $this->getBreadcrumbs_category($show_category_breadcrumbs, $categories_show_direction, $max_category_depth, $show_blog_page));
    6783        } elseif(is_page()) {
    6884
     
    120136            dmp("The Items:");
    121137            dmp($items);
     138            echo '</div>';
    122139        }
    123140
     
    191208     * @param string $categories_show_direction Direction to show categories from
    192209     * @param int $max_category_depth Maximum depth of categories to show
    193      * @return array Breadcrumb items
    194      */
    195     private function getBreadcrumbs_category($show_category_breadcrumbs, $categories_show_direction, $max_category_depth) {
     210     * @param string $show_blog_page Whether to show the blog/post type page in breadcrumbs
     211     * @return array Breadcrumb items
     212     */
     213    private function getBreadcrumbs_category($show_category_breadcrumbs, $categories_show_direction, $max_category_depth, $show_blog_page = 'true') {
    196214       
    197215        $items = array();
     
    207225        }
    208226
     227        if($current_category instanceof WP_Post_Type) {
     228            $label = !empty($current_category->labels->name) ? $current_category->labels->name : $current_category->name;
     229            $url = ($current_category->has_archive) ? get_post_type_archive_link($current_category->name) : '';
     230            $items[] = array(
     231                'text' => html_entity_decode($label, ENT_QUOTES, 'UTF-8'),
     232                'url' => $url,
     233                'type' => ''
     234            );
     235            return $items;
     236        }
     237
    209238        $taxonomy = $current_category->taxonomy;
     239
     240        if($show_blog_page === 'true') {
     241            if(self::$showDebug == true)
     242                dmp("add blog/post type option (category)");
     243            if($taxonomy === 'category') {
     244                $items = $this->addBlogPage($items);
     245            } else {
     246                $objTax = get_taxonomy($taxonomy);
     247                if(!empty($objTax->object_type) && is_array($objTax->object_type)) {
     248                    $postType = $objTax->object_type[0];
     249                    $objPostType = get_post_type_object($postType);
     250                    $items = $this->addPostTypeItem($items, $objPostType);
     251                }
     252            }
     253        }
    210254
    211255        $ancestors = get_ancestors($current_category->term_id,  $taxonomy);
     
    412456        $items = array();
    413457
    414         $post_type = get_post_type_object(get_post_type());
    415         if($post_type) {
     458        $post_type = get_queried_object();
     459        if($post_type && $post_type instanceof WP_Post_Type) {
     460            $label = !empty($post_type->labels->name) ? $post_type->labels->name : $post_type->name;
     461            $url = ($post_type->has_archive) ? get_post_type_archive_link($post_type->name) : '';
    416462            $items[] = array(
    417                 'text' => html_entity_decode($post_type->labels->name, ENT_QUOTES, 'UTF-8'),
    418                 'url' => '',
     463                'text' => html_entity_decode($label, ENT_QUOTES, 'UTF-8'),
     464                'url' => $url,
    419465                'type' => ''
    420466            );
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_client_text.php

    r3277574 r3470240  
    9494        "uc_map"=>esc_html__("Google Map Picker","unlimited-elements-for-elementor"),
    9595        "uc_image"=>esc_html__("Image","unlimited-elements-for-elementor"),
     96        "uc_file"=>esc_html__("File","unlimited-elements-for-elementor"),
    9697        "uc_mp3"=>esc_html__("Audio","unlimited-elements-for-elementor"),
    9798        "uc_post"=>esc_html__("Post","unlimited-elements-for-elementor"),
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_dialog_param.class.php

    r3349280 r3470240  
    4646    const PARAM_SHAPE = "uc_shape";
    4747    const PARAM_IMAGE = "uc_image";
     48    const PARAM_FILE = "uc_file";
    4849    const PARAM_MAP = "uc_map";
    4950    const PARAM_ADDONPICKER = "uc_addonpicker";
     
    189190        $this->addParam(self::PARAM_LINK, esc_html__("Link", "unlimited-elements-for-elementor"));
    190191        $this->addParam(self::PARAM_IMAGE, esc_html__("Image (media)", "unlimited-elements-for-elementor"));
     192        $this->addParam(self::PARAM_FILE, esc_html__("File (media)", "unlimited-elements-for-elementor"));
    191193        $this->addParam(self::PARAM_HR, esc_html__("HR Line", "unlimited-elements-for-elementor"));
    192194        $this->addParam(self::PARAM_HEADING, esc_html__("Heading", "unlimited-elements-for-elementor"));
     
    297299                self::PARAM_WOO_CATS,
    298300                self::PARAM_INSTAGRAM,
     301                self::PARAM_FILE,
     302                self::PARAM_SPECIAL,
    299303                self::PARAM_ICON,
    300                 self::PARAM_SPECIAL,
    301304            ),
    302305        );
     
    416419     * put checkbox input
    417420     */
    418     protected function putCheckbox($name, $text){
     421    protected function putCheckbox($name, $text, $isDefaultChecked = false){
     422       
     423        $checkedAttr = "";
     424        if($isDefaultChecked === true)
     425            $checkedAttr = ' data-defaultchecked="true" checked';
     426       
    419427        ?>
    420428            <label class="unite-inputs-label-inline-free">
    421429                    <?php echo esc_html($text)?>:
    422                     <input type="checkbox" onfocus="this.blur()" name="<?php echo esc_attr($name)?>">
     430                    <input type="checkbox" onfocus="this.blur()" name="<?php echo esc_attr($name)?>"<?php echo $checkedAttr?>>
    423431            </label>
    424432
     
    687695
    688696        $htmlSelect = HelperHtmlUC::getHTMLSelect($arrTypes,"image", "name='media_type' class='uc-control' data-controlled-selector='.uc-media-param-image-attributes'",true);
    689 
     697       
    690698        ?>
    691699            <?php esc_attr_e("Media Type","unlimited-elements-for-elementor") ?>:
     
    701709            <div class="uc-media-param-image-attributes" data-control="image">
    702710
    703 
    704711                <?php $this->putImageSelectInput("default_value",esc_html__("Default Image","unlimited-elements-for-elementor")); ?>
    705712
     
    725732
    726733
     734
     735        <?php
     736    }
     737
     738    /**
     739     * put file param settings
     740     */
     741    private function putFileParam(){
     742
     743        ?>
     744            <div class="unite-inputs-sap-double"></div>
     745
     746            <div class="unite-inputs-label">
     747                <?php esc_html_e("Allowed File Types", "unlimited-elements-for-elementor")?>
     748            </div>
     749
     750            <div class="unite-inputs-sap"></div>
     751
     752            <?php $this->putCheckbox("file_type_application", __("Application", "unlimited-elements-for-elementor"), true)?>
     753            <div class="unite-inputs-description">
     754                <?php esc_html_e("Extensions: pdf, doc, docx, xls, xlsx, ppt, pptx, zip (plus other WordPress application types)", "unlimited-elements-for-elementor")?>
     755            </div>
     756            <div class="vert_sap10"></div>
     757            <?php $this->putCheckbox("file_type_image", __("Image", "unlimited-elements-for-elementor"))?>
     758            <div class="unite-inputs-description">
     759                <?php esc_html_e("Extensions: jpg, jpeg, png, gif, webp, bmp, tiff, ico (plus other WordPress image types)", "unlimited-elements-for-elementor")?>
     760            </div>
     761            <div class="vert_sap10"></div>
     762            <?php $this->putCheckbox("file_type_video", __("Video", "unlimited-elements-for-elementor"))?>
     763            <div class="unite-inputs-description">
     764                <?php esc_html_e("Extensions: mp4, mov, webm, ogv, avi, wmv, flv, mpeg, 3gp (plus other WordPress video types)", "unlimited-elements-for-elementor")?>
     765            </div>
     766            <div class="vert_sap10"></div>
     767            <?php $this->putCheckbox("file_type_svg", __("SVG", "unlimited-elements-for-elementor"))?>
    727768
    728769        <?php
     
    750791                ));
    751792            break;
     793            case "file":
     794                $objSettings->addFile($name, "", $text, array(
     795                    "source" => "addon",
     796                    "url_name" => $name,
     797                    "file_types" => array("application", "image", "video", "svg"),
     798                ));
     799            break;
    752800            case "mp3":
    753801                $objSettings->addMp3($name, "", $text, array("source"=>"addon"));
     
    771819
    772820        $this->putSingleSettingInput($name, $text, "image");
     821    }
     822
     823    /**
     824     * put file select input
     825     */
     826    protected function putFileSelectInput($name, $text){
     827
     828        $this->putSingleSettingInput($name, $text, "file");
    773829    }
    774830
     
    16111667                $this->putImageParam();
    16121668            break;
     1669            case self::PARAM_FILE:
     1670                $this->putFileParam();
     1671            break;
    16131672            case "uc_mp3":
    16141673                $this->putMp3Param();
     
    20702129            self::PARAM_HEADING,
    20712130            self::PARAM_IMAGE,
     2131            self::PARAM_FILE,
    20722132            self::PARAM_AUDIO,
    20732133            self::PARAM_ICON,
     
    21072167            self::PARAM_HEADING,
    21082168            self::PARAM_IMAGE,
     2169            self::PARAM_FILE,
    21092170            self::PARAM_AUDIO,
    21102171            self::PARAM_ICON,
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_filters_process.class.php

    r3444776 r3470240  
    163163        }
    164164
     165        // add WPP (WordPress Popular Posts) ordering option when plugin exists and not for Woo
     166        if($isForWooProducts == false && UniteCreatorPluginIntegrations::isWPPopularPostsExists() === true){
     167            $output["popular_wpp"] = __("Popular Posts", "unlimited-elements-for-elementor");
     168        }
    165169
    166170        return($output);
     
    532536        //check if valid
    533537        $arrOrderby = UniteFunctionsWPUC::getArrSortBy(true);
     538
     539        // allow WPP orderby when WordPress Popular Posts plugin is active
     540        if(UniteCreatorPluginIntegrations::isWPPopularPostsExists() === true){
     541            $arrOrderby["popular_wpp"] = __("Popular Posts", "unlimited-elements-for-elementor");
     542        }
    534543
    535544        if($orderby == "id")
     
    23792388
    23802389        GlobalsProviderUC::$isUnderAjaxSearch = false;
    2381 
     2390       
    23822391        $htmlGridItems = UniteFunctionsUC::getVal($arrHtmlWidget, "html");
    23832392        $htmlGridItems2 = UniteFunctionsUC::getVal($arrHtmlWidget, "html2");
     
    23972406        if(!empty($htmlGridItems2))
    23982407            $outputData["html_items2"] = $htmlGridItems2;
     2408
     2409        //add search suggestion data if no results
     2410        //autocorrection in options
     2411       
     2412        $lastQuery = GlobalsProviderUC::$lastPostQuery;
     2413       
     2414        $isAutoCorrect = UniteFunctionsUC::getVal(GlobalsProviderUC::$lastWidgetParams, "search_autocorrect");
     2415        $isAutoCorrect = UniteFunctionsUC::strToBool($isAutoCorrect);
     2416               
     2417        if($isAutoCorrect == true && !empty($lastQuery) && (int)$lastQuery->found_posts === 0){
     2418                       
     2419            $lastQueryArgs = GlobalsProviderUC::$lastQueryArgs;
     2420            $searchTerm = UniteFunctionsUC::getVal($lastQueryArgs, "s");
     2421            $searchTerm = trim($searchTerm);
     2422           
     2423            if(!empty($searchTerm)){
     2424                $objAjaxSearch = new UniteCreatorAjaxSeach();
     2425                $suggestionData = $objAjaxSearch->getSearchSuggestionData($searchTerm, $lastQueryArgs);
     2426               
     2427                if(!empty($suggestionData))
     2428                    $outputData["search_suggestion"] = $suggestionData;
     2429            }
     2430        }
    23992431
    24002432
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_form.class.php

    r3403331 r3470240  
    183183                $fieldParams["allowed_types"] = $this->prepareFilesFieldAllowedTypes($fieldSettings);
    184184            }else{
     185                // Sanitize user input to prevent stored XSS in form entries
     186                if (is_string($fieldValue)) {
     187                    $fieldValue = sanitize_textarea_field($fieldValue);
     188                }
    185189                $fieldValue = $this->prettifyFieldValue($fieldType, $fieldValue);
    186190            }
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_globals.class.php

    r3397365 r3470240  
    198198        public static $isInsidePlugin = false;  //set in provider_admin
    199199       
     200        public static $hideDebug = false;
     201       
    200202       
    201203        /**
     
    332334            if($showQueryDebugByUrl == true)
    333335                self::$showQueryDebugByUrl = true;
     336            $showQueryDebugTermsByUrl = HelperUC::hasPermissionsFromQuery("ucquerydebug_terms");
     337            if($showQueryDebugTermsByUrl == true)
     338                self::$showQueryDebugTermsByUrl = true;
    334339           
    335340                       
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_output.class.php

    r3444776 r3470240  
    11011101    }
    11021102
    1103     /*
    1104     private function processParamCSSSelector_typography($param, $selectors){
    1105 
    1106         $value = UniteFunctionsUC::getVal($param, "value");
    1107 
    1108         $style = "";
    1109         $selector = $this->combineCSSSelectors($selectors);
    1110 
    1111         // import font family
    1112         $fontFamily = UniteFunctionsUC::getVal($value, "font_family");
    1113 
    1114         if(empty($fontFamily) === false){
    1115             $fontData = HelperUC::getFontPanelData();
    1116             $googleFonts = UniteFunctionsUC::getVal($fontData, "arrGoogleFonts");
    1117 
    1118             if(empty($googleFonts[$fontFamily]) === false){
    1119                 $fontUrl = HelperHtmlUC::getGoogleFontUrl($googleFonts[$fontFamily]);
    1120 
    1121                 $this->addon->addCssInclude($fontUrl);
    1122             }
    1123         }
    1124 
    1125         $regularFields = array(
    1126             "font_family" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "family"),
    1127             "font_style" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "style"),
    1128             "font_weight" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "weight"),
    1129             "text_decoration" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "decoration"),
    1130             "text_transform" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "transform"),
    1131         );
    1132 
    1133         $responsiveFields = array(
    1134             "font_size" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "size"),
    1135             "line_height" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "line-height"),
    1136             "letter_spacing" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "letter-spacing"),
    1137             "word_spacing" => HelperHtmlUC::getCSSSelectorValueByParam(UniteCreatorDialogParam::PARAM_TYPOGRAPHY, "word-spacing"),
    1138         );
    1139 
    1140         $style .= $this->prepareCSSSelectorFieldsStyle($regularFields, $selector, $value);
    1141         $style .= $this->prepareCSSSelectorResponsiveFieldsStyle($responsiveFields, $selector, $value);
    1142 
    1143         return $style;
    1144     }
    1145     */
    1146 
    11471103    /**
    11481104     * process css selector of text shadow param
     
    32153171                    $rootId = $this->getWidgetID();
    32163172               
    3217                 $params = $this->addon->getProcessedMainParamsValues($this->processType);
    3218 
     3173                $currentHideDebug = GlobalsUC::$hideDebug;
     3174                GlobalsUC::$hideDebug = true;
     3175                $params = $this->addon->getProcessedMainParamsValues($this->processType);
     3176                GlobalsUC::$hideDebug = $currentHideDebug;
     3177               
    32193178                $advancedAddClasses = UniteFunctionsUC::getVal($params, "advanced_css_classes");
    32203179
     
    34643423            return($this->paramsCache);
    34653424        }
    3466 
    3467         $this->paramsCache = $this->addon->getProcessedMainParamsValues($this->processType);
    3468 
     3425       
     3426        $this->paramsCache = $this->addon->getProcessedMainParamsValues($this->processType, true);
    34693427        $allParamDefs = $this->addon->getParams();
    34703428
     
    37603718
    37613719                        if(is_string($dataValue) && $dataValue === "uc_items"){
    3762                             // $arrItemData = $this->addon->getProcessedItemsData($this->processType);
    37633720                            $arrItemData = $this->getProcessedItemsData();
    37643721                        }elseif(is_array($dataValue)){
     
    37723729                    break;
    37733730                    default:
    3774                         // $arrItemData = $this->addon->getProcessedItemsData($this->processType);
    37753731                        $arrItemData = $this->getProcessedItemsData();
    37763732                    break;
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_params_processor.class.php

    r3442278 r3470240  
    9393                case "uc_image":
    9494                case "uc_mp3":
     95                case UniteCreatorDialogParam::PARAM_FILE:
    9596                    $value = HelperUC::URLtoFull($value);
    9697                    break;
     
    335336
    336337        //on production don't return empty span
    337         if($this->processType == self::PROCESS_TYPE_OUTPUT && empty($arrFont) && $isReturnCss == false)
     338        if(($this->processType == self::PROCESS_TYPE_OUTPUT) && empty($arrFont) && $isReturnCss == false)
    338339            return($value);
    339340
     
    761762            case self::PROCESS_TYPE_OUTPUT:
    762763            case self::PROCESS_TYPE_OUTPUT_BACK:
    763 
    764764                $data[$name] = $this->getPostData($postID, $arrPostAdditions);
    765765            break;
     
    10381038            $data[$keyThumb] = $imageUrl;
    10391039       
     1040        return $data;
     1041    }
     1042
     1043    /**
     1044     * process file param value, add to data
     1045     */
     1046    protected function getProcessedParamsValue_file($data, $value, $param){
     1047
     1048        $name = UniteFunctionsUC::getVal($param, "name");
     1049
     1050        $fileId = null;
     1051        $fileUrl = null;
     1052
     1053        if(is_array($value) === true){
     1054            $fileId = UniteFunctionsUC::getVal($value, "id");
     1055            $fileUrl = UniteFunctionsUC::getVal($value, "url");
     1056        }else{
     1057            if(is_numeric($value) === true)
     1058                $fileId = $value;
     1059            else
     1060                $fileUrl = $value;
     1061        }
     1062
     1063        if(empty($fileId) === true && empty($fileUrl) === true) {
     1064            $data[$name] = "";
     1065            return $data;
     1066        }
     1067
     1068        if(empty($fileId) === false)
     1069            $fileUrl = wp_get_attachment_url($fileId);
     1070        else
     1071            $fileUrl = HelperUC::URLtoFull($fileUrl);
     1072
     1073        //sanitize the url
     1074        if(!empty($fileUrl))
     1075            $fileUrl = UniteFunctionsUC::sanitize($fileUrl, UniteFunctionsUC::SANITIZE_URL);
     1076
     1077        $data[$name] = $fileUrl;
     1078
    10401079        return $data;
    10411080    }
     
    19632002                $data = $this->getProcessedParamsValue_image($data, $value, $param);
    19642003            break;
     2004            case UniteCreatorDialogParam::PARAM_FILE:
     2005                $data = $this->getProcessedParamsValue_file($data, $value, $param);
     2006            break;
    19652007            case UniteCreatorDialogParam::PARAM_POST:
    19662008                $data = $this->getProcessedParamsValue_post($data, $value, $param, $processType);
     
    20672109        //and if the source is terms, remove the users param
    20682110        $arrParams = $this->modifyParamsBySpecialAddonBehaviour($arrParams);
    2069        
     2111
    20702112        foreach($arrParams as $param){
    20712113            $type = UniteFunctionsUC::getVal($param, "type");
     
    20852127            $value = UniteFunctionsUC::getVal($param, "value", $defaultValue);
    20862128            $value = $this->convertValueByType($value, $type, $param);
    2087 
     2129           
    20882130            if($type !== "imagebase_fields")
    20892131                $data[$name] = $value;
    20902132
    2091             $data = $this->getProcessedParamData($data, $value, $param, $processType);
    2092         }
     2133            $data = $this->getProcessedParamData($data, $value, $param, $processType); 
     2134        }   
    20932135
    20942136        $data = $this->modifyDataBySpecialAddonBehaviour($data);
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_schema.class.php

    r3429507 r3470240  
    135135                "title"=>"Search Results Page",
    136136                "multiple"=>true
     137            ),
     138            array(
     139                "type"=>"NewsArticle",
     140                "title"=>"News Article"
    137141            )
    138142           
     
    987991        $arrParam = array();
    988992        $arrParam["origtype"] = UniteCreatorDialogParam::PARAM_TEXTFIELD;
     993        $arrParam["add_dynamic"] = true;
    989994        $arrParam["elementor_condition"] = array($name."_enable"=>"true",$name."_type"=>
    990995            array("howto",
     
    12821287            case "searchresultspage":
    12831288                return $this->schemaSearchResultsPage($items, $title);
     1289            case "newsarticle":
     1290                return $this->schemaNewsArticle($items);
    12841291            case "custom":
    12851292               
     
    16961703
    16971704/**
     1705 * NewsArticle (schema.org/NewsArticle - Article subtype for news)
     1706 */
     1707private function schemaNewsArticle($items) {
     1708
     1709    $schema = array();
     1710
     1711    foreach ($items as $item) {
     1712
     1713        $article = array(
     1714            '@context' => self::SCHEMA_ORG_SITE,
     1715            '@type'    => 'NewsArticle',
     1716            'headline' => $item[self::ROLE_TITLE],
     1717        );
     1718
     1719        if (!empty($item[self::ROLE_CONTENT])) {
     1720            $article['articleBody'] = $item[self::ROLE_CONTENT];
     1721        }
     1722
     1723        if (!empty($item[self::ROLE_DESCRIPTION])) {
     1724            $article['description'] = $item[self::ROLE_DESCRIPTION];
     1725        }
     1726
     1727        if (!empty($item[self::ROLE_IMAGE])) {
     1728            $article['image'] = $item[self::ROLE_IMAGE];
     1729        }
     1730
     1731        if (!empty($item[self::ROLE_LINK])) {
     1732            $article['url'] = $item[self::ROLE_LINK];
     1733            $article['mainEntityOfPage'] = $item[self::ROLE_LINK];
     1734        }
     1735
     1736        if (!empty($item[self::ROLE_HEADING])) {
     1737            $article['author'] = array(
     1738                '@type' => 'Person',
     1739                'name'  => $item[self::ROLE_HEADING]
     1740            );
     1741        }
     1742
     1743        $schema[] = $article;
     1744    }
     1745
     1746    return $schema;
     1747}
     1748
     1749/**
    16981750 * Book
    16991751 */
  • unlimited-elements-for-elementor/trunk/inc_php/unitecreator_settings.class.php

    r3429507 r3470240  
    162162     */
    163163    public function getArrUCSettingTypes(){
    164 
     164   
    165165        $arrTypes = array(
    166166            "uc_textfield",
     
    173173            "uc_colorpicker",
    174174            "uc_image",
     175            UniteCreatorDialogParam::PARAM_FILE,
    175176            "uc_mp3",
    176177            "uc_icon",
  • unlimited-elements-for-elementor/trunk/includes.php

    r3444776 r3470240  
    1313
    1414if(!defined("UNLIMITED_ELEMENTS_VERSION"))
    15     define("UNLIMITED_ELEMENTS_VERSION", "2.0.5");
     15    define("UNLIMITED_ELEMENTS_VERSION", "2.0.6");
    1616
    1717//disable elementor support for debugging purposes. keep it commented
    1818//define("UE_DISABLE_ELEMENTOR_SUPPORT", true);
    19 
    2019
    2120$currentFile = __FILE__;
  • unlimited-elements-for-elementor/trunk/js/unitecreator_params_dialog.js

    r3349280 r3470240  
    401401
    402402            g_ucAdmin.validateNameField(objParam.name, "Name");
     403           
     404            if(objParam.type === "uc_file"){
     405                var hasFileTypes = (
     406                    objParam.file_type_application === true ||
     407                    objParam.file_type_image === true ||
     408                    objParam.file_type_video === true ||
     409                    objParam.file_type_svg === true
     410                );
     411               
     412                if(hasFileTypes === false)
     413                    throw new Error("Please select at least one file type");
     414            }
    403415
    404416        }catch(error){
  • unlimited-elements-for-elementor/trunk/provider/assets/provider_admin.js

    r3429507 r3470240  
    2626            isMultiple = false;
    2727
     28        var mediaTypes = type;
     29        if(typeof mediaTypes === "string" && mediaTypes.indexOf(",") !== -1)
     30            mediaTypes = mediaTypes.split(",");
     31
     32        var hasSvg = false;
     33        if(Array.isArray(mediaTypes)){
     34            mediaTypes = mediaTypes.map(function(item){
     35                item = jQuery.trim(item);
     36                if(item === "svg"){
     37                    hasSvg = true;
     38                    return "image/svg+xml";
     39                }
     40                return item;
     41            }).filter(function(item){
     42                return item !== "";
     43            });
     44        }else if(mediaTypes === "svg"){
     45            hasSvg = true;
     46            mediaTypes = "image/svg+xml";
     47        }
     48
    2849        // Media Library params
    2950        let options = {
     
    3253            title : title,
    3354            multiple : isMultiple,
    34             library : { type : ( type == 'svg' ? 'image/svg+xml' : type ) },
     55            library : { type : mediaTypes },
    3556            button : { text : 'Insert' }
    3657        }
     
    3960
    4061        // if SVG only
    41         if (type == 'svg') {
     62        if (hasSvg === true) {
    4263            frame.on('open', function() {
    4364                setTimeout(() => {
  • unlimited-elements-for-elementor/trunk/provider/core/unlimited_elements/elementor/elementor_widget.class.php

    r3397365 r3470240  
    397397                if(GlobalsUnlimitedElements::$isImporting == true)
    398398                    $value = "";
     399
     400                if(is_numeric($value))
     401                    $value = array("id"=>$value);
     402                else
     403                    $value = array("url"=>$value);
     404            break;
     405            case UniteCreatorDialogParam::PARAM_FILE:
    399406
    400407                if(is_numeric($value))
     
    560567        $itemsHeading = trim($itemsHeading);
    561568
     569        $allowEmpty = $this->objAddon->getOption("items_allow_empty");                             
     570        $allowEmpty = UniteFunctionsUC::strToBool($allowEmpty);
     571       
    562572        $titleField = $this->objAddon->getOption("items_title_field");
    563573        $titleField = trim($titleField);
     
    712722         $arrItemsControl["type"] = Controls_Manager::REPEATER;
    713723         $arrItemsControl["fields"] = $repeater->get_controls();
    714 
     724         
     725        //allow empty items
     726        if($allowEmpty == true)
     727            $arrItemsControl["prevent_empty"] = false;
     728       
     729         
    715730         if(!empty($titleField))
    716731            $arrItemsControl["title_field"] = $titleField;
     
    9891004                $controlType = Controls_Manager::MEDIA;
    9901005            break;
     1006            case UniteCreatorDialogParam::PARAM_FILE:
     1007                $controlType = Controls_Manager::MEDIA;
     1008            break;
    9911009            case UniteCreatorDialogParam::PARAM_HR:
    9921010                //$controlType = "uc_hr";
     
    11231141                    $arrControl['default'] = $defaultValue;
    11241142                }
     1143
     1144            break;
     1145            case UniteCreatorDialogParam::PARAM_FILE:
     1146
     1147                $fileTypes = array();
     1148                if(UniteFunctionsUC::strToBool(UniteFunctionsUC::getVal($param, "file_type_application")) === true)
     1149                    $fileTypes[] = "application";
     1150                if(UniteFunctionsUC::strToBool(UniteFunctionsUC::getVal($param, "file_type_image")) === true)
     1151                    $fileTypes[] = "image";
     1152                if(UniteFunctionsUC::strToBool(UniteFunctionsUC::getVal($param, "file_type_video")) === true)
     1153                    $fileTypes[] = "video";
     1154                if(UniteFunctionsUC::strToBool(UniteFunctionsUC::getVal($param, "file_type_svg")) === true)
     1155                    $fileTypes[] = "svg";
     1156
     1157                if(empty($fileTypes))
     1158                    $fileTypes = array("application", "image", "video", "svg");
     1159
     1160                $mediaTypes = array();
     1161                $mimeTypes = array();
     1162                foreach($fileTypes as $type){
     1163                    if($type === "svg"){
     1164                        $mediaTypes[] = "image";
     1165                        $mimeTypes[] = "image/svg+xml";
     1166                    }else{
     1167                        $mediaTypes[] = $type;
     1168                    }
     1169                }
     1170
     1171                $mediaTypes = array_values(array_unique($mediaTypes));
     1172                if(count($mediaTypes) == 1)
     1173                    $arrControl["media_type"] = $mediaTypes[0];
     1174                else
     1175                    $arrControl["media_type"] = $mediaTypes;
     1176
     1177                if(!empty($mimeTypes))
     1178                    $arrControl["mime_types"] = array_values(array_unique($mimeTypes));
    11251179
    11261180            break;
     
    17821836
    17831837                $arrControl["default"] = $arrItemValues;
    1784 
     1838       
    17851839                $arrControl["prevent_empty"] = false;
    1786 
     1840               
    17871841            break;
    17881842        }
  • unlimited-elements-for-elementor/trunk/provider/core/unlimited_elements/helper_provider_core.class.php

    r3379552 r3470240  
    2222    private static $isInfiniteLoopCode = false;
    2323    private static $arrAddedStyles = array();
     24    private static $isUploadMimeFiltersRegistered = false;
    2425   
    2526    private static $currentDocument = null;
     
    16181619        return(true);
    16191620    }
     1621
     1622    /**
     1623     * register upload mime filters based on settings
     1624     */
     1625    public static function registerUploadMimeFilters(){
     1626       
     1627        if(self::$isUploadMimeFiltersRegistered === true)
     1628            return;
     1629       
     1630        self::$isUploadMimeFiltersRegistered = true;
     1631       
     1632        $allowedMimes = self::getAllowedUploadMimes();
     1633        if(empty($allowedMimes))
     1634            return;
     1635       
     1636        add_filter("upload_mimes", function($mimes) use ($allowedMimes){
     1637            return array_merge($mimes, $allowedMimes);
     1638        });
     1639       
     1640        add_filter("wp_check_filetype_and_ext", function($data, $file, $filename, $mimes) use ($allowedMimes){
     1641           
     1642            $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
     1643           
     1644            if(isset($allowedMimes[$extension])){
     1645                $data["ext"] = $extension;
     1646                $data["type"] = $allowedMimes[$extension];
     1647            }
     1648           
     1649            return $data;
     1650        }, 10, 4);
     1651    }
     1652   
     1653    /**
     1654     * get allowed upload mime types from general settings
     1655     */
     1656    private static function getAllowedUploadMimes(){
     1657       
     1658        $allowedMimes = array();
     1659       
     1660        $allowDocuments = self::getGeneralSetting("allow_upload_documents");
     1661        $allowDocuments = UniteFunctionsUC::strToBool($allowDocuments);
     1662       
     1663        $allowZip = self::getGeneralSetting("allow_upload_zip");
     1664        $allowZip = UniteFunctionsUC::strToBool($allowZip);
     1665       
     1666        $allowSvg = self::getGeneralSetting("allow_upload_svg");
     1667        $allowSvg = UniteFunctionsUC::strToBool($allowSvg);
     1668       
     1669        if($allowDocuments === true){
     1670            $allowedMimes = array_merge($allowedMimes, array(
     1671                "pdf" => "application/pdf",
     1672                "doc" => "application/msword",
     1673                "docx" => "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
     1674                "ppt" => "application/vnd.ms-powerpoint",
     1675                "pptx" => "application/vnd.openxmlformats-officedocument.presentationml.presentation",
     1676                "xls" => "application/vnd.ms-excel",
     1677                "xlsx" => "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
     1678                "rtf" => "application/rtf",
     1679                "odt" => "application/vnd.oasis.opendocument.text",
     1680                "ods" => "application/vnd.oasis.opendocument.spreadsheet",
     1681                "odp" => "application/vnd.oasis.opendocument.presentation",
     1682            ));
     1683        }
     1684       
     1685        if($allowZip === true)
     1686            $allowedMimes["zip"] = "application/zip";
     1687       
     1688        if($allowSvg === true)
     1689            $allowedMimes["svg"] = "image/svg+xml";
     1690       
     1691        return $allowedMimes;
     1692    }
    16201693   
    16211694   
     
    16371710               
    16381711        self::$filepathGeneralSettings = self::$pathCore."settings/general_settings_el.xml";
     1712
     1713        self::registerUploadMimeFilters();
    16391714       
    16401715        do_action("ue_after_global_init");
  • unlimited-elements-for-elementor/trunk/provider/core/unlimited_elements/provider_core_admin.class.php

    r3432094 r3470240  
    178178    }
    179179
     180
    180181}
  • unlimited-elements-for-elementor/trunk/provider/core/unlimited_elements/provider_core_front.class.php

    r3251080 r3470240  
    3434                       
    3535    }
    36    
    37    
     36
    3837}
  • unlimited-elements-for-elementor/trunk/provider/core/unlimited_elements/settings/general_settings_el.xml

    r3432094 r3470240  
    121121           description="Edit Pro Settings for the Widgets">
    122122    </field>
     123
     124    <field name="allow_upload_file_types"
     125      type="statictext"
     126      label="Allow Upload File Types">
     127    </field>
     128   
     129    <field name="allow_upload_documents"
     130      type="checkbox"
     131      default="false"
     132      addfield="allow_upload_zip,allow_upload_svg"
     133      label="unite_setting_notext"
     134      text_near="Documents (pdf, doc, docx, ppt etc...) ">
     135    </field>
     136
     137    <field name="allow_upload_zip"
     138      type="checkbox"
     139      default="false"
     140      label="unite_setting_notext"
     141      text_near="Zip ">
     142    </field>
     143
     144    <field name="allow_upload_svg"
     145      type="checkbox"
     146      default="false"
     147      label="unite_setting_notext"
     148      text_near="SVG">
     149    </field>
    123150   
    124151  </fieldset>
  • unlimited-elements-for-elementor/trunk/provider/functions_wordpress.class.php

    r3442278 r3470240  
    39353935            return (self::$cacheAuthorsShort);
    39363936        }
    3937 
    3938         $args = array("role__not_in" => array("subscriber", "customer"));
    3939 
     3937       
     3938        $args = array(
     3939            "role__in" => array("administrator", "editor", "author"),
     3940            "number"   => 200
     3941        );
    39403942        $arrUsers = get_users($args);
    39413943
     
    49134915       
    49144916        add_action('wp_print_scripts', array('UniteFunctionsWPUC', 'onStylesAndScriptsDeregister'), PHP_INT_MAX);
     4917
     4918        add_action('wp_after_insert_post', function ($post_id, $post, $update) { GlobalsUC::$hideDebug = true; }, 10, 3);
    49154919       
    49164920    }
  • unlimited-elements-for-elementor/trunk/provider/integrations.class.php

    r3397365 r3470240  
    1616
    1717    private $defaultLang;
     18
     19    /** WPP orderby filter: post IDs order (static for filter callback) */
     20    private static $wppOrderByIDs = array();
     21    /** WPP orderby filter: ASC/DESC */
     22    private static $wppOrderByDirection = "DESC";
    1823   
    1924    private function ___________JET_ENGINE_________(){}
     
    5863       
    5964        return($numViews);
     65    }
     66   
     67    /**
     68     * get wpp range select
     69     */
     70    public static function WPP_getRangeSelect(){
     71       
     72        $arrItems = array(
     73            "last30days" => "Last 30 Days",
     74            "last7days" => "Last 7 Days",
     75            "last24hours" => "Last 24 Hours",
     76            "daily" => "Daily",
     77            "weekly" => "Weekly",
     78            "monthly" => "Monthly",
     79            "all" => "All",
     80        );
     81       
     82        return($arrItems);
    6083    }
    6184   
     
    147170       
    148171        return($output);
    149        
    150        
    151         // Return cached results
    152         /*
    153         if ( $this->config['tools']['cache']['active'] ) {
    154             $key = 'wpp_' . md5(json_encode($params));
    155             $query = \WordPressPopularPosts\Cache::get($key);
    156 
    157             if ( false === $query ) {
    158                 $query = new Query($params);
    159 
    160                 $time_value = $this->config['tools']['cache']['interval']['value'];
    161                 $time_unit = $this->config['tools']['cache']['interval']['time'];
    162 
    163                 // No popular posts found, check again in 1 minute
    164                 if ( ! $query->get_posts() ) {
    165                     $time_value = 1;
    166                     $time_unit = 'minute';
    167                 }
    168 
    169                 \WordPressPopularPosts\Cache::set(
    170                     $key,
    171                     $query,
    172                     $time_value,
    173                     $time_unit
    174                 );
    175             }
    176         } // Get real-time popular posts
    177        
    178         */
    179        
    180         return $query;
     172    }
     173
     174    /**
     175     * get popular post IDs for orderby (e.g. from sort filter) from query args
     176     * queryArgs - WP_Query-style args (post_type, posts_per_page)
     177     * range - WPP range key, default last30days
     178     * @return array post IDs or empty array
     179     */
     180    public static function WPP_getPopularPostIdsForOrderBy($queryArgs, $range = "last30days"){
     181        if(self::isWPPopularPostsExists() == false)
     182            return array();
     183        $postType = UniteFunctionsUC::getVal($queryArgs, "post_type", "post");
     184        $limit = UniteFunctionsUC::getVal($queryArgs, "posts_per_page", 999);
     185        if(empty($limit) || $limit < 1)
     186            $limit = 999;
     187        $obj = new self();
     188        $wpp_args = array(
     189            "post_type" => $postType,
     190            "limit" => $limit,
     191            "range" => $range
     192        );
     193        $response = $obj->WPP_getPopularPosts($wpp_args, false);
     194        $ids = UniteFunctionsUC::getVal($response, "post_ids");
     195        return is_array($ids) ? $ids : array();
     196    }
     197
     198    /**
     199     * WordPress filter: order by WPP popularity (uses static IDs/direction)
     200     */
     201    public static function filterPostsOrderbyWpp($orderby, $query){
     202        if(is_object($query) && method_exists($query, "get")){
     203            $isActive = $query->get("ue_wpp_orderby");
     204            if(empty($isActive))
     205                return $orderby;
     206        }
     207        if(empty(self::$wppOrderByIDs))
     208            return $orderby;
     209        $arrIDs = array_map("intval", self::$wppOrderByIDs);
     210        $arrIDs = array_filter($arrIDs);
     211        $arrIDs = array_unique($arrIDs);
     212        if(empty($arrIDs))
     213            return $orderby;
     214        global $wpdb;
     215        $orderDir = (self::$wppOrderByDirection == "ASC") ? "ASC" : "DESC";
     216        $orderDirField = ($orderDir == "ASC") ? "DESC" : "ASC";
     217        $field = "FIELD({$wpdb->posts}.ID," . implode(",", $arrIDs) . ")";
     218        $orderby = "({$field} = 0) ASC, {$field} {$orderDirField}, {$wpdb->posts}.post_date {$orderDir}";
     219        return $orderby;
     220    }
     221
     222    /**
     223     * apply WPP orderby filter for the next WP_Query run
     224     */
     225    public static function WPP_applyOrderByFilter($arrIDs, $orderDir = "DESC"){
     226        self::$wppOrderByIDs = is_array($arrIDs) ? $arrIDs : array();
     227        self::$wppOrderByDirection = ($orderDir == "ASC") ? "ASC" : "DESC";
     228        add_filter("posts_orderby", array(__CLASS__, "filterPostsOrderbyWpp"), 10, 2);
     229    }
     230
     231    /**
     232     * remove WPP orderby filter after query
     233     */
     234    public static function WPP_removeOrderByFilter(){
     235        remove_filter("posts_orderby", array(__CLASS__, "filterPostsOrderbyWpp"), 10);
     236        self::$wppOrderByIDs = array();
    181237    }
    182238
  • unlimited-elements-for-elementor/trunk/provider/provider_params_processor.class.php

    r3444776 r3470240  
    2424    private $lastName = null;
    2525
    26    
     26
    2727    /**
    2828     * add other image thumbs based of the platform
     
    330330       
    331331    }
    332 
    333 
    334 
     332   
    335333
    336334
     
    13851383        if(self::SHOW_DEBUG_QUERY == true)
    13861384            $showDebugQuery = true;
     1385       
     1386        if(GlobalsUC::$hideDebug)
     1387            $showDebugQuery = false;
    13871388       
    13881389        //show debug by url only for admins
     
    17961797       
    17971798        $orderBy = UniteFunctionsUC::getVal($filters, "orderby");
     1799        $isWppOrderBy = ($orderBy == "popular_wpp");
     1800       
     1801        if($isWppOrderBy === true){
     1802            unset($filters["orderby"]);
     1803            $orderBy = null;
     1804        }
    17981805       
    17991806       
     
    21312138                break;
    21322139                case "most_viewed":
    2133 
     2140                   
    21342141                    $isWPPPluginExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
    21352142
     
    22062213                break;
    22072214            }
    2208 
     2215               
     2216        }
     2217       
     2218        //order the posts by most viewed using the wpp plugin
     2219       
     2220        if($isWppOrderBy === true){
     2221           
     2222            $isWPPPluginExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
     2223           
     2224            if($showDebugQuery == true && $isWPPPluginExists == false){
     2225                dmp("Order by popular posts is possible only if you install 'WordPress Popular Posts' plugin. Please install it");
     2226            }
     2227           
     2228            if($isWPPPluginExists){
     2229               
     2230                $objIntegrations = new UniteCreatorPluginIntegrations();
     2231               
     2232                $wppRange = UniteFunctionsUC::getVal($value, "{$name}_orderby_wpp_range", "last30days");
     2233               
     2234                $wpp_args = array(
     2235                    "post_type"=>$postType,
     2236                    "limit"=>$limit,
     2237                    "range"=>$wppRange
     2238                );
     2239               
     2240                if(!empty($category))
     2241                    $wpp_args["cat"] = $category;
     2242               
     2243                $response = $objIntegrations->WPP_getPopularPosts($wpp_args, $showDebugQuery);
     2244               
     2245                $arrIDsPopular = UniteFunctionsUC::getVal($response, "post_ids");
     2246               
     2247                $debugWPP = UniteFunctionsUC::getVal($response, "debug");
     2248               
     2249                if($showDebugQuery == true && !empty($debugWPP)){
     2250                    dmp("Popular Posts Order Data: ");
     2251                    dmp($debugWPP);
     2252                }
     2253            }
    22092254        }
    22102255       
     
    22202265        }
    22212266
    2222         if(!empty($arrIDsPopular)){
     2267        if(!empty($arrIDsPopular) && $isWppOrderBy === false){
    22232268            $makePostINOrder = true;
    22242269            $arrPostInIDs = $arrIDsPopular;
     
    22602305            $orderDir = UniteFunctionsUC::getVal($args, "order");
    22612306            if($orderDir == "ASC")
    2262                 $arrIDsPopular = array_reverse($arrIDsPopular);
     2307                $arrPostInIDs = array_reverse($arrPostInIDs);
    22632308
    22642309            unset($args["order"]);
     
    24342479               
    24352480        $args = $this->getPostListData_getCustomQueryFilters($args, $value, $name, $data);
     2481
     2482        // WPP orderby: from widget or from sort filter (URL) - handled via integrations class
     2483        $isWppFromFilter = (isset($args["orderby"]) && $args["orderby"] == "popular_wpp" && UniteCreatorPluginIntegrations::isWPPopularPostsExists());
     2484        if($isWppOrderBy === true || $isWppFromFilter){
     2485            $isWppOrderBy = true; // ensure post-query cleanup runs
     2486            if(empty($arrIDsPopular) && $isWppFromFilter){
     2487                $arrIDsPopular = UniteCreatorPluginIntegrations::WPP_getPopularPostIdsForOrderBy($args, "last30days");
     2488            }
     2489            if(!empty($arrIDsPopular)){
     2490                $orderDir = UniteFunctionsUC::getVal($args, "order", "DESC");
     2491                UniteCreatorPluginIntegrations::WPP_applyOrderByFilter($arrIDsPopular, $orderDir);
     2492                $args["ue_wpp_orderby"] = "true";
     2493                unset($args["orderby"]);
     2494            }
     2495        }
    24362496       
    24372497        HelperUC::addDebug("Posts Query", $args);
     
    25222582               
    25232583            $wasSkipRun = true;
     2584        }
     2585       
     2586        if($isWppOrderBy === true){
     2587            UniteCreatorPluginIntegrations::WPP_removeOrderByFilter();
    25242588        }
    25252589
     
    29342998
    29352999            $argsForDebug = UniteFunctionsWPUC::cleanQueryArgsForDebug($currentQueryVars);
     3000            if(GlobalsUC::$showQueryDebugTermsByUrl == true)
     3001                $argsForDebug = UniteFunctionsWPUC::expandTaxQueryTermsForDebug($argsForDebug);
    29363002            dmp($argsForDebug);
    29373003
     
    29953061            $originalQueryVars = $query->query_vars;
    29963062            $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
     3063            if(GlobalsUC::$showQueryDebugTermsByUrl == true)
     3064                $originalQueryVars = UniteFunctionsWPUC::expandTaxQueryTermsForDebug($originalQueryVars);
    29973065           
    29983066            dmp("The Query Request Is:");
     
    33963464
    33973465        $numPosts = count($arrPosts);
     3466        $showPostListDebug = HelperUC::hasPermissionsFromQuery("ucpostlistdebug");
    33983467
    33993468        if($useForListing == true){
     
    34073476
    34083477            $data[$nameListing."_items"] = $arrPosts;
     3478
     3479            //post list debug for listing/loop grid (same as non-listing path)
     3480            if($showPostListDebug == true)
     3481                HelperProviderUC::showPostsDebug($arrPosts, true);
     3482            GlobalsProviderUC::$showPostsQueryDebug = false;
    34093483
    34103484            return($data);
     
    34533527            HelperProviderUC::printDebugQueries(true);
    34543528        }
    3455        
    3456         $showPostListDebug = HelperUC::hasPermissionsFromQuery("ucpostlistdebug");
    34573529       
    34583530        if($showPostListDebug == true)
     
    35523624        return($title);
    35533625    }   
     3626
     3627    /**
     3628     * ensure gallery item has title
     3629     */
     3630    private function ensureTitle($title, $data, $name, $post, $urlImage, $index){
     3631       
     3632        if(!empty($title))
     3633            return($title);
     3634       
     3635        if(!empty($post) && !empty($post->post_title))
     3636            $title = $post->post_title;
     3637
     3638        if(empty($title))
     3639            $title = UniteFunctionsUC::getVal($data, $name."_title");
     3640
     3641        if(empty($title))
     3642            $title = UniteFunctionsUC::getVal($data, $name."_caption");
     3643
     3644        if(empty($title))
     3645            $title = UniteFunctionsUC::getVal($data, $name."_alt");
     3646
     3647        if(empty($title) && !empty($urlImage)){
     3648            $filename = basename(parse_url($urlImage, PHP_URL_PATH));
     3649            $filename = preg_replace('/\.[^.]+$/', '', $filename);
     3650            if(!empty($filename))
     3651                $title = str_replace(array("-", "_"), " ", $filename);
     3652        }
     3653
     3654        if(empty($title))
     3655            $title = !empty($index) ? "Image {$index}" : "Image";
     3656       
     3657        return($title);
     3658    }
    35543659       
    35553660
     
    39284033           
    39294034        }
     4035
     4036        if($titleSource == "item_title")
     4037            $title = $this->ensureTitle($title, $data, $name, $post, $urlImage, $index);
    39304038
    39314039        $item["title"] = $title;
     
    47324840                    $metaKey = UniteFunctionsUC::getVal($value, $name."_orderby_meta_key");
    47334841                    $metaKey = trim($metaKey);
    4734 
     4842   
    47354843                    if(empty($metaKey))
    47364844                        $orderBy = null;
     
    51625270        $arrTermsObjects = $term_query->query( $args );
    51635271
    5164 
    5165 
    5166 
     5272       
     5273        //term query debug
     5274
     5275        if($showDebug == true && $queryDebugType == "show_query"){
     5276
     5277            $originalQueryVars = $term_query->query_vars;
     5278            $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
     5279            if(GlobalsUC::$showQueryDebugTermsByUrl == true)
     5280                $originalQueryVars = UniteFunctionsWPUC::expandTaxQueryTermsForDebug($originalQueryVars);
     5281
     5282            dmp("The Query Request Is:");
     5283            dmp($term_query->request);
     5284
     5285            dmp("The finals query vars:");
     5286            dmp($originalQueryVars);
     5287
     5288
     5289            $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_args");
     5290
     5291            dmp("Query modify callbacks ( get_terms_args ):");
     5292            dmp($arrActions);
     5293
     5294            $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_orderby");
     5295
     5296            dmp("Query modify callbacks ( get_terms_orderby ):");
     5297            dmp($arrActions);
     5298
     5299        }
     5300
     5301        /*
    51675302        if($showDebug == true){
    51685303            dmp("terms found: ".count($arrTermsObjects));
    5169         }
    5170 
    5171         //term query debug
    5172 
    5173         if($showDebug == true && $queryDebugType == "show_query"){
    5174 
    5175             $originalQueryVars = $term_query->query_vars;
    5176             $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
    5177 
    5178             dmp("The Query Request Is:");
    5179             dmp($term_query->request);
    5180 
    5181             dmp("The finals query vars:");
    5182             dmp($originalQueryVars);
    5183 
    5184 
    5185             $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_args");
    5186 
    5187             dmp("Query modify callbacks ( get_terms_args ):");
    5188             dmp($arrActions);
    5189 
    5190             $arrActions = UniteFunctionsWPUC::getFilterCallbacks("get_terms_orderby");
    5191 
    5192             dmp("Query modify callbacks ( get_terms_orderby ):");
    5193             dmp($arrActions);
    5194 
    5195         }
    5196 
     5304            dmp("The terms (WP_Term objects):");
     5305            dmp($arrTermsObjects);
     5306        }
     5307        */
     5308       
     5309       
    51975310        if(!empty($arrExcludeSlugs)){
    51985311            HelperUC::addDebug("Terms Before Filter:", $arrTermsObjects);
     
    54895602            $originalQueryVars = $user_query->query_vars;
    54905603            $originalQueryVars = UniteFunctionsWPUC::cleanQueryArgsForDebug($originalQueryVars);
     5604            if(GlobalsUC::$showQueryDebugTermsByUrl == true)
     5605                $originalQueryVars = UniteFunctionsWPUC::expandTaxQueryTermsForDebug($originalQueryVars);
    54915606
    54925607            dmp("The Query Request Is:");
  • unlimited-elements-for-elementor/trunk/provider/provider_params_processor_multisource.class.php

    r3444776 r3470240  
    302302     */
    303303    private function getData_gallery(){
    304 
     304       
    305305        $arrImages = UniteFunctionsUC::getVal($this->arrValues, $this->name."_gallery");
    306306
     
    341341                $description = "Demo Image Description $counter";
    342342
    343                 $arrImage["image_imageid"] = $url;
     343                $arrImage["image_imageid"] = 0;
     344                $arrImage["image"] = $url;
    344345                $arrImage["image_title"] = $title;
    345346                $arrImage["image_alt"] = $alt;
     
    997998     */
    998999    private function showDebug_input($source, $arrData){
     1000
     1001    /*
     1002        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
     1003
     1004        foreach ($trace as $i => $t) {
     1005            $func = ($t['class'] ?? '') . ($t['type'] ?? '') . ($t['function'] ?? 'global');
     1006            $file = $t['file'] ?? '';
     1007            $line = $t['line'] ?? '';
     1008
     1009            echo "#$i $func ($file:$line)<br>\n";
     1010        }
     1011    */
    9991012       
    10001013        if($this->showDataType == "output")
     
    10061019        HelperHtmlUC::putHtmlDataDebugBox_start();
    10071020       
    1008             if($source == self::SOURCE_DEMO){
    1009                 dmp("Switching to demo data source in editor only.");
    1010             }
    1011    
    1012             $numItems = 0;
    1013    
    1014             if(is_array($arrData))
    1015                 $numItems = count($arrData);
    1016            
    1017             dmp("Input data from: <b>$source</b>, found: $numItems");
    1018            
    1019             $arrData = UniteFunctionsUC::modifyDataArrayForShow($arrData);
    1020            
    1021             dmp($arrData);
     1021        if($source == self::SOURCE_DEMO){
     1022            dmp("Switching to demo data source in editor only.");
     1023        }
     1024
     1025        $numItems = 0;
     1026
     1027        if(is_array($arrData))
     1028            $numItems = count($arrData);
     1029       
     1030        dmp("Input data from: <b>$source</b>, found: $numItems");
     1031       
     1032        $arrData = UniteFunctionsUC::modifyDataArrayForShow($arrData);
     1033       
     1034        dmp($arrData);
    10221035       
    10231036        HelperHtmlUC::putHtmlDataDebugBox_end();
     
    10631076        if(empty($arrFields) === true && GlobalsProviderUC::$isUnderAjax === false)
    10641077            UniteFunctionsUC::throwError("multisource getItems error: $itemsSource fields not found");
    1065 
     1078       
    10661079        //get items params
    10671080        $arrItemParams = $this->arrParamsItems;
     
    11731186            $arrItems[] = array("item" => $item);
    11741187        }
    1175 
     1188   
     1189               
    11761190        return ($arrItems);
    11771191    }
     
    12941308
    12951309        $arrData = $this->getData($itemsSource);
    1296        
    1297         $this->showDebug_input($itemsSource, $arrData);
     1310       
     1311        if(GlobalsUC::$hideDebug !== true) {
     1312            $this->showDebug_input($itemsSource, $arrData);
     1313        }
    12981314
    12991315        //set empty demo output
     
    13051321            $itemsSource = self::SOURCE_DEMO;
    13061322
    1307             $this->showDebug_input($itemsSource, $arrData);
    1308         }
    1309 
     1323            if(GlobalsUC::$hideDebug !== true) {
     1324                $this->showDebug_input($itemsSource, $arrData);
     1325            }
     1326        }
     1327               
    13101328        $arrItems = $this->getItems($itemsSource, $arrData);
    13111329               
    13121330        $data[$name] = $arrItems;
    1313 
     1331       
    13141332        if($this->showDebugData === true)
    13151333            $this->showDebug_output($arrItems);
  • unlimited-elements-for-elementor/trunk/provider/provider_settings.class.php

    r3444776 r3470240  
    20712071        // --------- most viewed range -------------
    20722072        if($isWPPExists === true){
    2073             $arrItems = array_flip(array(
    2074                 "last30days" => "Last 30 Days",
    2075                 "last7days" => "Last 7 Days",
    2076                 "last24hours" => "Last 24 Hours",
    2077                 "daily" => "Daily",
    2078                 "weekly" => "Weekly",
    2079                 "monthly" => "Monthly",
    2080                 "all" => "All",
    2081             ));
     2073            $arrItems = UniteCreatorPluginIntegrations::WPP_getRangeSelect();
     2074            $arrItems = array_flip($arrItems);
    20822075
    20832076            $params = array();
     
    24072400        //----- orderby --------
    24082401        $arrOrder = UniteFunctionsWPUC::getArrSortBy($isForWooProducts);
     2402       
     2403        $isWPPExists = UniteCreatorPluginIntegrations::isWPPopularPostsExists();
     2404        if($isWPPExists === true)
     2405            $arrOrder["popular_wpp"] = __("Popular Posts", "unlimited-elements-for-elementor");
     2406
    24092407        $arrOrder = array_flip($arrOrder);
    24102408
     
    24212419
    24222420        $this->addSelect($name . "_orderby", $arrOrder, __("Order By", "unlimited-elements-for-elementor"), $orderBY, $params);
     2421
     2422        //--- WPP orderby range ---
     2423        if($isWPPExists === true){
     2424            $arrConditionWppOrder = array();
     2425            $arrConditionWppOrder[$name . "_orderby"] = "popular_wpp";
     2426           
     2427            $arrItems = UniteCreatorPluginIntegrations::WPP_getRangeSelect();
     2428            $arrItems = array_flip($arrItems);
     2429           
     2430            $params = array();
     2431            $params["origtype"] = UniteCreatorDialogParam::PARAM_DROPDOWN;
     2432            $params["elementor_condition"] = $arrConditionWppOrder;
     2433           
     2434            $this->addSelect($name . "_orderby_wpp_range", $arrItems, __("&nbsp;&nbsp;Popular Posts Time Range", "unlimited-elements-for-elementor"), "last30days", $params);
     2435        }
    24232436
    24242437        //--- meta value param -------
  • unlimited-elements-for-elementor/trunk/provider/woocommerce_integrate.class.php

    r3429507 r3470240  
    16271627            $quantity = $cart_item['quantity'];
    16281628           
    1629             $priceHtml = wc_price( $cart_item['line_subtotal']+$cart_item['line_subtotal_tax'] );
    1630 
     1629            $lineTotal = $cart_item['line_total'] + $cart_item['line_tax']; // cart-adjusted
     1630            $unitTotal = $quantity > 0 ? $lineTotal / $quantity : 0;
     1631            $priceHtml  = wc_price( $unitTotal );
     1632           
     1633           
    16311634            $imageHTML = "";
    16321635           
     
    16821685        if(empty(WC()->cart)){
    16831686            $subtotal = 0;
     1687            $subtotalWithTax = 0;
    16841688        }else{
    16851689           
     
    16951699        $subtotalHTML = wc_price($subtotalWithTax);
    16961700       
     1701        $subtotalNoTax = wc_price($subtotal);
     1702       
    16971703        $strNum = "";
    16981704       
     
    17041710   
    17051711    <div class=\"uc-minicart-totals__subtotal\">{$subtotalHTML}</div>
     1712    <div class=\"uc-minicart-totals__subtotal-notax\" style='display:none'>{$subtotalNoTax}</div>
    17061713
    17071714</div>";
  • unlimited-elements-for-elementor/trunk/readme.txt

    r3444776 r3470240  
    941941== Changelog ==
    942942
    943 version 2.0.5:
     943= 2.0.6 - 2026-01-22 =
     944
     945Plugin Changes:
     946
     947* Feature: added new option: allow empty in items settings
     948* Feature: Added "File" attribute
     949* Feature: added option in general settings: "allow upload file types"
     950* Feature: added order by functionality in the most popular posts plugin
     951* Feature: added one more schema type: News Article
     952* Feature: added autocorrection option in ajax search
     953* Feature: added support for popular posts plugin for the sorting filter
     954* Fix: make sure that gallery has item title always, in product item also
     955* Fix: fixed some logical bug with the filters
     956* Fix: fixed mini cart pricing issue
     957* Fix: fixed some small form related vulnurability
     958* Fix: fixed the authors fetch, to get only author roles and not all roles with exclude
     959* Fix: fixed some breadcrumbs issues
     960
     961
     962Widgets Changes:
     963
     964* Feature: Post Carousel Lite (Free) - Performed a comprehensive review of widget options and enabled responsive controls (Desktop, Tablet, and Mobile) for all applicable settings to ensure better layout flexibility across devices
     965* Feature: Off Canvas Filters (Pro) - A new feature has been added allowing the Simple Popup widget to be included within the Offcanvas Filters widget. It now functions seamlessly alongside other filter widgets, providing more flexible layout options.
     966* Feature: Simple Popup (Free) - A new feature has been added allowing the Simple Popup widget to be included within the Offcanvas Filters widget. It now functions seamlessly alongside other filter widgets, providing more flexible layout options.
     967* Feature: Conditions (Free) - A new Is Logged In User trigger type has been added, allowing you to set up conditional actions or visibility rules based on whether a user is currently authenticated or browsing as a guest.
     968* Feature: Woo Mini Cart (Free) - A new Show Subtotal Type option has been added, allowing users to choose whether to display prices inclusive of tax or exclusive of tax.
     969* Feature: Post Carousel Lite (Free) - A new Link Entire Item Type option has been added, allowing users to choose specific link sources such as a Dynamic Post Popup, a Link from a Custom Field, and other dynamic destinations for the item-wide click action.
     970* Feature: Active Filters (Pro) - A new Flex Wrap option has been added, giving users the ability to control whether elements within a container should wrap onto multiple lines or stay on a single row.
     971* Feature: Post Grid (Free) - A new Order option has been added for each Additional Data element.
     972* Feature: Post Magazine Grid (Pro) - A new Order option has been added for each Additional Data element
     973* Feature: Post Carousel (Free) - A new Order option has been added for each Additional Data element
     974* Feature: Video on Hover (Free) - A new Show Controls option has been added, giving users the ability to display or hide native video player controls
     975* Feature: Post Magazine Grid (Pro) - A new Show Post Views option has been added, allowing users to display the total view count for individual posts within the widget.
     976* Feature: Post Carousel (Free) - A new Show Post Views option has been added, allowing users to display the total view count for individual posts within the widget.
     977* Feature: Video on Hover (Free) - new Play on Click value has been added to the Video Play Mode option, allowing videos to remain static until a user specifically interacts with them with a click event.
     978* Feature: Text Field (Free) - A new Hidden option has been implemented that allows a field to be visually concealed while ensuring that Form Entries still receive and record data from it
     979* Feature: AJAX Search (Free) - Added Autocorrection option that allows to display a suggestion with a clickable link when the initial search returns no results due to a potential typo.
     980* Feature: Video Carousel (Free) - A new YouTube video source option has been added to allow users to directly integrate and display video content from the platform within the widget.
     981* Feature: Repeater Table (Pro) - A new feature has been enabled within the widget that allows users to remove all existing items, bypassing the typical restriction in item-based widgets that requires at least one item to remain.
     982* Change: Icon Pointer Button (Pro) - Updated the Icon Selection attribute to utilize the native Icon Library, enabling support for both standard font icons and custom SVG graphics
     983* Change: Masonry &amp; Justified Gallery (Free) - To improve clarity and avoid user confusion, the Column gallery type has been renamed to Masonry, more accurately reflecting its layout behavior.
     984* Fix: Button Icon Hover Effect (Pro) - Removed the Visibility Conditions options. These settings were previously added in error, as they are only compatible with form field logic and cannot function within standard widget layouts
     985* Fix: Background Switcher (Free) - An issue was resolved where disabling the First Selected option caused the widget to render as a blank space with no images visible. The widget now correctly initializes its display state even when no item is pre-selected.
     986* Fix: Background Switcher (Free) - An issue was resolved where the Hover Blur Effect only applied while the mouse was physically over a widget item. The effect has been corrected to persist on the active/selected item even when the mouse leaves the widget area
     987* Fix: Linear Progress Bar (Free) - An issue was resolved where browser background optimization features, such as bfcache and tab throttling, would freeze the widget's execution state. This caused the progress bar to remain stuck in a finished or desynchronized state upon page revisit or tab reactivation
     988* Fix: Post Carousel Lite (Free) - An issue was resolved where the Link Entire Item option was not functioning as expected
     989* Fix: WordPress Menu (Free) - An issue was resolved in the Elementor editor where the dropdown menu failed to display after clicking the burger icon, ensuring that navigation previews now function correctly within the editing interface.
     990* Fix: Huge Shapes Background (Pro) - An issue was resolved where the clearRect function utilized outdated or mismatched canvas dimensions, causing previous animation frames to persist and accumulate as visual &quot;ghosting&quot; or &quot;smearing&quot; artifacts.
     991* Fix: WordPress Menu (Free) - An issue was resolved in the Menu widget where the Clickable Parent Item option was incorrectly hidden when the Responsive Behavior was set to &quot;Slide.&quot; This setting now logic-gates correctly: parent items remain visible and clickable on desktop, while automatically adjusting only at the responsive breakpoint to ensure sub-menus function properly on mobile devices.
     992* Fix: Alphabet Filter (Pro) - An issue was resolved where users were required to click the Close icon twice to unselect an active filter, ensuring that filters now deactivate as expected with a single click.
     993* Fix: Post Carousel (Free) - An issue was resolved where the Author element failed to inherit the color value defined in the Meta Data Color option
     994* Fix: Conditions (Free) - An issue was resolved where ACF Field trigger types were not functioning correctly, ensuring that conditional logic or actions tied to Advanced Custom Fields now trigger as expected
     995* Fix: Post Carousel (Free) - The CSS priority of the title selector has been increased to ensure that its specific styling consistently overrides any conflicting general styles
     996* Fix: Animated Split Text (Pro) - An issue was resolved where the Splitting library was being initialized before the necessary JavaScript files had fully loaded on the page, preventing proper execution.
    944997
    945998
  • unlimited-elements-for-elementor/trunk/release_log.txt

    r3444776 r3470240  
     1
     2
     3version 2.0.6:
     4
     5* Feature: added new option: allow empty in items settings
     6* Feature: Added "File" attribute
     7* Feature: added option in general settings: "allow upload file types"
     8* Feature: added order by functionality in the most popular posts plugin
     9* Feature: added one more schema type: News Article
     10* Feature: added autocorrection option in ajax search
     11* Feature: added support for popular posts plugin for the sorting filter
     12* Fix: make sure that gallery has item title always, in product item also
     13* Fix: fixed some logical bug with the filters
     14* Fix: fixed mini cart pricing issue
     15* Fix: fixed some small form related vulnurability
     16* Fix: fixed the authors fetch, to get only author roles and not all roles with exclude
     17* Fix: fixed some breadcrumbs issues
    118
    219
  • unlimited-elements-for-elementor/trunk/unlimited_elements.php

    r3444776 r3470240  
    55* Description: Elementor all-in-one addons pack with the best widgets for Elementor, offering 100+ free widgets, templates, and tools to create stunning websites!
    66* Author: Unlimited Elements
    7 * Version: 2.0.5
     7* Version: 2.0.6
    88* Author URI: http://unlimited-elements.com
    99* Text Domain: unlimited-elements-for-elementor
  • unlimited-elements-for-elementor/trunk/views/forms-logs.php

    r3251080 r3470240  
    8181    protected function column_form($item){
    8282
    83         return $item["form"];
     83        return esc_html($item["form"]);
    8484    }
    8585
     
    9393    protected function column_message($item){
    9494
    95         return $item["message"];
     95        return esc_html($item["message"]);
    9696    }
    9797
  • unlimited-elements-for-elementor/trunk/views/objects/addon_view.class.php

    r3349280 r3470240  
    128128        $settingsItem->addControl("enable_items", "items_title_field", "show", "true");
    129129
     130        //allow empty items
     131        $settingsItem->addRadioBoolean("items_allow_empty", "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".esc_html__("Allow Empty", "unlimited-elements-for-elementor"), false);
     132        $settingsItem->addControl("enable_items", "items_allow_empty", "show", "true");
     133       
    130134
    131135        $settingsItem->setStoredValues($options);
  • unlimited-elements-for-elementor/trunk/views/objects/form_entries_view.class.php

    r3329756 r3470240  
    334334
    335335        if($status === self::STATUS_TRASH){
    336             $content = $label;
     336            $content = esc_html($label);
    337337
    338338            $actions = array(
     
    369369    protected function column_form($item){
    370370
    371         return $item["form_name"];
     371        return esc_html($item["form_name"]);
    372372    }
    373373
Note: See TracChangeset for help on using the changeset viewer.