Plugin Directory

Changeset 3183294


Ignore:
Timestamp:
11/06/2024 03:56:05 PM (13 months ago)
Author:
odude
Message:

Update to version 4.27 from GitHub

Location:
flexi
Files:
76 added
2 deleted
18 edited
1 copied

Legend:

Unmodified
Added
Removed
  • flexi/tags/4.27/README.txt

    r3175928 r3183294  
    66Requires PHP: 5.5
    77Tested up to: 6.6.2
    8 Stable tag: 4.26
     8Stable tag: 4.27
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    190190== Changelog ==
    191191
     192= 4.27 =
     193* Block editor recreated supporting latest version of wordpress.
     194
     195
    192196= 4.26 =
    193197* No features added. Only made it compatible to work with latest version of wordpress
  • flexi/tags/4.27/flexi.php

    r3175928 r3183294  
    1010 *
    1111 * @link              https://odude.com/
    12  * @since             4.26
     12 * @since             4.27
    1313 * @package           Flexi
    1414 *
     
    1717 * Plugin URI:        https://odude.com/
    1818 * Description:       User submitted images/video into gallery
    19  * Version:           4.26
     19 * Version:           4.27
    2020 * Author:            ODude
    2121 * License:           GPL-2.0+
     
    3838// The current version of the plugin
    3939if (!defined('FLEXI_VERSION')) {
    40     define('FLEXI_VERSION', '4.26');
     40    define('FLEXI_VERSION', '4.27');
    4141}
    4242define('FLEXI_FOLDER', dirname(plugin_basename(__FILE__)));
     
    4444define('FLEXI_BASE_DIR', WP_CONTENT_DIR . '/plugins/' . FLEXI_FOLDER . '/');
    4545define('FLEXI_ROOT_URL', plugin_dir_url(__FILE__));
    46 define('FLEXI_HOST', "https://odude.com/wp-json/lmfwc/v2/licenses/");
     46define('FLEXI_HOST', "https://odude.com/flexi/wp-json/lmfwc/v2/licenses/");
    4747define('FLEXI_CK', 'ck_cc93b6452693ea129f6fb4696f50275a4282840a');
    4848define('FLEXI_CS', 'cs_5bab8367ab36992b00f1fe69d866c3bbf4820dbe');
  • flexi/tags/4.27/includes/class-flexi-gallery.php

    r2743905 r3183294  
    526526?>
    527527
    528 <script>
    529 jQuery(document).ready(function() {
    530     // console.log("start");
    531     document.documentElement.style.setProperty('--flexi_padding', jQuery("#padding").text());
    532 
    533     <?php
     528            <script>
     529                jQuery(document).ready(function() {
     530                    // console.log("start");
     531                    document.documentElement.style.setProperty('--flexi_padding', jQuery("#padding").text());
     532
     533                    <?php
    534534                    $enable_conflict = flexi_get_option('conflict_disable_fancybox', 'flexi_conflict_settings', 0);
    535535                    if ('1' != $enable_conflict) {
    536536                        if ('inline' == $atts['popup']) {
    537537                    ?>
    538     jQuery('[data-fancybox-trigger').fancybox({
    539         selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
    540         thumbs: {
    541             autoStart: false
    542         },
    543         protect: false,
    544         arrows: false,
    545     });
    546     <?php
     538                            jQuery('[data-fancybox-trigger').fancybox({
     539                                selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
     540                                thumbs: {
     541                                    autoStart: false
     542                                },
     543                                protect: false,
     544                                arrows: false,
     545                            });
     546                        <?php
    547547                        } elseif ('custom' == $atts['popup']) {
    548548
    549549                        ?>
    550     jQuery('[custom-lightbox').fancybox({
    551         selector: '.flexi_show_popup_custom a:visible',
    552         thumbs: {
    553             autoStart: false
    554         },
    555         autoSize: false,
    556         protect: false,
    557         arrows: false,
    558     });
    559     <?php
     550                            jQuery('[custom-lightbox').fancybox({
     551                                selector: '.flexi_show_popup_custom a:visible',
     552                                thumbs: {
     553                                    autoStart: false
     554                                },
     555                                autoSize: false,
     556                                protect: false,
     557                                arrows: false,
     558                            });
     559                        <?php
    560560                        } elseif ('simple' == $atts['popup'] || 'simple_info' == $atts['popup']) {
    561561                        ?>
    562562
    563     var lightbox = GODude();
    564     var lightboxDescription = GODude({
    565         selector: '.godude',
    566     });
    567     <?php
     563                            var lightbox = GODude();
     564                            var lightboxDescription = GODude({
     565                                selector: '.godude',
     566                            });
     567                        <?php
    568568                        } else {
    569569                        ?>
    570     jQuery('[data-fancybox-trigger').fancybox({
    571         selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
    572         thumbs: {
    573             autoStart: true
    574         },
    575         protect: true,
    576         caption: function(instance, item) {
    577             //This is not working on ajax loading. only for for page navigation.
    578             // return jQuery(this).closest('flexi_media_holder').find('flexi_figcaption').html();
    579             return jQuery(this).find('.flexi_figcaption').html();
    580 
    581 
    582         }
    583     });
    584     <?php
     570                            jQuery('[data-fancybox-trigger').fancybox({
     571                                selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
     572                                thumbs: {
     573                                    autoStart: true
     574                                },
     575                                protect: true,
     576                                caption: function(instance, item) {
     577                                    //This is not working on ajax loading. only for for page navigation.
     578                                    // return jQuery(this).closest('flexi_media_holder').find('flexi_figcaption').html();
     579                                    return jQuery(this).find('.flexi_figcaption').html();
     580
     581
     582                                }
     583                            });
     584                    <?php
    585585                        }
    586586                    }
    587587                    ?>
    588588
    589 });
    590 </script>
    591 
    592 <?php
     589                });
     590            </script>
     591
     592        <?php
    593593            $put = ob_get_clean();
    594594            echo $put;
     
    610610
    611611        ?>
    612 <style>
    613 :root {
    614     --flexi_t_width: <?php echo esc_attr($t_width);
    615     ?>px;
    616     --flexi_t_height: <?php echo esc_attr($t_height);
    617     ?>px;
    618     --flexi_m_width: <?php echo esc_attr($m_width);
    619     ?>px;
    620     --flexi_m_height: <?php echo esc_attr($m_height);
    621     ?>px;
    622     --flexi_l_width: <?php echo esc_attr($l_width);
    623     ?>px;
    624     --flexi_l_height: <?php echo esc_attr($l_height);
    625     ?>px;
    626     --flexi_padding: <?php echo esc_attr($padding);
    627     ?>px;
    628 }
    629 </style>
    630 <?php
     612        <style>
     613            :root {
     614                --flexi_t_width: <?php echo esc_attr($t_width);
     615                                    ?>px;
     616                --flexi_t_height: <?php echo esc_attr($t_height);
     617                                    ?>px;
     618                --flexi_m_width: <?php echo esc_attr($m_width);
     619                                    ?>px;
     620                --flexi_m_height: <?php echo esc_attr($m_height);
     621                                    ?>px;
     622                --flexi_l_width: <?php echo esc_attr($l_width);
     623                                    ?>px;
     624                --flexi_l_height: <?php echo esc_attr($l_height);
     625                                    ?>px;
     626                --flexi_padding: <?php echo esc_attr($padding);
     627                                    ?>px;
     628            }
     629        </style>
     630        <?php
    631631        if (isset($_GET['flexi_layout'])) {
    632632        ?>
    633 <style>
    634 .fl-column {
    635     border-radius: .500em;
    636     border: dotted;
    637 }
    638 </style>
    639 <script>
    640 jQuery(document).ready(function() {
    641     var colors = ['red', 'blue', 'green', 'yellow', 'cyan', 'orange', 'pink', 'grey', 'white', 'black',
    642         'rosybrown', 'tan', 'plum', 'saddlebrown'
    643     ];
    644     jQuery.each(jQuery('.fl-column'), function() {
    645         var new_color = colors[Math.floor(Math.random() * colors.length)];
    646         jQuery(this).css('background-color', new_color);
    647     });
    648 });
    649 </script>
    650 <?php
     633            <style>
     634                .fl-column {
     635                    border-radius: .500em;
     636                    border: dotted;
     637                }
     638            </style>
     639            <script>
     640                jQuery(document).ready(function() {
     641                    var colors = ['red', 'blue', 'green', 'yellow', 'cyan', 'orange', 'pink', 'grey', 'white', 'black',
     642                        'rosybrown', 'tan', 'plum', 'saddlebrown'
     643                    ];
     644                    jQuery.each(jQuery('.fl-column'), function() {
     645                        var new_color = colors[Math.floor(Math.random() * colors.length)];
     646                        jQuery(this).css('background-color', new_color);
     647                    });
     648                });
     649            </script>
     650        <?php
    651651        }
    652652        ?>
  • flexi/tags/4.27/includes/class-flexi.php

    r2743905 r3183294  
    119119
    120120        //Block
    121         require_once plugin_dir_path(dirname(__FILE__)) . 'block/plugin.php';
     121        //require_once plugin_dir_path(dirname(__FILE__)) . 'block/plugin.php';
     122        require_once plugin_dir_path(dirname(__FILE__)) . 'blocks/flexi-gallery-block/flexi-gallery-block.php';
     123        require_once plugin_dir_path(dirname(__FILE__)) . 'blocks/flexi-form-block/flexi-form-block.php';
    122124
    123125        //Widgets
  • flexi/tags/4.27/includes/class-flexi_ajax_like.php

    r2675492 r3183294  
    11<?php
     2
    23/**
    34 * Like/Unlike button on gallery page
     
    8788        $toggle = flexi_evalue_toggle('like', $evalue);
    8889
    89         if (($enable == 1)) {
     90        if (($enable == 1 && $toggle == "")) {
    9091            $extra_icon = array();
    9192            $nonce = wp_create_nonce('flexi_ajax_like');
     
    130131        // flexi_log($toggle);
    131132
    132         if (($enable == 1)) {
     133        if (($enable == 1 && $toggle == "")) {
    133134            $extra_icon = array();
    134135            $nonce = wp_create_nonce('flexi_ajax_like');
  • flexi/tags/4.27/includes/class-flexi_view_count.php

    r2674031 r3183294  
    11<?php
     2
    23/**
    34 * Display view count on gallery page
     
    910 * @subpackage Flexi/includes
    1011 */
    11 class flexi_view_count {
    12     public function __construct() {
     12class flexi_view_count
     13{
     14    public function __construct()
     15    {
    1316        // add_action('flexi_module_grid', array($this, 'display_view_count'));
    1417        add_filter('flexi_settings_fields', array($this, 'add_fields'));
     
    1720    }
    1821
    19     public function display_view_count($container, $evalue = '', $id = '') {
     22    public function display_view_count($container, $evalue = '', $id = '')
     23    {
     24        //flexi_log('count page ' . $evalue . ' -- ' . $id);
    2025        $enable = flexi_get_option('evalue_count', 'flexi_image_layout_settings', 1);
    2126        $this->increase_count($id, 'flexi_view_count');
    22         // If page is detail page
     27        //If page is detail page
    2328        if ($evalue == '') {
    2429            $evalue .= 'count:on';
     
    2631
    2732        $toggle = flexi_evalue_toggle('count', $evalue);
    28         // flexi_log($toggle);
     33        //flexi_log("The value of count is: " .     $toggle . ' for evalue: ' . $evalue);
    2934
    30         if (($enable == 1)) {
     35        if ($enable == 1 && $toggle == "") {
    3136            $extra_icon = array();
    32 
    33             $div = '<div style="' . $toggle . '" class="fl-button fl-is-small">
     37            $div = '<div class="fl-button fl-is-small">
    3438        <span class="fl-icon fl-is-small"><i class="far fa-eye"></i></span>
    3539        <span>' . $this->get_view_count($id, 'flexi_view_count') . '</span></div>';
     
    4953
    5054    // Total number of like & unlike
    51     public function get_view_count($id, $key) {
     55    public function get_view_count($id, $key)
     56    {
    5257        $count = get_post_meta($id, $key, true);
    5358        return $count;
     
    5560
    5661    // Increase like
    57     public function increase_count($post_id, $key) {
     62    public function increase_count($post_id, $key)
     63    {
    5864
    5965        $count = (int) get_post_meta($post_id, $key, true);
     
    6369
    6470    // enable/disable option at Gallery -> Gallery Settings
    65     public function add_fields($new) {
     71    public function add_fields($new)
     72    {
    6673
    6774        $fields = array(
  • flexi/tags/4.27/includes/dashboard/class-flexi-dashboard-pro.php

    r2674150 r3183294  
    11<?php
     2
    23/**
    34 * Admin dashboard tab to enable Flexi-Pro
     
    910 * @subpackage Flexi/includes/dashboard
    1011 */
    11 class Flexi_Admin_Dashboard_Pro {
    12     public function __construct() {
     12class Flexi_Admin_Dashboard_Pro
     13{
     14    public function __construct()
     15    {
    1316        add_filter('flexi_dashboard_tab', array($this, 'add_tabs'));
    1417        add_action('flexi_dashboard_tab_content', array($this, 'add_content'));
    1518    }
    1619
    17     public function add_tabs($tabs) {
     20    public function add_tabs($tabs)
     21    {
    1822
    1923        $extra_tabs = array("pro" => __('Flexi-Pro', 'flexi'));
     
    2529    }
    2630
    27     public function add_content() {
     31    public function add_content()
     32    {
    2833
    2934        if (isset($_GET['tab']) && 'pro' == $_GET['tab']) {
     
    3237    }
    3338
    34     public function flexi_dashboard_content() {
     39    public function flexi_dashboard_content()
     40    {
    3541        ob_start();
    3642
    37         ?>
     43?>
    3844
    3945<div style="text-align:right;"> <a href="https://odude.com/product-category/flexi/"
     
    5258
    5359<?php
    54 if (isset($_POST['flexi_license'])) {
     60        if (isset($_POST['flexi_license'])) {
    5561            if (function_exists('flexi_process_license')) {
    5662
     
    6470
    6571                $res = flexi_process_license(sanitize_text_field($_POST['flexi_license']));
    66                 if ('404' == $res->data->status) {
    67                     echo '<div class="card"><h3>' . esc_attr($res->message) . '</h3></div>';
     72
     73
     74                // Check if errors are present in the response data
     75                if (isset($res->data->errors)) {
     76                    // Retrieve the first key from the errors object
     77                    $errorKeys = array_keys(get_object_vars($res->data->errors));
     78                    $errorType = $errorKeys[0] ?? null;
     79
     80                    // Check if the error type and message exist
     81                    if ($errorType && isset($res->data->errors->$errorType[0])) {
     82                        echo '<div class="card"><h3>' . $res->data->errors->$errorType[0] . '</h3></div>';
     83                    } else {
     84                        echo '<div class="card"><h3>Unknown error occurred.</h3></div>';
     85                    }
    6886                } else {
    6987                    echo '<div class="card"><h3>License activated</h3></div>';
     
    8098    <b>Flexi Version: </b> <?php echo esc_attr(FLEXI_VERSION); ?><br>
    8199    <b>Flexi-PRO status:</b> <?php if (is_flexi_pro()) {
    82             echo "#####.....<b>Activated</b>.....#####";
    83         } else {
    84             echo "Not activated";
    85         }?><br>
     100                                            echo "#####.....<b>Activated</b>.....#####";
     101                                        } else {
     102                                            echo "Not activated";
     103                                        } ?><br>
    86104    <?php
    87 if (is_flexi_pro()) {
    88             echo "<b>Flexi-PRO version </b>:" . esc_attr(FLEXI_PRO_VERSION);
     105            if (is_flexi_pro()) {
     106                echo "<b>Flexi-PRO version </b>:" . esc_attr(FLEXI_PRO_VERSION);
    89107
    90             $expire = get_option('FLEXI_PRO_EXPIRE', '');
    91             if ('' != $expire) {
    92                 $expdAt = date($expire);
    93                 $today = date("Y-m-d H:i:s");
    94                 if ($today >= $expdAt) {
    95                     echo "<br><b>Expired:</b> " . esc_attr($expdAt) . '<br><code> Please renew to regain access for premium features.</code>';
    96                     update_option('FLEXI_PRO', 'FAIL');
    97                 } else {
    98                     echo "<br><b>Expires:</b> " . esc_attr($expdAt);
     108                $expire = get_option('FLEXI_PRO_EXPIRE', '');
     109                if ('' != $expire) {
     110                    $expdAt = date($expire);
     111                    $today = date("Y-m-d H:i:s");
     112                    if ($today >= $expdAt) {
     113                        echo "<br><b>Expired:</b> " . esc_attr($expdAt) . '<br><code> Please renew to regain access for premium features.</code>';
     114                        update_option('FLEXI_PRO', 'FAIL');
     115                    } else {
     116                        echo "<br><b>Expires:</b> " . esc_attr($expdAt);
     117                    }
    99118                }
    100119            }
    101         }
    102         ?>
     120            ?>
    103121    <br>
    104122    <?php
    105 echo get_option('FLEXI_PRO_RESPONSE', '');
    106         ?>
     123            echo get_option('FLEXI_PRO_RESPONSE', '');
     124            ?>
    107125</div>
    108126
     
    160178</div>
    161179<?php
    162 $content = ob_get_clean();
     180        $content = ob_get_clean();
    163181        return $content;
    164182    }
  • flexi/tags/4.27/includes/functions.php

    r3175924 r3183294  
    13191319    // flexi_log($extra_param);
    13201320    if (isset($extra_param[$key]) && 'on' == $extra_param[$key]) {
     1321        // Flexi_log($extra_param[$key]);
    13211322        return '';
    13221323    } else {
  • flexi/tags/4.27/public/partials/layout/gallery/portfolio/loop.php

    r2684792 r3183294  
    4242            if (flexi_evalue_toggle('excerpt', $evalue) != 'display:none') {
    4343            ?>
    44             <div class="fl-content fl-mb-1 fl-is-size-6 <?php echo esc_attr($style_text_color); ?>">
    45                 <?php echo wpautop(wp_kses_post(flexi_excerpt(20))); ?>
    46             </div>
     44                <div class="fl-content fl-mb-1 fl-is-size-6 <?php echo esc_attr($style_text_color); ?>">
     45                    <?php echo wpautop(wp_kses_post(flexi_excerpt(20))); ?>
     46                </div>
    4747            <?php
    4848            }
     
    121121        </div>
    122122        <?php echo wp_kses_post(flexi_show_addon_gallery($evalue, get_the_ID(), 'portfolio')); ?>
    123 
    124123    </div>
    125124
  • flexi/trunk/README.txt

    r3175928 r3183294  
    66Requires PHP: 5.5
    77Tested up to: 6.6.2
    8 Stable tag: 4.26
     8Stable tag: 4.27
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    190190== Changelog ==
    191191
     192= 4.27 =
     193* Block editor recreated supporting latest version of wordpress.
     194
     195
    192196= 4.26 =
    193197* No features added. Only made it compatible to work with latest version of wordpress
  • flexi/trunk/flexi.php

    r3175928 r3183294  
    1010 *
    1111 * @link              https://odude.com/
    12  * @since             4.26
     12 * @since             4.27
    1313 * @package           Flexi
    1414 *
     
    1717 * Plugin URI:        https://odude.com/
    1818 * Description:       User submitted images/video into gallery
    19  * Version:           4.26
     19 * Version:           4.27
    2020 * Author:            ODude
    2121 * License:           GPL-2.0+
     
    3838// The current version of the plugin
    3939if (!defined('FLEXI_VERSION')) {
    40     define('FLEXI_VERSION', '4.26');
     40    define('FLEXI_VERSION', '4.27');
    4141}
    4242define('FLEXI_FOLDER', dirname(plugin_basename(__FILE__)));
     
    4444define('FLEXI_BASE_DIR', WP_CONTENT_DIR . '/plugins/' . FLEXI_FOLDER . '/');
    4545define('FLEXI_ROOT_URL', plugin_dir_url(__FILE__));
    46 define('FLEXI_HOST', "https://odude.com/wp-json/lmfwc/v2/licenses/");
     46define('FLEXI_HOST', "https://odude.com/flexi/wp-json/lmfwc/v2/licenses/");
    4747define('FLEXI_CK', 'ck_cc93b6452693ea129f6fb4696f50275a4282840a');
    4848define('FLEXI_CS', 'cs_5bab8367ab36992b00f1fe69d866c3bbf4820dbe');
  • flexi/trunk/includes/class-flexi-gallery.php

    r2743905 r3183294  
    526526?>
    527527
    528 <script>
    529 jQuery(document).ready(function() {
    530     // console.log("start");
    531     document.documentElement.style.setProperty('--flexi_padding', jQuery("#padding").text());
    532 
    533     <?php
     528            <script>
     529                jQuery(document).ready(function() {
     530                    // console.log("start");
     531                    document.documentElement.style.setProperty('--flexi_padding', jQuery("#padding").text());
     532
     533                    <?php
    534534                    $enable_conflict = flexi_get_option('conflict_disable_fancybox', 'flexi_conflict_settings', 0);
    535535                    if ('1' != $enable_conflict) {
    536536                        if ('inline' == $atts['popup']) {
    537537                    ?>
    538     jQuery('[data-fancybox-trigger').fancybox({
    539         selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
    540         thumbs: {
    541             autoStart: false
    542         },
    543         protect: false,
    544         arrows: false,
    545     });
    546     <?php
     538                            jQuery('[data-fancybox-trigger').fancybox({
     539                                selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
     540                                thumbs: {
     541                                    autoStart: false
     542                                },
     543                                protect: false,
     544                                arrows: false,
     545                            });
     546                        <?php
    547547                        } elseif ('custom' == $atts['popup']) {
    548548
    549549                        ?>
    550     jQuery('[custom-lightbox').fancybox({
    551         selector: '.flexi_show_popup_custom a:visible',
    552         thumbs: {
    553             autoStart: false
    554         },
    555         autoSize: false,
    556         protect: false,
    557         arrows: false,
    558     });
    559     <?php
     550                            jQuery('[custom-lightbox').fancybox({
     551                                selector: '.flexi_show_popup_custom a:visible',
     552                                thumbs: {
     553                                    autoStart: false
     554                                },
     555                                autoSize: false,
     556                                protect: false,
     557                                arrows: false,
     558                            });
     559                        <?php
    560560                        } elseif ('simple' == $atts['popup'] || 'simple_info' == $atts['popup']) {
    561561                        ?>
    562562
    563     var lightbox = GODude();
    564     var lightboxDescription = GODude({
    565         selector: '.godude',
    566     });
    567     <?php
     563                            var lightbox = GODude();
     564                            var lightboxDescription = GODude({
     565                                selector: '.godude',
     566                            });
     567                        <?php
    568568                        } else {
    569569                        ?>
    570     jQuery('[data-fancybox-trigger').fancybox({
    571         selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
    572         thumbs: {
    573             autoStart: true
    574         },
    575         protect: true,
    576         caption: function(instance, item) {
    577             //This is not working on ajax loading. only for for page navigation.
    578             // return jQuery(this).closest('flexi_media_holder').find('flexi_figcaption').html();
    579             return jQuery(this).find('.flexi_figcaption').html();
    580 
    581 
    582         }
    583     });
    584     <?php
     570                            jQuery('[data-fancybox-trigger').fancybox({
     571                                selector: '.flexi_show_popup_<?php echo esc_attr($atts['popup']); ?> a:visible',
     572                                thumbs: {
     573                                    autoStart: true
     574                                },
     575                                protect: true,
     576                                caption: function(instance, item) {
     577                                    //This is not working on ajax loading. only for for page navigation.
     578                                    // return jQuery(this).closest('flexi_media_holder').find('flexi_figcaption').html();
     579                                    return jQuery(this).find('.flexi_figcaption').html();
     580
     581
     582                                }
     583                            });
     584                    <?php
    585585                        }
    586586                    }
    587587                    ?>
    588588
    589 });
    590 </script>
    591 
    592 <?php
     589                });
     590            </script>
     591
     592        <?php
    593593            $put = ob_get_clean();
    594594            echo $put;
     
    610610
    611611        ?>
    612 <style>
    613 :root {
    614     --flexi_t_width: <?php echo esc_attr($t_width);
    615     ?>px;
    616     --flexi_t_height: <?php echo esc_attr($t_height);
    617     ?>px;
    618     --flexi_m_width: <?php echo esc_attr($m_width);
    619     ?>px;
    620     --flexi_m_height: <?php echo esc_attr($m_height);
    621     ?>px;
    622     --flexi_l_width: <?php echo esc_attr($l_width);
    623     ?>px;
    624     --flexi_l_height: <?php echo esc_attr($l_height);
    625     ?>px;
    626     --flexi_padding: <?php echo esc_attr($padding);
    627     ?>px;
    628 }
    629 </style>
    630 <?php
     612        <style>
     613            :root {
     614                --flexi_t_width: <?php echo esc_attr($t_width);
     615                                    ?>px;
     616                --flexi_t_height: <?php echo esc_attr($t_height);
     617                                    ?>px;
     618                --flexi_m_width: <?php echo esc_attr($m_width);
     619                                    ?>px;
     620                --flexi_m_height: <?php echo esc_attr($m_height);
     621                                    ?>px;
     622                --flexi_l_width: <?php echo esc_attr($l_width);
     623                                    ?>px;
     624                --flexi_l_height: <?php echo esc_attr($l_height);
     625                                    ?>px;
     626                --flexi_padding: <?php echo esc_attr($padding);
     627                                    ?>px;
     628            }
     629        </style>
     630        <?php
    631631        if (isset($_GET['flexi_layout'])) {
    632632        ?>
    633 <style>
    634 .fl-column {
    635     border-radius: .500em;
    636     border: dotted;
    637 }
    638 </style>
    639 <script>
    640 jQuery(document).ready(function() {
    641     var colors = ['red', 'blue', 'green', 'yellow', 'cyan', 'orange', 'pink', 'grey', 'white', 'black',
    642         'rosybrown', 'tan', 'plum', 'saddlebrown'
    643     ];
    644     jQuery.each(jQuery('.fl-column'), function() {
    645         var new_color = colors[Math.floor(Math.random() * colors.length)];
    646         jQuery(this).css('background-color', new_color);
    647     });
    648 });
    649 </script>
    650 <?php
     633            <style>
     634                .fl-column {
     635                    border-radius: .500em;
     636                    border: dotted;
     637                }
     638            </style>
     639            <script>
     640                jQuery(document).ready(function() {
     641                    var colors = ['red', 'blue', 'green', 'yellow', 'cyan', 'orange', 'pink', 'grey', 'white', 'black',
     642                        'rosybrown', 'tan', 'plum', 'saddlebrown'
     643                    ];
     644                    jQuery.each(jQuery('.fl-column'), function() {
     645                        var new_color = colors[Math.floor(Math.random() * colors.length)];
     646                        jQuery(this).css('background-color', new_color);
     647                    });
     648                });
     649            </script>
     650        <?php
    651651        }
    652652        ?>
  • flexi/trunk/includes/class-flexi.php

    r2743905 r3183294  
    119119
    120120        //Block
    121         require_once plugin_dir_path(dirname(__FILE__)) . 'block/plugin.php';
     121        //require_once plugin_dir_path(dirname(__FILE__)) . 'block/plugin.php';
     122        require_once plugin_dir_path(dirname(__FILE__)) . 'blocks/flexi-gallery-block/flexi-gallery-block.php';
     123        require_once plugin_dir_path(dirname(__FILE__)) . 'blocks/flexi-form-block/flexi-form-block.php';
    122124
    123125        //Widgets
  • flexi/trunk/includes/class-flexi_ajax_like.php

    r2675492 r3183294  
    11<?php
     2
    23/**
    34 * Like/Unlike button on gallery page
     
    8788        $toggle = flexi_evalue_toggle('like', $evalue);
    8889
    89         if (($enable == 1)) {
     90        if (($enable == 1 && $toggle == "")) {
    9091            $extra_icon = array();
    9192            $nonce = wp_create_nonce('flexi_ajax_like');
     
    130131        // flexi_log($toggle);
    131132
    132         if (($enable == 1)) {
     133        if (($enable == 1 && $toggle == "")) {
    133134            $extra_icon = array();
    134135            $nonce = wp_create_nonce('flexi_ajax_like');
  • flexi/trunk/includes/class-flexi_view_count.php

    r2674031 r3183294  
    11<?php
     2
    23/**
    34 * Display view count on gallery page
     
    910 * @subpackage Flexi/includes
    1011 */
    11 class flexi_view_count {
    12     public function __construct() {
     12class flexi_view_count
     13{
     14    public function __construct()
     15    {
    1316        // add_action('flexi_module_grid', array($this, 'display_view_count'));
    1417        add_filter('flexi_settings_fields', array($this, 'add_fields'));
     
    1720    }
    1821
    19     public function display_view_count($container, $evalue = '', $id = '') {
     22    public function display_view_count($container, $evalue = '', $id = '')
     23    {
     24        //flexi_log('count page ' . $evalue . ' -- ' . $id);
    2025        $enable = flexi_get_option('evalue_count', 'flexi_image_layout_settings', 1);
    2126        $this->increase_count($id, 'flexi_view_count');
    22         // If page is detail page
     27        //If page is detail page
    2328        if ($evalue == '') {
    2429            $evalue .= 'count:on';
     
    2631
    2732        $toggle = flexi_evalue_toggle('count', $evalue);
    28         // flexi_log($toggle);
     33        //flexi_log("The value of count is: " .     $toggle . ' for evalue: ' . $evalue);
    2934
    30         if (($enable == 1)) {
     35        if ($enable == 1 && $toggle == "") {
    3136            $extra_icon = array();
    32 
    33             $div = '<div style="' . $toggle . '" class="fl-button fl-is-small">
     37            $div = '<div class="fl-button fl-is-small">
    3438        <span class="fl-icon fl-is-small"><i class="far fa-eye"></i></span>
    3539        <span>' . $this->get_view_count($id, 'flexi_view_count') . '</span></div>';
     
    4953
    5054    // Total number of like & unlike
    51     public function get_view_count($id, $key) {
     55    public function get_view_count($id, $key)
     56    {
    5257        $count = get_post_meta($id, $key, true);
    5358        return $count;
     
    5560
    5661    // Increase like
    57     public function increase_count($post_id, $key) {
     62    public function increase_count($post_id, $key)
     63    {
    5864
    5965        $count = (int) get_post_meta($post_id, $key, true);
     
    6369
    6470    // enable/disable option at Gallery -> Gallery Settings
    65     public function add_fields($new) {
     71    public function add_fields($new)
     72    {
    6673
    6774        $fields = array(
  • flexi/trunk/includes/dashboard/class-flexi-dashboard-pro.php

    r2674150 r3183294  
    11<?php
     2
    23/**
    34 * Admin dashboard tab to enable Flexi-Pro
     
    910 * @subpackage Flexi/includes/dashboard
    1011 */
    11 class Flexi_Admin_Dashboard_Pro {
    12     public function __construct() {
     12class Flexi_Admin_Dashboard_Pro
     13{
     14    public function __construct()
     15    {
    1316        add_filter('flexi_dashboard_tab', array($this, 'add_tabs'));
    1417        add_action('flexi_dashboard_tab_content', array($this, 'add_content'));
    1518    }
    1619
    17     public function add_tabs($tabs) {
     20    public function add_tabs($tabs)
     21    {
    1822
    1923        $extra_tabs = array("pro" => __('Flexi-Pro', 'flexi'));
     
    2529    }
    2630
    27     public function add_content() {
     31    public function add_content()
     32    {
    2833
    2934        if (isset($_GET['tab']) && 'pro' == $_GET['tab']) {
     
    3237    }
    3338
    34     public function flexi_dashboard_content() {
     39    public function flexi_dashboard_content()
     40    {
    3541        ob_start();
    3642
    37         ?>
     43?>
    3844
    3945<div style="text-align:right;"> <a href="https://odude.com/product-category/flexi/"
     
    5258
    5359<?php
    54 if (isset($_POST['flexi_license'])) {
     60        if (isset($_POST['flexi_license'])) {
    5561            if (function_exists('flexi_process_license')) {
    5662
     
    6470
    6571                $res = flexi_process_license(sanitize_text_field($_POST['flexi_license']));
    66                 if ('404' == $res->data->status) {
    67                     echo '<div class="card"><h3>' . esc_attr($res->message) . '</h3></div>';
     72
     73
     74                // Check if errors are present in the response data
     75                if (isset($res->data->errors)) {
     76                    // Retrieve the first key from the errors object
     77                    $errorKeys = array_keys(get_object_vars($res->data->errors));
     78                    $errorType = $errorKeys[0] ?? null;
     79
     80                    // Check if the error type and message exist
     81                    if ($errorType && isset($res->data->errors->$errorType[0])) {
     82                        echo '<div class="card"><h3>' . $res->data->errors->$errorType[0] . '</h3></div>';
     83                    } else {
     84                        echo '<div class="card"><h3>Unknown error occurred.</h3></div>';
     85                    }
    6886                } else {
    6987                    echo '<div class="card"><h3>License activated</h3></div>';
     
    8098    <b>Flexi Version: </b> <?php echo esc_attr(FLEXI_VERSION); ?><br>
    8199    <b>Flexi-PRO status:</b> <?php if (is_flexi_pro()) {
    82             echo "#####.....<b>Activated</b>.....#####";
    83         } else {
    84             echo "Not activated";
    85         }?><br>
     100                                            echo "#####.....<b>Activated</b>.....#####";
     101                                        } else {
     102                                            echo "Not activated";
     103                                        } ?><br>
    86104    <?php
    87 if (is_flexi_pro()) {
    88             echo "<b>Flexi-PRO version </b>:" . esc_attr(FLEXI_PRO_VERSION);
     105            if (is_flexi_pro()) {
     106                echo "<b>Flexi-PRO version </b>:" . esc_attr(FLEXI_PRO_VERSION);
    89107
    90             $expire = get_option('FLEXI_PRO_EXPIRE', '');
    91             if ('' != $expire) {
    92                 $expdAt = date($expire);
    93                 $today = date("Y-m-d H:i:s");
    94                 if ($today >= $expdAt) {
    95                     echo "<br><b>Expired:</b> " . esc_attr($expdAt) . '<br><code> Please renew to regain access for premium features.</code>';
    96                     update_option('FLEXI_PRO', 'FAIL');
    97                 } else {
    98                     echo "<br><b>Expires:</b> " . esc_attr($expdAt);
     108                $expire = get_option('FLEXI_PRO_EXPIRE', '');
     109                if ('' != $expire) {
     110                    $expdAt = date($expire);
     111                    $today = date("Y-m-d H:i:s");
     112                    if ($today >= $expdAt) {
     113                        echo "<br><b>Expired:</b> " . esc_attr($expdAt) . '<br><code> Please renew to regain access for premium features.</code>';
     114                        update_option('FLEXI_PRO', 'FAIL');
     115                    } else {
     116                        echo "<br><b>Expires:</b> " . esc_attr($expdAt);
     117                    }
    99118                }
    100119            }
    101         }
    102         ?>
     120            ?>
    103121    <br>
    104122    <?php
    105 echo get_option('FLEXI_PRO_RESPONSE', '');
    106         ?>
     123            echo get_option('FLEXI_PRO_RESPONSE', '');
     124            ?>
    107125</div>
    108126
     
    160178</div>
    161179<?php
    162 $content = ob_get_clean();
     180        $content = ob_get_clean();
    163181        return $content;
    164182    }
  • flexi/trunk/includes/functions.php

    r3175924 r3183294  
    13191319    // flexi_log($extra_param);
    13201320    if (isset($extra_param[$key]) && 'on' == $extra_param[$key]) {
     1321        // Flexi_log($extra_param[$key]);
    13211322        return '';
    13221323    } else {
  • flexi/trunk/public/partials/layout/gallery/portfolio/loop.php

    r2684792 r3183294  
    4242            if (flexi_evalue_toggle('excerpt', $evalue) != 'display:none') {
    4343            ?>
    44             <div class="fl-content fl-mb-1 fl-is-size-6 <?php echo esc_attr($style_text_color); ?>">
    45                 <?php echo wpautop(wp_kses_post(flexi_excerpt(20))); ?>
    46             </div>
     44                <div class="fl-content fl-mb-1 fl-is-size-6 <?php echo esc_attr($style_text_color); ?>">
     45                    <?php echo wpautop(wp_kses_post(flexi_excerpt(20))); ?>
     46                </div>
    4747            <?php
    4848            }
     
    121121        </div>
    122122        <?php echo wp_kses_post(flexi_show_addon_gallery($evalue, get_the_ID(), 'portfolio')); ?>
    123 
    124123    </div>
    125124
Note: See TracChangeset for help on using the changeset viewer.